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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:59:56+00:00 2026-05-10T23:59:56+00:00

Im learning lisp and im pretty new at this so i was wondering… if

  • 0

Im learning lisp and im pretty new at this so i was wondering…

if i do this:

(defparameter *list-1* (list 1 2)) (defparameter *list-2* (list 2 3)) (defparameter *list-3* (append *list-1* *list-2*)) 

And then

(setf (first *list-2*) 1) *list-3* 

I will get (1 2 1 4)

I know this is because the append is going to ‘save resources’ and create a new list for the first chunk, but will actually just point to the second chunk, coz if i do:

(setf (first *list-1*) 0) *list-3* 

I will get (1 2 1 4) instade of the more logical (0 2 1 4)

So my question is, what other cases are like this in lisp, how do you black belt lispers know how to deal with this stuff that is not intuitive or consistent?

  • 1 1 Answer
  • 2 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. 2026-05-10T23:59:56+00:00Added an answer on May 10, 2026 at 11:59 pm

    One defensive tactic is to avoid sharing structure.

    (defparameter *list-3* (append *list-1* *list-2* '())) 

    or

    (defparameter *list-3* (append *list-1* (copy-list *list-2*))) 

    Now the structure of the new *list-3* is all new, and modifications to *list-3* won’t affect *list-2* and vice versa.

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

Sidebar

Related Questions

I'm pretty new to Emacs Lisp and still learning how to do some of
Note Learning Lisp I am getting this error: Illegal argument in functor position: (EVALEXP
I'm learning Lisp and have written the following function to collect a list of
I'm still learning lisp, so, when I came across this problem, it confused me.
I am new to Lisp, and I am learning Scheme through the SICP videos.
I'm learning emacs lisp and I'm trying to script using it. I wrote a
I just started learning Common Lisp a few days ago, and I'm trying to
Learning some VBA. So far, I've constructed this piece of code which should allow
Learning Spring (3.1.0) and Hibernate (4.1.1). Just wondering what most developers do when handling
I'm busy learning Common Lisp, & I'm looking for a static code analysis tool

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.