• 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. print list content and infix/prefix notation

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 2483
  • 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

print list content and infix/prefix notation

marcelpreda
marcelpreda over 4 years ago

Hi,

I have question related to how the list content is printed in CIW.

Let's assume that we have a structure like below, as you see the value associate with k1 is printed as value(a b c), but actually it was set as (value a b c).

And we would like to print it as (value a b c), because the other format is confusing especially for people new to skill.

I've noticed that this is happening when the first element is a skill function name.

I'm remember that there is setting in the CIW to print the list in the format that we want, but I don't remember the exact statement.

Any idea?

zz = '(nil k1 (value a b c) k2 (a b c value))
(nil k1 value(a b c) k2 (a b c value))
zz->k1
value(a b c)
zz->k2
(a b c value)


Thank you,
Marcel

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Hi Marcel,

    This is because you're relying on the default print representation, which is to "pretty print" the list, and that is done such that something that is a list that looks like code will be printed in "infix" format (i.e. as code). Because there is a value() function, the list (value a b) shows as value(a b). Similarly (plus a b) would show as a+b. You could use status(printinfix nil) but bear in mind that that may disturb other things that use the print representation and is possibly a dangerous thing to do (you could use unwindProtect to ensure it gets reset appropriately).

    Another approach could be to use a function like this:

    (defun abListToString (lst "l")
      (strcat "(" 
              (buildString 
                (foreach mapcar elem lst
                         (cond 
                           ((null elem) "nil")
                           ((listp elem) (abListToString elem))
                           (t (lsprintf "%L" elem))
                           )))
              ")")
      )
    
    

    I've just been discussing this with some colleagues, and we have tried to get this done in the past. I'll revisit it (I'll file an enhancement on your behalf) to have a %L-like format specifier which truly prints lists as non-infix lists.

    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