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

  • Home
  • SEARCH
  • 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 875037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:12:02+00:00 2026-05-15T11:12:02+00:00

The platform i’m working with is DrScheme. I’ve seen that a pair (a b)

  • 0

The platform i’m working with is DrScheme.

I’ve seen that a pair (a b) [constructed by (cons a b)] is implemented within the language like a procedure that looks like this:

(define (cons a b)
  (lambda(pick)
    (cond ((= pick 1) a)
          ((= pick 2) b))))

and the selectors:

(define (car x) (x 1))
(define (cdr x) (x 2))

Then there are lists, constructed with expression like (cons a (cons b (cons c (cons ...)))).

Now, what i was trying to understand is this (typed on DrScheme’s prompt):

> (define l1 '(a b c))
> (define l2 (list 'a 'b 'c))
> l1
(a b c)
> l2
(a b c)
> (eq? l1 l2)
#f

Ok, l2 is just a list (that is, a procedure, ect…) like i’ve described abode, but… what is l1? A symbol? A sequence of character? And whatever it is, how is it implemented within the language?
Thanks!

  • 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-15T11:12:03+00:00Added an answer on May 15, 2026 at 11:12 am

    l1 is also just a list containing the same elements. Note that this also returns #f:

    (define l1 '(a b c))
    (define l2 '(a b c))
    (eq? l1 l2)
    

    While this returns #t:

    (define l1 '(a b c))
    (define l2 (list 'a 'b 'c))
    (equal? l1 l2)
    

    The reason is that eq? checks whether l1 and l2 are references to the same object in memory, while equal? checks whether they have the same contents.

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

Sidebar

Related Questions

I have a cross platform program that runs on Windows, Linux and Macintosh. My
In my cross-platform architecture, I would like to act on a context menu click
I have some cross platform DNS client code that I use for doing end
Platform: Windows XP Development Platform: VB6 When trying to set an application title via
Platform Builder is a tool for building a Windows CE Operating system on your
Is there a (cross-platform) way to get a C FILE* handle from a C++
I need a cross platform method of determining the MAC address of a computer
The last cross platform desktop development I did was Java/Swing. What about flex?
I need a cross platform solution for clearing the console in both Linux and
On our new platform we are utilizing JSF. Our WebTrends tags are not reflecting

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.