Re: weird symbols in sc-expand output (was Re: defining module from macro)

"Scott G. Miller" <[email protected]>
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
On Wed, Aug 23, 2006 at 04:50:20AM -0700, Dan wrote:
> Scott, please help me out. I just need to go from the
> entities #%quote, #&lambda etc to the symbols quote,
> lambda etc. Nothing complicated, just a suggestion.
> symbol->string doesn't work on them, they can't be
> typed in... what can I do?

You could create a similar function, for example:

(define (syntoken->symbol token)
  (case token
    ((#%quote) 'quote)
    ((#%begin) 'begin)
    ((#%lambda) 'lambda)
    ((#%define) 'define)
    ((#%letrec) 'letrec)
    ((#%program) 'program)
    ((#%set!) 'set!)
    ((#%if) 'if)
    ((#%annotate) 'annotate)
    (else (error 'syntoken->symbol "Invalid syntax token '~s'" token))))

Or use an association list.

Cheers, 
  Scott

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.