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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:02:18+00:00 2026-06-16T21:02:18+00:00

For demonstration purpose, I have list with has a list: > (setf x (list

  • 0

For demonstration purpose,

I have list with has a list:

 > (setf x (list '(1 2 1) '(4 5 4)))
 ((1 2 1) (4 5 4))
 > (length x)
 2

I want to add a new list ‘(2 3 2) to it. The append function:

 > (append '(2 3 2) x)
 (2 3 2 (1 2 1) (4 5 4))

 > (length (append '(2 3 2) x))
 5

isn’t really doing what I want.

What I want is to add ‘(2 3 2) like this:

((8 7 8) (1 2 1) (4 5 4))

so that the length is 3.

So far, I haven’t seen any example or ways to do what I want. Is there a built-in function or effective way of doing this ?

  • 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-16T21:02:19+00:00Added an answer on June 16, 2026 at 9:02 pm

    APPEND is not a destructive function, which is what you are asking for. What APPEND does is allocate a new list, which it then returns.

    What you can do to achieve your goals is:

    (setf x (append '((...)) x)) ;;appends the quoted list to x

    There is also the function NCONC, which adjusts pointers destructively.

    For your meditations, I present example work:

    CL-USER> (defparameter *x* nil)
    *X*
    CL-USER> (setf *x* '((1 2 3) (4 5 6)))
    ((1 2 3) (4 5 6))
    CL-USER> (append *x* '(10 11 12))
    ((1 2 3) (4 5 6) 10 11 12)
    CL-USER> (append *x* '((10 11 12)))
    ((1 2 3) (4 5 6) (10 11 12))
    CL-USER> (setf *x* (append *x* '((10 11 12))))
    ((1 2 3) (4 5 6) (10 11 12))
    CL-USER> *x*
    ((1 2 3) (4 5 6) (10 11 12))
    CL-USER> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following simplified demonstration: Class X contain Class Y . Class Y has
I started a demonstration project on HTML, JSON and jQuery recently. Thing I want
I have a custom script that outputs a list of particular products in csv
I am trying to re-create a TypeLoadException for demonstration purposes, so I have a
Assuming you have a hypothetical enum in java like this (purely for demonstration purposes,
I am trying to make a demonstration using cubism. I have created a custom
I have a column called submit_timestamp which holds a UNIX_TIMESTAMP( ), what I want
I have quite large List named items (>= 1,000,000 items) and some condition denoted
I have a WPF application that is made exclusively for demonstration purposes about how
I have an action returning a simple JSON. For demonstration purposes, I will paste

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.