def macro_Q(args): return wrap_tf(types._function_Q(args[0]) and args[0].ismacro) # String functions def pr_str(args):
def function_Q(args): return wrap_tf(types._function_Q(args[0]) and not args[0].ismacro) def macro_Q(args): return wrap_tf(types._function_Q(args[0]) and args[0].ismacro)
'false?': types._false_Q, 'number?': types._number_Q, 'string?': types._string_Q, 'symbol': types._symbol, 'symbol?': types._symbol_Q, 'keyword': types._keyword, 'keyword?': types._keyword_Q, 'fn?': lambda x: (types._function_Q(x) and not hasattr(x, '_ismacro_')), 'macro?': lambda x: (types._function_Q(x) and hasattr(x, '_ismacro_') and x._ismacro_), 'pr-str': pr_str, 'str': do_str, 'prn': prn, 'println': println, 'readline': lambda prompt: mal_readline.readline(prompt), 'read-string': reader.read_str,
return atm.val ns = { '=': types._equal_Q, 'throw': throw, 'nil?': types._nil_Q, 'true?': types._true_Q, 'false?': types._false_Q, 'number?': types._number_Q, 'string?': types._string_Q, 'symbol': types._symbol, 'symbol?': types._symbol_Q, 'keyword': types._keyword, 'keyword?': types._keyword_Q, 'fn?': lambda x: (types._function_Q(x) and not hasattr(x, '_ismacro_')), 'macro?': lambda x: (types._function_Q(x) and hasattr(x, '_ismacro_') and x._ismacro_), 'pr-str': pr_str, 'str': do_str, 'prn': prn, 'println': println, 'readline': lambda prompt: mal_readline.readline(prompt), 'read-string': reader.read_str, 'slurp': lambda file: open(file).read(), '<': lambda a,b: a<b, '<=': lambda a,b: a<=b, '>': lambda a,b: a>b, '>=': lambda a,b: a>=b,
return atm.val ns = { '=': types._equal_Q, 'throw': throw, 'nil?': types._nil_Q, 'true?': types._true_Q, 'false?': types._false_Q, 'number?': types._number_Q, 'string?': types._string_Q, 'symbol': types._symbol, 'symbol?': types._symbol_Q, 'keyword': types._keyword, 'keyword?': types._keyword_Q, 'fn?': lambda x: (types._function_Q(x) and not hasattr(x, '_ismacro_')), 'macro?': lambda x: (types._function_Q(x) and hasattr(x, '_ismacro_') and x._ismacro_), 'pr-str': pr_str, 'str': do_str, 'prn': prn, 'println': println, 'readline': lambda prompt: mal_readline.readline(prompt), 'read-string': reader.read_str, 'slurp': lambda file: open(file).read(), '<': lambda a,b: a<b, '<=': lambda a,b: a<=b, '>': lambda a,b: a>b, '>=': lambda a,b: a>=b,