Looking for tools on Sexp expressions in Ruby [closed]
-
30-01-2021 - |
Domanda
I am a recent fan of s-exp expressions in Ruby. I discovered Sexpistol parser for instance.
Are you using other dedicated tools around them (schemas etc ) ?
Soluzione
You might check out Lispy: https://github.com/ryan-allen/lispy
It's no quite s-expressions, but similar in concept..
Altri suggerimenti
I've been rolling my own handlers for s-expressions in Ruby, but I'm loving the relative ease with which they can be manipulated.
If you haven't seen Ruby's built-in Ripper library yet, it's worth checking out:
> require 'ripper'
> Ripper.sexp("1 + 1")
=> [:program, [[:binary, [:@int, "1", [1, 0]], :+, [:@int, "1", [1, 4]]]]]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow