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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:51:21+00:00 2026-05-31T09:51:21+00:00

I am learning LISP using PC Scheme TI implementation and from the book ‘Structure

  • 0

I am learning LISP using PC Scheme TI implementation and from the book ‘Structure and Interpretation of Computer Programs’. PC scheme doesn’t seem to have a ‘nil’ variable

[VM ERROR encountered!] Variable not defined in current environment
NIL

Instead ‘()’ seems to work.
[55] (define one-through-four (list 1 2 3 4 ()))
ONE-THROUGH-FOUR

Do both have the same meaning? What is the correct way to use a sequence of no elements in the PC scheme dialect?

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-31T09:51:22+00:00Added an answer on May 31, 2026 at 9:51 am

    When you say that this dialect “does not have a NIL variable”, you are right in two ways. Not only does not nil exist, but it seems to be treated as an ordinary symbol that you can use as a variable. It says “Variable not defined”.

    In Lisp dialects where nil has a special meaning, nil usually cannot be used as a variable.

    nil is equivalent to () only in “classical” Lisps (my term). By this I mean Lisps that are related by ancestry or imitation to the original John MacCarthy Lisp. Emacs Lisp and Common Lisp are that way. The classical Lisps use nil as the list terminator: i.e. (cons 1 nil) producing the list (1)

    Scheme is not a classical Lisp in this sense. There is no nil. It uses () as the printed notation for an empty list and when you want that value in an expression, it is quoted, just like a non-empty list literal: '(). In Scheme, (cons 1 nil) is written (cons 1 '()). Boolean false is represented by an object which is notated #f. An empty list is true not false, so (if '() 1 2) yields 1, not 2 like in a classical Lisp. Neither '() nor #f are symbols.

    Scheme is also case-sensitive. Even if you do have a variable NIL in Scheme, it has nothing to do with nil. You can use both as variable names.

    The SICP text causes confusion on this topic by, in its early chapters, making references to a variable called nil which holds the value of '(). There is no such variable in Scheme; you have to make it yourself if you want those examples to work. This is an unfortunate aspect of the textbook.

    If you define a variable nil whose value is the object '(), so that that Chapter 2 code from SICP works, it is still not equivalent to an empty list the way it is in a classical Lisp, because in a classical Lisp, nil and () are equivalent notations for a symbol. The symbol nil itself is the empty list, and vice versa. It is not the name of a variable which merely holds a list. And so the quote expression 'nil also evaluates to the empty list! Whereas in scheme 'nil evaluates to the ordinary symbol nil even if you’ve defined it as a variable holding the empty list.

    Regarding the second question, “() seems to work, do both have the same meaning?”. The “same meaning” aspect is covered above: no, not the same meaning in Scheme. As far as it working, consider the following quote from the R5RS Scheme Report:

    Note: In many dialects of Lisp, the empty combination, (), is a legitimate expression. In Scheme, combinations must have at least one subexpression, so () is not a syntactically valid expression. [4.1.3 Procedure Calls]

    Therefore this loose treatment of () as valid expression that produces the empty list appears to be a PC Scheme extension of behavior, not standard Scheme. It is accepting an expression which is not a syntactically valid Scheme expression.

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

Sidebar

Related Questions

Learning xml, Can anyone help me? I have following XML code: **<book lang=en>name of
I just started using LISP, coming from a background in C. So far its
I'm considering learning a Lisp dialect (probably Scheme, since I am constantly hearing how
I have read numerous time that learning a language such as Haskell, Lisp or
I've been learning Lisp to expand my horizons because I have heard that it
I'm learning Lisp and have written the following function to collect a list of
I am new to Lisp, and I am learning Scheme through the SICP videos.
When I started learning CL from Practical Common Lisp, as is preached in the
Learning django from learning website development using django. In chapter 3, building a bookmark
Learning Common Lisp (using GNU CLISP 2.43) .. so might be a noob mistake.

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.