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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:36:18+00:00 2026-05-23T20:36:18+00:00

> (cons 2 3) (2 . 3) The Lisp environment needs to allocate only

  • 0
> (cons 2 3) 
(2 . 3)

The Lisp environment needs to allocate only a single cons cell to connect the two items.

Above is from the Lisp book “Land of Lisp”. I don’t understand why this pair is only located in a single cons cell. What does the memory look like for this data?

  • 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-23T20:36:19+00:00Added an answer on May 23, 2026 at 8:36 pm

    A cons cell always holds two values, called car and cdr:

    +-----+-----+
    | car | cdr |
    +-----+-----+
    

    To represent a cons cell, Lisp has the “dot notation”:

    (car . cdr)
    

    The function cons creates such a cons cell from its two arguments:

    (cons 1 2)
    => (1 . 2)
    

    which can be thought of like this:

    +-----+-----+
    |  1  |  2  |
    +-----+-----+
    

    The values of a cons cell can also be “references” or “pointers” to other things. Those other things can, for example, be other cons cells:

    +-----+-----+     +-----+-----+
    |  1  |   ------->|  2  | nil |
    +-----+-----+     +-----+-----+
    

    This would be (1 . (2 . nil)) in dot notation. This chaining is used in Lisp to represent lists. Since lists are used for the representation of code, they are important for Lisp. Therefore, there is a shorter notation for them: (1 2).

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

Sidebar

Related Questions

What exactly is the definition of a Common Lisp Cons Cell? How is a
I'm trying to translate the following macro from land of lisp into clojure: (defmacro
In common lisp I can do this: (mapcar #'cons '(1 2 3) '(a b
LISP can be built from ten primitives: The primitives are: atom, quote, eq, car,
What are pros and cons of this technique (see Softfolio for an example). Two
I want to write a function in lisp that takes two lists of pairs
I've read a lot of good things about Land of Lisp so I thought
What is the difference between (cons 2 3) and '(2 . 3) in Lisp?
in Lisp-like systems, cons is the normal way to PREPEND an element to a
Are there ruby equivalents to the lisp car, cdr, and cons functions? For those

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.