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 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

Currently have this: foreach (var series in Chart1.Series) { series.Enabled = false; } I
There are a series of prior questions that tangentially ask this question, but not
We have in store an app which displays a series of videos through HTTP
I've got a databound series of predefined shapes (Path with Data= set) which each
I am writing an series of web interfaces to some data. I have WebMethods
I am studying business models and UML. I read that a 'Model' is a
My code is starting to look out of control so I thought I would
I'm using constructor injection for the first time and wish to write my code
Git has a bunch of procedures for altering history. ( rebase , filter-branch ,
In our application, some of our REST-style WCF calls are failing. These calls are

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.