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

  • SEARCH
  • Home
  • 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 4086666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:45:24+00:00 2026-05-20T18:45:24+00:00

Why does this series of clojure commands return false and not true? What is

  • 0

Why does this series of clojure commands return false and not true? What is the difference between the result of statement 1 “C” and 2 “(quote C)”?

; SLIME 2009-03-04
user> ('A 'B 'C)
C
user> (last '('A 'B 'C))
(quote C)
user> (= ('A 'B 'C) (last '('A 'B 'C)))
false

This question is somewhat similar to How does clojure's syntax-quote work?

  • 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-20T18:45:25+00:00Added an answer on May 20, 2026 at 6:45 pm

    In Clojure (and other Lisps) the ' is a shortcut for the form (quote ...). So when Clojure sees this:

    ('A 'B 'C)
    

    which is “translated” by the reader into:

    ((quote A) (quote B) (quote C))
    

    Each of those quote forms evaluates to a symbol, so (quote A) evaluates to the symbol named A. In Clojure, symbols are functions and can be applied, so ((quote A) (quote B) (quote C)) is actually a function call. From the docs:

    “Symbols, just like Keywords, implement IFn for invoke() of one argument (a map) with an optional second argument (a default value). For example (‘mysym my-hash-map :none) means the same as (get my-hash-map ‘mysym :none).”

    So what happens is that C is the default value and that’s why it’s returned.

    Meanwhile, this

    '('A 'B 'C)
    

    is translated by the reader into

    (quote ((quote A) (quote B) (quote C)))
    

    Which is actually a list of three elements, each of which is a list of two elements, the symbol quote and another symbol (in this case A, B, C).

    So, (last '('A 'B 'C)) is actually (quote C). That’s the difference between those two results, C is the symbol with the name C while (quote C) is a list of two elements.

    You can confirm this:

    user=> (class ('A 'B 'C))
    clojure.lang.Symbol
    user=> (class (last '('A 'B 'C)))
    clojure.lang.PersistentList
    user=> 
    

    Hope that’s clear!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does this pattern: setTimeout(function(){ // do stuff }, 0); Actually return control to the
Why does this javascript return 108 instead of 2008? it gets the day and
Why does this lambda expression not compile? Action a = () => throw new
Why does this test program result in a java.lang.IllegalMonitorStateException ? public class test {
Many languages have functions which only process plaintext, not binary. Does this mean that
Currently have this: foreach (var series in Chart1.Series) { series.Enabled = false; } I
Does this look like it should work? I'm wanting to generate directions from one
Does this smell? I have a few properties you can only set once. They
Does this code cause a memory leak: int main(){ int * a = new
Does this seem right, the dataFilePath is on disk and contains the right data,

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.