Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
μSchemeR関連
parameters = [:factorial]
args = [[:lambda, [:n], [:if, [:<, :n, 1], 1, [:*, :n, [:factorial, [:-, :n, 1]]]]]]
body = [:factorial, 4]
ext_env = [{:factorial=>:dummy},
{:+ =>[:prim, #<Proc:0x000055a6a4665a80@μSchemeR1.rb:24 (lambda)>],
:- =>[:prim, #<Proc:0x000055a6a4665a30@μSchemeR1.rb:25 (lambda)>],
:* =>[:prim, #<Proc:0x000055a6a46659e0@μSchemeR1.rb:26 (lambda)>],
:/ =>[:prim, #<Proc:0x000055a6a4665990@μSchemeR1.rb:27 (lambda)>],
:> =>[:prim, #<Proc:0x000055a6a4665940@μSchemeR1.rb:28 (lambda)>],
:>= =>[:prim, #<Proc:0x000055a6a46658f0@μSchemeR1.rb:29 (lambda)>],
:< =>[:prim, #<Proc:0x000055a6a46658a0@μSchemeR1.rb:30 (lambda)>],
:<= =>[:prim, #<Proc:0x000055a6a4665850@μSchemeR1.rb:31 (lambda)>],
:== =>[:prim, #<Proc:0x000055a6a4665800@μSchemeR1.rb:32 (lambda)>]},
{:true=>true, :false=>false}]
args_val = [[:func,
[:n],
[:if, [:<, :n, 1], 1, [:*, :n, [:factorial, [:-, :n, 1]]]],
[{:factorial=>:dummy},
{:+ =>[:prim, #<Proc:0x00005584c68a1c18@μSchemeR1.rb:24 (lambda)>],
:- =>[:prim, #<Proc:0x00005584c68a1bc8@μSchemeR1.rb:25 (lambda)>],
:* =>[:prim, #<Proc:0x00005584c68a1b78@μSchemeR1.rb:26 (lambda)>],
:/ =>[:prim, #<Proc:0x00005584c68a1b28@μSchemeR1.rb:27 (lambda)>],
:> =>[:prim, #<Proc:0x00005584c68a1ad8@μSchemeR1.rb:28 (lambda)>],
:>= =>[:prim, #<Proc:0x00005584c68a1a88@μSchemeR1.rb:29 (lambda)>],
:< =>[:prim, #<Proc:0x00005584c68a1a38@μSchemeR1.rb:30 (lambda)>],
:<= =>[:prim, #<Proc:0x00005584c68a19e8@μSchemeR1.rb:31 (lambda)>],
:== =>[:prim, #<Proc:0x00005584c68a1998@μSchemeR1.rb:32 (lambda)>]},
{:true=>true, :false=>false}]]]
#set_extend_env!内
arg_val = [:func,
[:n],
[:if, [:<, :n, 1], 1, [:*, :n, [:factorial, [:-, :n, 1]]]],
[{:factorial=>:dummy},
{:+ =>[:prim, #<Proc:0x000055ad831a5be0@μSchemeR1.rb:24 (lambda)>],
:- =>[:prim, #<Proc:0x000055ad831a5b90@μSchemeR1.rb:25 (lambda)>],
:* =>[:prim, #<Proc:0x000055ad831a5b40@μSchemeR1.rb:26 (lambda)>],
:/ =>[:prim, #<Proc:0x000055ad831a5af0@μSchemeR1.rb:27 (lambda)>],
:> =>[:prim, #<Proc:0x000055ad831a5aa0@μSchemeR1.rb:28 (lambda)>],
:>= =>[:prim, #<Proc:0x000055ad831a5a50@μSchemeR1.rb:29 (lambda)>],
:< =>[:prim, #<Proc:0x000055ad831a5a00@μSchemeR1.rb:30 (lambda)>],
:<= =>[:prim, #<Proc:0x000055ad831a59b0@μSchemeR1.rb:31 (lambda)>],
:== =>[:prim, #<Proc:0x000055ad831a5960@μSchemeR1.rb:32 (lambda)>]},
{:true=>true, :false=>false}]]
#set_extend_env!後
ext_env = [{:factorial=>
[:func,
[:n],
[:if, [:<, :n, 1], 1, [:*, :n, [:factorial, [:-, :n, 1]]]],
[{:factorial=>:dummy},
{:+ =>[:prim, #<Proc:0x000055ad831a5be0@μSchemeR1.rb:24 (lambda)>],
:- =>[:prim, #<Proc:0x000055ad831a5b90@μSchemeR1.rb:25 (lambda)>],
:* =>[:prim, #<Proc:0x000055ad831a5b40@μSchemeR1.rb:26 (lambda)>],
:/ =>[:prim, #<Proc:0x000055ad831a5af0@μSchemeR1.rb:27 (lambda)>],
:> =>[:prim, #<Proc:0x000055ad831a5aa0@μSchemeR1.rb:28 (lambda)>],
:>= =>[:prim, #<Proc:0x000055ad831a5a50@μSchemeR1.rb:29 (lambda)>],
:< =>[:prim, #<Proc:0x000055ad831a5a00@μSchemeR1.rb:30 (lambda)>],
:<= =>[:prim, #<Proc:0x000055ad831a59b0@μSchemeR1.rb:31 (lambda)>],
:== =>[:prim, #<Proc:0x000055ad831a5960@μSchemeR1.rb:32 (lambda)>]},
{:true=>true, :false=>false}]]
},
{:+ =>[:prim, #<Proc:0x000055a6a4665a80@μSchemeR1.rb:24 (lambda)>],
:- =>[:prim, #<Proc:0x000055a6a4665a30@μSchemeR1.rb:25 (lambda)>],
:* =>[:prim, #<Proc:0x000055a6a46659e0@μSchemeR1.rb:26 (lambda)>],
:/ =>[:prim, #<Proc:0x000055a6a4665990@μSchemeR1.rb:27 (lambda)>],
:> =>[:prim, #<Proc:0x000055a6a4665940@μSchemeR1.rb:28 (lambda)>],
:>= =>[:prim, #<Proc:0x000055a6a46658f0@μSchemeR1.rb:29 (lambda)>],
:< =>[:prim, #<Proc:0x000055a6a46658a0@μSchemeR1.rb:30 (lambda)>],
:<= =>[:prim, #<Proc:0x000055a6a4665850@μSchemeR1.rb:31 (lambda)>],
:== =>[:prim, #<Proc:0x000055a6a4665800@μSchemeR1.rb:32 (lambda)>]},
{:true=>true, :false=>false}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.