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 ) ?

È stato utile?

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]]]]]

The fastest lib available is sfsexp (the small, fast s-expression library). It is written in C with Ruby bindings that you can see in action in the API Doc.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top