Search code examples
common-lispreader-macro

What's the difference between set-macro-character and set-dispatch-macro-character?


From the signatures of these functions, the obvious difference is that set-macro-character allows you to set reader macro function for a single character, and set-dispatch-macro-character allows you to set it for any combination of two characters. Is this the only difference? When do I need to use one instead of another?


Solution

  • set-macro-character governs reading objects marked with a single special character, e.g.,

    set-dispatch-macro-character governs reading objects marked with two (or more) characters, e.g.,

    See