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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:51:54+00:00 2026-06-12T00:51:54+00:00

I’ve seen this used once, but couldn’t understand what it does. The reference says

  • 0

I’ve seen this used once, but couldn’t understand what it does. The reference says that it is

#n=object reads as whatever object has object as its printed representation.
However, that object is labeled by n, a required
unsigned decimal integer, for possible reference by the syntax #n#.
The scope of the label is the expression being read by the outermost
call to read; within this expression, the same label may not appear
twice.

Which to me reads as just 56 randomly selected words of English language… Can you, please, show an example of when this may be used?

  • 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-12T00:51:55+00:00Added an answer on June 12, 2026 at 12:51 am

    In Common Lisp it is used by the reader and the printer.

    This way you can label an object in some s-expression and refer to it in a different place in the s-expression.

    The label is #someinteger= followed by an s-expression. The integer must be unique. You can’t use the label twice within a single s-expression.

    The reference to a label is #someinteger#. The integer identifies the s-expression to reference. The label must be introduced, before it can be referenced. The reference can be used multiple times within an s-expression.

    This is for example used in reading and printing circular lists or data structures with shared data objects.

    Here a simple example:

    ? '(#1=(1 . 2) (#1#))
    

    reads as

    ((1 . 2) ((1 . 2)))
    

    Note also this:

    ? (eq (first *) (first (second *)))
    T
    

    It is one identical cons cell.

    Let’s try a circular list.

    Make sure that the printer deals with circular lists and does not print them forever…

    ? (setf *print-circle* t)
    T
    

    Now we are constructing a list:

    ? (setf l1 (list 1 2 3))
    (1 2 3)
    

    We are setting the last cdr to the first cons:

    ? (setf (cdr (last l1)) l1)
    #1=(1 2 3 . #1#)
    

    As you can see above, the printed list gets a label and the last cdr is a reference to that label.

    We can also enter a circular list directly by using the same notation. The reader understands it:

    ? '#1=(1 2 3 . #1#)
    #1=(1 2 3 . #1#)
    

    Since we have told the printer to deal with such constructs, we can try the expression from the first example:

    ? '(#1=(1 . 2) (#1#))
    (#1=(1 . 2) (#1#))
    

    Now the printer detects that there are two references to the same cons object.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.