Arc Forumnew | comments | leaders | submitlogin
4 points by suzuki 5189 days ago | link | parent

No, I have not played the original Arc yet and had hardly known both implementations in Java until recently. My version 1 implementation was a little Lisp written in ISO Standard Pascal:

  Little Lambda Lisp in Standard Pascal
  http://www.oki-osk.jp/esc/llsp/v1.html
You find the notable(?) feature of Semi-Arc, macro expansion without free symbol capture, even in the version 2 of it:

  Little Lambda Lisp 2 in Standard Pascal
  http://www.oki-osk.jp/esc/llsp/v2.html
I had translated it to Ruby, Python, C# and Java. Recently I noticed that its design is near to the core of Arc. I made it up so that it may look Arc:-). The result is Semi-Arc.

As for argument destructuring, I implemented it in a simple, general and recursive (but not so efficient) way. Track the variable 'nestedArgs' in the method 'compile(Cell j, Cell env)' in the source:

  Interp.java
  http://www.oki-osk.jp/esc/llsp/10/1/Interp.java.html
Also, you can inspect the implementation interactively:

  arc> (def f ((a b)) (+ a b))
  #<fn:1>
  arc> (inspect f)
  (#<fn> ((1)) (apply (#<fn> ((2) #<none>) (+ #0:0:a #0:1:b)) #0:0:$G453))
  arc>