• 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
  • tweeks
    tweeks over 10 years ago

    Thanks for clarifying the status of alias, and big thanks for the detailed history of Scheme mode and CLOS!  I had no idea CLOS was originally for ADE, but it makes sense (I noticed their class tree seems to be the largest).  Knowing the reasons why features were originally added to the language is very helpful in deciding when/how to use them, so this kind of background is invaluable.

    Thank you also for the good example of using flet over nested defuns.  I must show that WithAutoHash macro to my colleague who keeps talking up Perl over SKILL.  It should shut him up for a while. :)

    Andrew Beckett said:

    However, I never find myself using labels. Two reasons - I find the name of the function counterintuitive - nothing in the name suggests to me that this defines functions using letrec semantic; secondly I can do all that just by declaring nested defuns.

    The name probably derives from McCarthy's original Recursive Functions paper, where he introduced a primitive called label which made it possible to define recursive lambdas without resorting to deep lambda calculus trickery (i.e. the "Y-combinator").

    I think fletseq would have been a better name....

    Andrew Beckett said:

    I never use define to define functions - only to define variables. And I never use defvar at all.

    Do you use argument type templates?

    Do you use IL or ILS mode more often?

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

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

    Have you ever used go? :)

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

    Thanks for clarifying the status of alias, and big thanks for the detailed history of Scheme mode and CLOS!  I had no idea CLOS was originally for ADE, but it makes sense (I noticed their class tree seems to be the largest).  Knowing the reasons why features were originally added to the language is very helpful in deciding when/how to use them, so this kind of background is invaluable.

    Thank you also for the good example of using flet over nested defuns.  I must show that WithAutoHash macro to my colleague who keeps talking up Perl over SKILL.  It should shut him up for a while. :)

    Andrew Beckett said:

    However, I never find myself using labels. Two reasons - I find the name of the function counterintuitive - nothing in the name suggests to me that this defines functions using letrec semantic; secondly I can do all that just by declaring nested defuns.

    The name probably derives from McCarthy's original Recursive Functions paper, where he introduced a primitive called label which made it possible to define recursive lambdas without resorting to deep lambda calculus trickery (i.e. the "Y-combinator").

    I think fletseq would have been a better name....

    Andrew Beckett said:

    I never use define to define functions - only to define variables. And I never use defvar at all.

    Do you use argument type templates?

    Do you use IL or ILS mode more often?

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

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

    Have you ever used go? :)

    • 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