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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:50:33+00:00 2026-05-29T19:50:33+00:00

Per http://www.assembla.com/spaces/clojure/wiki/Datatypes I should be able to type the following into a lein reply:

  • 0

Per http://www.assembla.com/spaces/clojure/wiki/Datatypes

I should be able to type the following into a lein reply:

(deftype Bar [a b c d e])

(def b (Bar 1 2 3 4 5))

However when I do I get the following output:

java.lang.Exception: Expecting var, but Bar is mapped to class user.Bar (NO_SOURCE_FILE:31)

I’m confused and am a complete newb to clojure all help is appreciated!

NOTE: Tried same code in standard clojure repl and get same problem.

ANSWER: Well I answered my own question with a little additional searching. Turns out the sample was bad. The correct way to instantiate Bar would be:

(def b (Bar. 1 2 3 4 5))

The . at the end of Bar in that usage is important. Still don’t quite understand why (so you clojure experts please elaborate if you have time since I would like to know the details 😉 ).

Thanks everyone!

  • 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-29T19:50:34+00:00Added an answer on May 29, 2026 at 7:50 pm

    I’m not that familiar with deftype, but from what I see you need a point to instantiate a type, try this:

    (deftype Bar [a b c d e])
    
    (def b (Bar. 1 2 3 4 5))
    

    Note it’s not Bar, but Bar.. See examples e.g. here:

    • http://pastebin.com/9vqPpebT
    • http://onclojure.com/2010/08/26/reusable-method-implementations-for-deftypes/ (which uses (new foo ...) instead of (foo. ...))

    This thread seems to indicate this was a change in deftype:

    • http://osdir.com/ml/clojure/2010-04/msg00526.html

    or, to put it the other way around, the docs on the page you link to seem outdated.

    Hope this helps.

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

Sidebar

Related Questions

As per the thread: http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Visio/Q_24660513.html I should be able to model a database (like
As per JIRA documentation http://www.atlassian.com/software/jira/docs/latest The following filter will show the issues opned by
I recently ran the database repair tool as per this link: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool At the
For example the mega menu looks like as per below site example http://www.javascriptkit.com/script/script2/jkmegamenu.shtml
I am trying to get my code working as per the instruction on http://www.paulstovell.com/vb-anonymous-methods
I am following this tutorial http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics . As per this tutorial,when i pass a
As per http://www.vmware.com/support/esx15/doc/esx15_runvm5.html , how would one go about generating the UUID format that
I am trying to install MySQLdb for Python 2.6 as per these instructions: http://www.tutorialspoint.com/python/python_database_access.htm
As per http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf , JavaScript has 6 types: undefined , null , boolean ,
Switching from JVM 1.4 to 1.5 has performance benefits as per release notes. http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#performance

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.