[plt-scheme] Syntax objects and strings (or "stupid infix tricks")
John Clements
clements at brinckerhoff.org
Thu Dec 7 17:13:20 EST 2006
On Dec 7, 2006, at 12:46 PM, Corey Sweeney wrote:
> That works. (eval `(infix ,(read-syntax `thingy1 (open-input-
> string "(2 + 3)")))) does produce 5.
>
> Thanks
>
> For fun I decided to test it's generality, I tried:
>
> (read-syntax `thingy2 (open-input-string "((("))
>
> Which immedately complained about missmatched parenthisis. I don't
> really need to do this, but do you know what one would one do if
> they needed to parse a language that didn't use parenthisis
> charactors in the traditional maner?
You'd probably want to use a traditional parser. One such parser is
Scott Owens' parser-tools package, which (IIRC) is a part of the
standard DrScheme distribution.
HTH,
John Clements
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20061207/35d52434/smime.bin
More information about the plt-scheme
mailing list