• 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. defvar in SKILL++

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 13477
  • 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

defvar in SKILL++

tweeks
tweeks over 11 years ago

From the SKILL Language Reference:

defvar( 
s_varName 
[ g_value ] 
) 
=> g_value | nil
 
(SKILL mode only) Defines a global variable and assigns it a
value. Use the define syntax form to define global variables
in SKILL++ mode.

The "SKILL mode only" qualifier makes it sound like you get undefined behavior in SKILL++.  What you actually get in SKILL33.00 is the usual lexical binding, as with define:

ILS-> (defun foo (x) (defvar y 3) (times x y))
foo
ILS-> (foo 2)
6
ILS-> y
*Error* eval: unbound variable - y

The sentence, "use the define syntax form to define global variables in SKILL++ mode," seems to be more of a coding style recommendation than a technical limitation, since define and defvar are essentially identical in SKILL++.  (Also, neither define nor defvar bind in the toplevel environment unless they are evaluated in the toplevel environment.  The description almost makes it sound like you can use define like defglobalfun--a sort of "defglobalvar".)

So when it says "SKILL mode only", is it really saying that the dynamic-scope semantics you would expect from CL are only available in SKILL mode?

Or is it saying, "don't depend on the current behavior of defvar in SKILL++ mode, because we might change it someday"?

Also, why isn't the third argument (the docstring) documented?  What happens if you provide a docstring?  It would be cool if you could use defvar to provide finder-style documentation!

  • Cancel
Parents
  • tweeks
    tweeks over 11 years ago

    Thanks Andrew.

     Case 45624417 filed.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • tweeks
    tweeks over 11 years ago

    Thanks Andrew.

     Case 45624417 filed.

    • 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