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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:18:34+00:00 2026-05-28T08:18:34+00:00

I found a Similar question . But I don’t quite understand that explanation. So

  • 0

I found a Similar question.

But I don’t quite understand that explanation.

So I’m trying to run clisp with the following example:

  [1]> (defvar a 5)
  A
  [2]> (+ a 1)
  6
  [3]> (defparameter b 5)
  B
  [4]> (+ b 1)
  6
  [5]> (setf c 5)
  5
  [6]> (+ c 1)
  6
  [7]> (setq d 5)
  5
  [8]> (+ d 1)
  6
  [9]> (let ((a 500)) (+ a 1))
  501
  [10]> (let ((b 500)) (+ b 1))
  501
  [11]> (let ((c 500)) (+ c 1))
  501
  [12]> (let ((d 500)) (+ d 1))
  501
  [13]> 

What I found is totally the same.

I can’t figure out what’s different with them?

  • 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-28T08:18:35+00:00Added an answer on May 28, 2026 at 8:18 am

    DEFPARAMETER always assigns a value. So:

    [1]> (defparameter a 1)
    A
    [2]> (defparameter a 2)
    A
    [3]> a
    2
    

    while DEFVAR does it only once, so:

    [4]> (defvar b 1)
    B
    [5]> (defvar b 2)
    B
    [6]> b
    1
    

    SETF is a macro which uses SETQ internally, but has more possibilities. In a way it’s a more general assignment operator. E.g. with SETF you can do:

    [19]> (defparameter c (list 1 2 3))
    [21]> (setf (car c) 42)                                              
    42
    [22]> c
    (42 2 3)
    

    but you can’t do that with SETQ:

    [23]> (setq (car c) 42)                                              
    *** - SETQ: (CAR C) is not a symbol
    The following restarts are available:
    USE-VALUE      :R1      Input a value to be used instead.
    ABORT          :R2      Abort main loop
    Break 1 [24]> abort
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found this question very similar to my situation, but I don't know basic
I can't resolve this issue, I found a similar question here but: setting the
I found this similar question here , but this is really old. Was it
I've found a similar question here , but I'm looking for more general solutions.
I found this question but it was only similar and, more importantly, dated by
I know a similar question has been asked but I have not found a
Sorry if this is a duplicate question...I've searched around and found similar advice but
I've looked around on stackoverflow for a similar question, but haven't found exactly what
Morning, simple stupid question. I have found post with similar issues but after reading
I actually posted this question because I found similar questions but not a perfect

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.