10 @data = {} of String => Mal::Type
13 def initialize(@outer, binds, exprs : Array(Mal::Type))
14 @data = {} of String => Mal::Type
16 eval_error "binds must be list or vector" unless binds.is_a? Array
19 # Array#zip() can't be used because overload resolution failed
20 (0...binds.size).each do |idx|
21 sym = binds[idx].unwrap
22 eval_error "bind name must be symbol" unless sym.is_a? Mal::Symbol
25 eval_error "missing variable parameter name" if binds.size == idx
26 next_param = binds[idx+1].unwrap
27 eval_error "bind name must be symbol" unless next_param.is_a? Mal::Symbol
28 var_args = Mal::List.new
29 exprs[idx..-1].each{|e| var_args << e} if idx < exprs.size
30 @data[next_param.str] = Mal::Type.new var_args
34 @data[sym.str] = exprs[idx]
39 puts "ENV BEGIN".colorize.red
41 puts " #{k} -> #{print(v)}".colorize.red
43 puts "ENV END".colorize.red
51 return self if @data.has_key? key
63 eval_error "'#{key}' not found" unless e