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 934679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:02:26+00:00 2026-05-15T21:02:26+00:00

i have a simple clojure syntax problem (bc i am new to the language).

  • 0

i have a simple clojure syntax problem (bc i am new to the language). for both examples i have a list lst of (1 2 3 4):

in Lisp i can write:

=>`(first of list is ,(first lst))
(first of list is 1)

in Clojure, if i write the same thing (with the language translation of , to ~ as i THOUGHT i read somewhere) i get:

=>'(first of list is ~(first lst))
(first of list is (clojure.core/unquote (first lst)))

i was hoping i can do what i want to in Clojure as well, and that i just have the syntax wrong. all the examples i find though have functions first and use a ` (backtick). i dont want to call a function like:

`(my-function ~(first lst))

i just want to return ‘(some list with ,(first lst) replaced in it)

can i do such a thing in Clojure?

EDIT: i gave a poor example seeing as my ACTUAL problem dealt with strings. let me try another example…

=>(def color-lst ‘(red green blue))

what i wanted to return was:

=>`(the color i want is ~(first color-lst))

this yeilded all the strange returns i saw. the other way to do this is

=>(format “the color i want is %s” (first color-lst))

this is how i solved my problem.

  • 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-15T21:02:27+00:00Added an answer on May 15, 2026 at 9:02 pm

    Even if your problem is solved, there are some fundamental differences between CL and Clojure worth mentioning:

    The main difference concerning symbols in backquotes between CL and Clojure is, that Clojure resolves quasiquoted symbols; yielding a namespace qualified symbol (take a look at the reader section of the Clojure docs):

    user> `foo
    user/foo
    

    So, in CL:

    CL-USER> (let ((list '(foo bar baz)))
                `(first is ,(first list)))
    (FIRST IS FOO)
    

    But in Clojure:

    user> (let [lst '(foo bar baz)]
            `(first is ~(first lst)))
    (clojure.core/first user/is foo)
    

    In order to get a non-qualified symbol in Clojure (within backquotes), you’d have to use something like this:

    user> `~'foo
    foo
    

    So, to get the same result as the CL version (ignoring readtable-case), you’d have to use:

    user> (let [lst '(foo bar baz)]
            `(~'first ~'is ~(first lst)))
    (first is foo)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you are managing the schema yourself, just comment out… May 16, 2026 at 4:39 pm
  • Editorial Team
    Editorial Team added an answer This question is strongly related with this one. I would… May 16, 2026 at 4:39 pm
  • Editorial Team
    Editorial Team added an answer Your problem is pretty common and somewhat easy to fix… May 16, 2026 at 4:39 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'd like to be able to define lambdas using common Lisp syntax, in Clojure.
I am a beginner in Clojure, and I have a simple (stupid) question. I
I am a beginner in Clojure, and I have a simple question Lets say
I would like to write a simple multiplexing server in Clojure (as a sample
I have simple HQL query: var list = OpenSession() .CreateQuery(SELECT MAX(p.price) as max_price, COUNT(p.id)
I have started coding in clojure, and I'm really impressed by Enlive . One
I have already read various accounts of Clojure vs. Scala and while I realize
have anyone seen a Solr plugin example written in Clojure? I guess it should
I have simple 3 tier web application and have mostly CRUDE functionalities. Recently I
I have simple one column HTML files ( ebooks from Gutenberg Project). I want

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.