• 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. sprint does not accept nil returned from expression

Stats

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

sprint does not accept nil returned from expression

liorscotland
liorscotland over 8 years ago

Hello all.
See this behaviour (6.1.6) in SKILL, straight from the CIW (toplevel is 'ils):
It would appear that if the first argument is nil returned from an expression, sprintf won't accept it.
However, "direct" nil works like a charm...
See CIW log below: if( 1== 0 t nil ) ireturns nil, but not accepted as 1st argument to sprint:

sprintf( if( 1==0 t nil ) "yo!\n" )
*Error* sprintf: argument #1 must be a symbol or nil - if((1 == 0) t nil)

if( 1==0 t nil )
nil
sprintf( nil "yo!\n" )
"yo!\n"

Thanks.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    Hi Lior,

    That's not surprising. sprintf() is a syntax form which doesn't evaluate its first argument - it takes it literally because it's the unquoted name of a variable; if it evaluated it, then you'd have to quote the variable name. If the symbol is nil, then it doesn't assign the value, just returns it. In fact we're making gets() follow a similar model (I suggested this) - recall you asked for a form for gets() which doesn't require a variable.

    Anyway, why would you want to have the first argument be an expression? That seems a bit odd...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • liorscotland
    liorscotland over 8 years ago

    Hi Andrew.
    I've it as a part of Macro.
    I need to process the arguments, and I just processed all of them. Instead, I now process the cdr of them
    I do not know what is a syntax form. I need to kook it up.

    -Lior

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

    Hi Lior,

    If it's a macro, I'm sure there's no need to do this. Can you share the macro? Maybe if not on the forums, you can send it to me directly?

    A syntax form is something that is built-in to the language - essentially it doesn't evaluate its arguments before it is called (like a normal "lambda" function), but the function can choose which arguments should be evaluated. So language features like procedure, setq, let etc are syntax forms.

    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