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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:43:17+00:00 2026-06-13T12:43:17+00:00

When I write a function call like this (my-function [a b c]) in Clojure.

  • 0

When I write a function call like this (my-function [a b c]) in Clojure. How does Clojure find my-function? Does it perform a lookup from global/per-namespace symbol table?

I’m assuming the symbol table is implemented as a hashtable which provides O(1) time complexity for lookup. It also needs to compare the function name as a string with the symbol from the table which should take O(n) time (n is the length of the symbol). It means the longer of the symbol the slower the name resolution would be. Is it correct?

  • 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-06-13T12:43:18+00:00Added an answer on June 13, 2026 at 12:43 pm

    namespaces indeed behave as maps and you can look at them directly with the ns-map function:

    autotestbed.core> (pprint (take 5 (ns-map *ns*)))
    nil
    ([sorted-map                                                                                               
      #<Var@6899a7ce:                                                                                          
        #<core$sorted_map clojure.core$sorted_map@5875c014>>]                                                  
     [read-line                                                                                                
      #<Var@1de9e86e: #<core$read_line clojure.core$read_line@57c00972>>]                                      
     [re-pattern                                                                                               
      #<Var@74064c7b:                                                                                          
        #<core$re_pattern clojure.core$re_pattern@37d02427>>]                                                  
     [keyword?                                                                                                 
      #<Var@4798088a:                                                                                          
        #<core$keyword_QMARK_ clojure.core$keyword_QMARK_@630b813f>>]                                          
     [hta-deploy-cmd                                                                                           
      #<Var@7a7bce95:                                                                                          
        #<core$hta_deploy_cmd autotestbed.core$hta_deploy_cmd@6a6a782d>>])
    

    more specifically they map vars to objects.

    if you really do want a function to be looked up in it’s var so changes propagate through your program instantly you can call the var instead of the function that was contained in the var at compile time, which results in a lookup on every call:

    (#'foo 4) looks the function up in the var every time
    (foo 4) looks it up in the map once when it's compiled.   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to write a simple function to call unmanaged code from managed code.
How can I write a plugin/function and then be able to call it like
I like to write my callback functions in a private namespace and then call
I want to write a function that you call like so: f(a, 1, [](float
On this website , the description of the iostringstream::write function says that: In case
I want to write an asynchronous function that accepts a closure with handlers like
I'd like write a function like the following // The type 'MethodGroup' below doesn't
My project.clj file looks like this (defproject cljs-template 0.1.0-SNAPSHOT :description FIXME: write this! :url
I have a function that looks like this class NSNode { function insertAfter(NSNode $node)
I'm looking to write a function that mimics the ajax calls from the jQuery

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.