• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. symbol property question

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 144
  • Views 14434
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

symbol property question

RVERP
RVERP over 12 years ago

I declare 3 variables

a = 10
b= 20
test=list('a 'b)

now I do test->x = 99

now test = (a x 99 b)

 So my list has become 4 items long, containing symbols a,b and x, and a value 99
x is still unbound.

 what has happened when i did test->x = 99??

 

  • Cancel
  • theopaone
    theopaone over 12 years ago

    You kind of created a disembodied property list (DPL). It is not a correctly formatted list which should start with a nil and contain symbol/value pairs.

    list( nil 'a "valueForA" 'b 3.2  'x 99 )

    As for x, it is a symbol used as a key in your list. It has no value. In a properly formatted DPL, you would evaluate test->x and have returned the value 99

    I'm not sure what you will get with your malformed DPL.

    Ted

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    There is absolutely no problem with having a disembodied property list with something other than nil as the first element - in fact I have used this to allow me to store something useful in that place - to allow me to have assoc lists of dpls.

    The DPL will work fine - you can use test->x to retrieve the value. The fact that there is a strange dummy value at the end wouldn't be a problem. Not sensible, but not a problem either.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theopaone
    theopaone over 12 years ago

     I remember using the first element in a DPL to hold a value but considered it a quirk that could be "fixed" in a later release. I never even thought of creating a DPL out of an existing list like that, it looks like a hard to find bug wating to byte at some later point.

    Ted

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RVERP
    RVERP over 12 years ago

     Ok, thanks I lookes at the chapter in the manual and understand now.

     But what I was wondering, is there an reason not to make a DPL in a DPL, like this:

    masterlist->prop1->prop1.1 = something
    masterlist->prop1->prop1.2 = something  else
    masterlist->prop2->prop2.1 = something new

    or is this better:

    prop1list->prop1.1 = something
    prop1list->prop1.2 = something  else
    prop2list->prop2.1 = something new

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    No problem with having nested disembodied property lists. Note that you need to initialize the sub-property list - using ncons(nil) for example:

    masterlist=ncons(nil)
    masterlist->prop1=ncons(nil)
    masterlist->prop1->subprop1="hello"
    masterlist->prop1->subprop2="test"
    masterlist->prop2=ncons(nil)
    masterlist->prop2->subprop21=23

    Then if you look at the masterlist variable it contains:

    (nil prop2 (nil subprop21 23) prop1 (nil subprop2 "test" subprop1 "hello"))

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information