implemented when-let macro
implemented while macro