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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:12:41+00:00 2026-06-13T02:12:41+00:00

Hi guys I am trying to concat a list and to return the first

  • 0

Hi guys I am trying to concat a list and to return the first value with extra brackets for example when I call the function (bracket-head '(a b c)) => ( (A) B C ).
I have done it to give the result when I call the function with '('(a) b c). So here is my code:

(defun bracket-head (list)
    (append (first list) (rest list))
  • 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-13T02:12:42+00:00Added an answer on June 13, 2026 at 2:12 am

    First of all, () are parentheses, not brackets.

    Next, “extra parentheses” means you wrap the object in a list:

    [5]> (list 1)
    (1)
    [6]> (list *)
    ((1))
    [7]> (list *)
    (((1)))
    [8]> (list *)
    ((((1))))
    [9]> (list *)
    (((((1)))))
    

    Thus, what you need to do is

    [13]> (defparameter list (list 1 2 3))
    LIST
    [14]> (setf (first list) (list (first list)))
    (1)
    [15]> list
    ((1) 2 3)
    

    Or, if you do not want to modify the list in-place:

    [17]> (defparameter list (list 1 2 3))
    LIST
    [18]> (cons (list (first list)) (rest list))
    ((1) 2 3)
    [19]> list
    (1 2 3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I'm trying to create a function and call it inside another each
guys im trying to make a list of students in php and getting each
Hey guys I have a problem with MySQL, i'm trying to insert data in
Hey guys I have a problem with MySQL, i'm trying to insert data in
hi guys im trying to take the value of data(0) and put it into
Hey guys im trying to search an array for an value and then remove
Guys i'm trying to get a list of posts and it's content not to
Hey guys i'm trying to use drawString() function to draw the result from a
Hey guys im trying to make a dynamic scrollable list of selectiondata which a
Hy guys I´m trying to include a function from a php-file to my phpunittest.

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.