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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:18:46+00:00 2026-05-26T08:18:46+00:00

I have two somewhat related problems, shown by the following: user=> (if (symbol? 5)

  • 0

I have two somewhat related problems, shown by the following:

user=> (if (symbol? 5) (meta (var 5)) 5)
CompilerException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:6) 
user=> (defn dometa [x] (if (symbol? x) (meta (var x)) x))
CompilerException java.lang.RuntimeException: Unable to resolve var: x in this context, compiling:(NO_SOURCE_PATH:7) 
user=> 

In the first case, since 5 is not a symbol I would not expect (meta (var 5)) to be evaluated, but it is (or at least that’s the way it seems to me).

In the second case, if I want to place the first expression in a function, and parameterize the value being tested, the (var …) function no longer works.

  • 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-26T08:18:47+00:00Added an answer on May 26, 2026 at 8:18 am

    The Var object is looked up at compile time. For the behaviour I’m inferring from your examples, you should use find-var.

    user=> (if (symbol? 5) (meta (find-var 5)) 5)
    5
    user=> (defn dometa [x] (if (symbol? x) (meta (find-var x)) x))
    #'user/dometa
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is somewhat related to this question , but not quite. I have two
Have two folders with approx. 150 java property files. In a shell script, how
I have two queries, as following: SELECT SQL_CALC_FOUND_ROWS Id, Name FROM my_table WHERE Name
So I have two different files somewhat like this: file1.py from file2 import *
this is somewhat related to the post in: Perform OR on two hash outputs
Sorry for the somewhat cryptic title! I'll try to explain. I have the following
I have two somewhat big (4+ million records) tables with identical structure, and they
I have a query that UNION 's two somewhat similar datasets, but they both
Somewhat related to this question . I'm trying to create a window with two
I have two directories in /var/www (say, /var/www/app1 and /var/www/app2) whose error logs I

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.