Reading primitive procedures
Frank Lay <[email protected]> Sat, 17 Dec 2011 23:52:41 +0000
| Newsgroups | gmane.lisp.scheme.scheme48 |
|---|---|
| Message-ID | <CA+rVOkwMw1OXWZ9FXN=N47j9owK4wvtT_xfbdpxgJ0xuaxYmzg@mail.gmail.com> |
Hello,
I don't understand the following Scheme behaviour:
> (read)
+
'+
> (read)
1 +
1
#{Procedure 93 +}
Why in the second interaction is the input '+' read as a procedure, but in
the first as a symbol?
I am very new to Scheme, so my apologies if this is a silly question. I'm
trying to write an RPN interpreter in Scheme, and I thought I'd apply the
procedure read from the input to a stack of operands, however, because of
the first case, this method isn't robust. I don't understand how to
'unsymbolise' a symbol into its corresponding procedure. Maybe there is a
better way to do this?
Thanks for reading.