From: Martin DeMello Date: 2007-04-25T00:04:11+09:00 Subject: Re: Arrow operator with dash instead of equals (->) On 4/24/07, Andrew Green wrote: > > As you can see it's mainly declarative. However this part > > |{ (ROOT->has_given_names).textBPV + " " + (ROOT->has_last_names).textBPV }| > > is read by our interpreter only as a string between a |{ and a }| . > > That string is then passed to the Ruby interpreter and is meant to be > run (from within a specific context that our interpreter determines). In > these bits we don't want just our language running about, of course, we > want full-blown Ruby code with extensions that allow a programmer to > refer to the graph traversal rules using a syntax similar to that used > in the rule definitions that appear _outside_ the Ruby code blocks. Rather than leaving the |{}| blocks entirely alone, you could preprocess them to change the -> to something ruby will accept, and then run the interpreter over the preprocessed string. Won't be a trivial task, but should be easier than any of the alternatives. martin