• 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. list substitution problems

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 143
  • Views 13984
  • 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

list substitution problems

sparksu
sparksu over 16 years ago

I have a long list here:

listA=list(P1 P2 P3 ... Px-1 Px Px+1 ... Pn)

for a given Px, I want to substitute Px with 2 new elements Px1 Px2  :

ListB=list(P1 P2 P3 ... Px-1 Px1 Px2 Px+1 ... Pn)

I know how to do it using "reverse()" function.

But based on SKILL Language User Guide, reverse() can generate a lot of memeory.

Is there a more efficient way to do this? I don't care if it is destructive or nondestructive.

Here is my code using reverse():

;---------------------------------------------------------------------------------------------------------------------------------

listB2=rplaca(member(Px listA) Px2)                                     ;listB2=>list(Px2 ... Pn)

listB1=reverse(rplaca(member(Px2 reverse(listA) Px1)             ;listB1=>list(P1 P2 P3 ... Px-1 Px1)

listB=append(listB1 listB2)                ;ListB=>list(P1 P2 P3 ... Px-1 Px1 Px2 Px+1 ... Pn)

;---------------------------------------------------------------------------------------------------------------------------------

  • Cancel
Parents
  • sparksu
    sparksu over 16 years ago

    Thanks, Andrew.

    Actually, listA is the points of a path object. It should remain their original order.

    Further more, if i want to break listA into 2 seperate sublists

    listA1=list(P1 P2 P3 ... Px-1)

    listA2=list(Px ... Pn)

    What should I do to get listA1 and listA2?

    Can I just break the pointer (or called link) between Px-1 and Px?

    Thanks again for your quick reply.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • sparksu
    sparksu over 16 years ago

    Thanks, Andrew.

    Actually, listA is the points of a path object. It should remain their original order.

    Further more, if i want to break listA into 2 seperate sublists

    listA1=list(P1 P2 P3 ... Px-1)

    listA2=list(Px ... Pn)

    What should I do to get listA1 and listA2?

    Can I just break the pointer (or called link) between Px-1 and Px?

    Thanks again for your quick reply.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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