Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1093095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:46:48+00:00 2026-05-16T23:46:48+00:00

Various special characters in clojure are abbreviations for things (quote (a b)) is the

  • 0

Various special characters in clojure are abbreviations for things

(quote (a b)) is the same as '(a b)

as you can see by evaluating:

user> ''(a b)
(quote (a b))

This seems to be syntax as abbreviation, which strikes me as a fine idea.

But the syntax-quote, ` , seems special. I can’t think what would be equivalent to

`(a b)

I would have guessed something like (syntax-quote (a b)) , but it doesn’t work, and if I’ve just guessed wrong, I can’t find out what it’s really called.

user> '`(a b)
(clojure.core/seq (clojure.core/concat (clojure.core/list (quote user/a)) (clojure.core/list (quote user/b))))

Is a bit mystifying.

Presumably the reader’s doing something special, maybe because it needs to know the namespaces?

Interestingly, the special syntax used in the syntax-quote does work as I expected:

user> '~a
(clojure.core/unquote a)
user> '~@a
(clojure.core/unquote-splicing a)
user> '~'a
(clojure.core/unquote (quote a))

except for this one:

user> 'a#
a#

Which I would have thought produced something like (unquote (gensym "a"))

I do realise that I’m being a bit feeble here, and should just go and read the code. If no-one fancies explaining what’s going on or giving a reference, can anyone give me a hint about how to find the relevant code and what to look for?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:46:49+00:00Added an answer on May 16, 2026 at 11:46 pm

    I don’t think there’s a syntax-quote equivalent of the quote function.

    The Clojure reader is (currently) written in Java. The SyntaxQuoteReader class in src/jvm/clojure/lang/LispReader.java in the Clojure source is probably what you’ll want to read. It seems rather complex. You can see it building lists like (seq (concat ...)) there.

                    ret = RT.list(SEQ, RT.cons(CONCAT, sqExpandList(seq)));
    

    It’s common for the reader not to return straightforward Clojure code, but rather do the right thing in Java-land immediately. For example '[1 2 3] doesn’t yield the Clojure code (vector 1 2 3). Maybe it could work that way somehow, but it doesn’t. The reader just creates and returns the vector object itself.

    Likewise, the SyntaxQuoteReader does some magic in Java immediately to resolve symbol namespaces and create gensyms itself and it returns some mangled and complicated-looking Clojure code that does the right thing, but isn’t necessarily easy for a human to read. Whether it’s like this because it has to be, or because it’s easier to do it this way in Java, or for performance or some other reason, I don’t know. Likewise I don’t know if quasiquote could exist as a plain macro/special form in Clojure and doesn’t, or if it couldn’t exist at all. I don’t see why it couldn’t though.

    WrappingReader in the same file is the class that handles ' (plain old quote). You can see that it just wraps whatever you pass it in a list containing the symbol quote plus your argument. It’s much simpler. Note that this class also handles @, so that '@foo does return (deref foo).

    This thread might shed some more light.

    Edit

    Here’s a proof-of-concept quasiquote macro. Note that this code is relying upon and abusing Clojure internals in a horrible way. Please don’t use this for anything.

    user> (defmacro quasiquote [x]
            (let [m (.getDeclaredMethod clojure.lang.LispReader$SyntaxQuoteReader 
                                        "syntaxQuote" 
                                        (into-array [Object]))]
              (.setAccessible m true)
              (.invoke m nil (into-array [x]))))
    #'user/quasiquote
    user> (let [x 123] `(x 'x ~x))
    (user/x (quote user/x) 123)
    user> (let [x 123] (quasiquote (x 'x ~x)))
    (user/x (quote user/x) 123)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.