• 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. Scheme vs Common Lisp style in SKILL++

Stats

  • Locked Locked
  • Replies 18
  • Subscribers 144
  • Views 22564
  • 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

Scheme vs Common Lisp style in SKILL++

tweeks
tweeks over 11 years ago

 While you can write your SKILL++ code like it is C, Maclisp, Scheme, or Common Lisp (or none of the above...), I've been experimenting with Common Lisp style lately.

Trying to write Common Lisp style code in SKILL++ can lead to curious situations like this:

(defvar first car)

The intention is to define FIRST as another name for CAR, as in Common Lisp.  In Scheme, we would write

(define first car)

which seems pretty natural, but using DEFVAR to define a function just feels.... wrong... somehow... :)

I guess I should use ALIAS:

 (alias second cadr)

 except ALIAS has weird limitations:

ILS-> (foo = first)
primop:car
ILS-> (foo '(1 2 3))
1
ILS-> (foo = second)
macro:evalalias
ILS-> (foo '(1 2 3))
*Error* evalalias: unknown alias - foo

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

     

    tweeks said:
    Do you use argument type templates?

    Sometimes. I'm a bit variable about this - sometimes I'll use them if I'm supplying an API which I am uncertain about the types that will be passed in.

    tweeks said:
    Do you use IL or ILS mode more often?

    If I'm writing single  functions which don't depend on lexical scoping or the object system, I probably tend to use IL mode. Mostly this is because I don't want people who pick up this code to be afraid of something that maybe they are less familiar with. However, for bigger code and bigger applications I'll nearly always use ILS mode. A quick analysis of the main SKILL files I've written over the last couple of years reveals something like 25-30% using ILS mode (I didn't check very carefully though).

    tweeks said:
    Do you do anything special for constants (e.g. capitalize them)? 

    No.

    tweeks said:
    Do you favor iteration constructs like for, foreach, while, and do, or do you prefer recursion? 

    I use both - so I wouldn't say I prefer one over the other. I certainly don't tend to use recursion when iteration is simple - I use recursion when it makes the algorithm more straightforward. Part of this is because of SKILL's limited stack size, and some is because there is a rich enough set of iteration functions in SKILL that mean that the recursive approach to a simple iteration doesn't add any value.

    tweeks said:
    Have you ever used go? :)

    What's go? (so that's no ;-> . I have a problem with goto in most languages having had structured programming drummed into me when I was at high school!)

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

     

    tweeks said:
    Do you use argument type templates?

    Sometimes. I'm a bit variable about this - sometimes I'll use them if I'm supplying an API which I am uncertain about the types that will be passed in.

    tweeks said:
    Do you use IL or ILS mode more often?

    If I'm writing single  functions which don't depend on lexical scoping or the object system, I probably tend to use IL mode. Mostly this is because I don't want people who pick up this code to be afraid of something that maybe they are less familiar with. However, for bigger code and bigger applications I'll nearly always use ILS mode. A quick analysis of the main SKILL files I've written over the last couple of years reveals something like 25-30% using ILS mode (I didn't check very carefully though).

    tweeks said:
    Do you do anything special for constants (e.g. capitalize them)? 

    No.

    tweeks said:
    Do you favor iteration constructs like for, foreach, while, and do, or do you prefer recursion? 

    I use both - so I wouldn't say I prefer one over the other. I certainly don't tend to use recursion when iteration is simple - I use recursion when it makes the algorithm more straightforward. Part of this is because of SKILL's limited stack size, and some is because there is a rich enough set of iteration functions in SKILL that mean that the recursive approach to a simple iteration doesn't add any value.

    tweeks said:
    Have you ever used go? :)

    What's go? (so that's no ;-> . I have a problem with goto in most languages having had structured programming drummed into me when I was at high school!)

    Andrew.

    • 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