diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-16 23:57:50 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-16 23:57:50 -0500 |
| commit | 8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 (patch) | |
| tree | 13e5b2878f19ee24272ead8a92a9cb84b33ad0e5 /ruby/step3_env.rb | |
| parent | a05f7822b10ed4cdd61ed8384299a003baf1c1c6 (diff) | |
| download | mal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.tar.gz mal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.zip | |
All: move some fns to core. Major cleanup.
- Don't import/require core until step4.
- Define cond/or macros from step8
Diffstat (limited to 'ruby/step3_env.rb')
| -rw-r--r-- | ruby/step3_env.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ruby/step3_env.rb b/ruby/step3_env.rb index ee80432..7266424 100644 --- a/ruby/step3_env.rb +++ b/ruby/step3_env.rb @@ -60,12 +60,11 @@ end # repl repl_env = Env.new REP = lambda {|str| PRINT(EVAL(READ(str), repl_env)) } -_ref = lambda {|k,v| repl_env.set(k, v) } -_ref[:+, lambda {|a,b| a + b}] -_ref[:-, lambda {|a,b| a - b}] -_ref[:*, lambda {|a,b| a * b}] -_ref[:/, lambda {|a,b| a / b}] +repl_env.set(:+, lambda {|a,b| a + b}) +repl_env.set(:-, lambda {|a,b| a - b}) +repl_env.set(:*, lambda {|a,b| a * b}) +repl_env.set(:/, lambda {|a,b| a / b}) while line = Readline.readline("user> ", true) begin |
