Dark Hacker News
new
|
best
|
ask
|
show
|
jobs
Hacking S-expressions into Ruby | Dark Hacker News
Hacking S-expressions into Ruby
(sonnym.github.io)
31 points
by
sonnym
11 years ago
| 6 comments
_mikz
11 years ago
|
next
[−]
` puts RubyVM::InstructionSequence.compile('[]').disasm` points to `newarray` which is YARV instruction:
https://github.com/ruby/ruby/blob/ca6b174078fa15f33655be704d...
lectrick
11 years ago
|
parent
|
next
[−]
I don't suppose there's a way to hook into newarray ...?
Maybe a gem with a C component could provide a hook?
aaronem
11 years ago
|
root
|
parent
|
next
[−]
At some point it's surely simpler just to write a Lisp interpreter instead.
lookatparsetree
11 years ago
|
next
[−]
Have a look at
https://github.com/seattlerb/parsetree
bradleyland
11 years ago
|
parent
|
next
[−]
That version only works with 1.8. There is an updated fork though, sexp_processor:
https://github.com/seattlerb/sexp_processor
lectrick
11 years ago
|
root
|
parent
|
next
[−]
Or switch to Elixir and its nifty macro system, which I did.