That works. (eval `(infix ,(read-syntax `thingy1 (open-input-string "(2 + 3)")))) does produce 5. <br><br>Thanks<br><br>For fun I decided to test it's generality, I tried: <br><br>(read-syntax `thingy2 (open-input-string "((("))
<br><br>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?
<br><br>Corey<br><br><br><br><div><span class="gmail_quote">On 12/7/06, <b class="gmail_sendername">Danny Yoo</b> <<a href="mailto:dyoo@hkn.eecs.berkeley.edu">dyoo@hkn.eecs.berkeley.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>> Is there a way to turn a string into a syntax object without calling read?<br>> Something feels wrong with what i'm doing. {I mean someting feels wrong<br>> beond the fact that i'm dealing with infix notation ;)}
<br><br>Hi Corey,<br><br>The function READ-SYNTAX, coupled with making a string look like a port<br>through the OPEN-INPUT-STRING function, should do the trick. Take a look<br>at READ-SYNTAX in the help desk first, because it needs to take an extra
<br>argument, compared to regular READ.<br><br><br>> i've written a re-infixer that does the reverse of Dannys "infix"<br>> package.<br><br>[some code cut]<br><br>Ack! I didn't mean for things to get this perverse.
<br></blockquote></div><br><br clear="all"><br>-- <br>((lambda (y) (y y)) (lambda (y) (y y)))