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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:42:31+00:00 2026-05-27T15:42:31+00:00

I am using a nested plist in order to create a structure of objects

  • 0

I am using a nested plist in order to create a structure of objects (CLOS type), passing on the nested ones to its parts. I want to append the nested plist in an iterative way, but therefore I want to do it efficiently in terms of time and memory.

The below example shows the delta due to one iteration:

'(:airframer "Boeing" :type "777" :wing-plist ((:side :left :winglet? nil)
                                                (:side :right :winglet? nil)))

into

'(:airframer "Boeing" :type "777" :wing-plist ((:type :main-wing :side :left)
                                                (:type :main-wing :side :right)
                                                (:type :stabilizer :size :left)))

I already read that the use of vectors instead of lists might help, as you access elements without too much penalty: Replace an item in a list in Common Lisp?. However, I would really like to bypass the use of vectors.

Furthermore, I think the use a destructive function would save memory and hopefully calculation time.

This is how I solved it now at the moment, but I have the feeling that it is not elegant and efficient. The function fill is used for destructiveness.

(defun append-nested-plist (plist key sub-plist)
  (let* ((key-pos (position key plist)))
    (fill plist (append (getf plist key) (list sub-plist))
          :start (+ key-pos 1) :end (+ key-pos 2))))

I am looking forward to your answers.

  • 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-27T15:42:32+00:00Added an answer on May 27, 2026 at 3:42 pm

    How about this?

    (defun append-nested-plist (plist key sub-plist)
      (push-to-end sub-plist (getf plist key))
      plist)
    

    Push-to-end is a commonly-defined macro that’s not part of the common lisp standard:

    (defmacro push-to-end (item place)
      `(setf ,place (nconc ,place (list ,item))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a 2d array using nested containers. I want to
It's easy to create a multi-level menu structure using nested RootElements in MonoTouch.Dialog but
I am using nested arrays to create a 2D matrix. Its pretty easy too
I want to implement an apperance as this article mentioned using nested ListView control.
I'm using awesome_nested_set for my central website structure. I want to be able to
I'm using nested routes and I want to provide some sort of a shortcut
I am trying to create my app using the Nested Set Gem here I
I'm trying to create a mega menu using nested <ul> within a <li> .
I have a problem with animations using jQuery on nested tables. I want to
In SharePoint it has a nasty habit of using nested tables everywhere. I want

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.