| I touched up Penknife over the weekend and got it into a working, pseudo-presentable state. ^_^ It's not the first time it's worked, but I started doing more development than testing at one point, and I hadn't brought it up to date with Rainbow in a while. For now, it should work, and it's quite a bit easier to load than it was a few days ago. ^_^ Penknife is intended for either Rainbow, official Arc 3.1, or Anarki, and I prefer Rainbow for its speed. Load Lathe and Penknife like so: (= lathe-dir* "my/path/to/lathe/arc/")
(load:+ lathe-dir* "loadfirst.arc")
(= penknife-dir* "my/path/to/penknife/")
(load:+ penknife-dir* "penknife.arc")
At this point, Penknife doesn't do a lot. The runtime is fairly comprehensive, but there's not much of a standard library. Nevertheless, it might be effective as a scripting language for Arc if you can figure out how to use it. This might get you started: arc> (pkrepl)
pk> [list q.a q.b q.c]
("a" "b" "c")
pk> [arc (trim " example Arc code ")]
"example Arc code"
pk> [fun square [x] [arc.* x x]]
...lots of output...
pk> square:arc.4
16
pk>
[let arcsym arc.sym
[mac* sym [] body
qq.[arcsym q[\,body]]]]
...lots of output...
pk> sym.my-symbol
my-symbol
pk> arc.type:sym.my-symbol
sym
pk> [sym symbol-starting-with-a-space--so-dont-do-this]
| symbol-starting-with-a-space--so-dont-do-this|
pk> sym[symbol with intentional spaces in it]
|symbol with intentional spaces in it|
pk> arc.bound:sym.unbound-arc-var
nil
pk> [arc bound&eval]:sym.unbound-arc-var
nil
pk>
[fun & [a]
[hf [b]
; Most Penknife lambda forms make reflection-friendly closures
; ("hefty-fns"), whereas tf and tf* make regular Arc closures
; ("thin-fns"). We're using Arc closures here so that Arc can
; call them, but I usually avoid thin-fns when I can for fear of
; premature optimization, even though Penknife doesn't actually
; have any standard reflection utilities yet.
[arc.andf [tf* [] args [apply a args]]
[tf* [] args [apply b args]]]]]
...lots of output...
pk> arc.bound&[arc eval]:sym.unbound-arc-var
nil
pk> [arc (= unbound-arc-var "My life is a lie! :D")]
"My life is a lie! :D"
pk> arc.bound&[arc eval]:sym.unbound-arc-var
"My life is a lie! :D"
pk> drop.
goodbye
arc>
If you try out Penknife but get stuck, let me know so I can explain or apologize for whatever you've encountered. ^_^ |