What is ' (apostrophe) in Lisp / Scheme?

后端 未结 7 652
情深已故
情深已故 2021-02-01 12:16

I am on day 1 hour 1 of teaching myself Scheme. Needless to say, I don\'t understand anything. So I\'m reading The Little Schemer and using this thing:

相关标签:
7条回答
  • 2021-02-01 12:59

    SISC is good, but an even more lightweight online Scheme executor is http://codepad.org. It's not actually a REPL in that it's not interactive, but it's pretty close. Code you submit is executed on the server side instead of using a browser applet. And you can share code that you're running by short URL.

    The about page on codepad says it uses "MzScheme v372 [cgc]".

    I use codepad for all kinds of quick snippet testing (including testing code samples for SO answers!).

    For the quote syntax, the difference can be seen using code like this:

    (let ((x 5))
      (display x) (newline)
      (display 'x) (newline))
    

    This displays:

    5
    x
    

    In the first case, x is evaluated and passed to display, which prints 5. In the second case, the symbol x (which isn't the same thing as a character string) is passed to display, which prints the name of the symbol.

    0 讨论(0)
提交回复
热议问题