The CWL Zone - SKILL Page

Code Examples

Schematic Tree List

SKILL code can be written to look like C code, e.g. function_call(param1 param2) or in LISP prefix style, e.g. (function_call param1 param2). Which code style is better? Answer: Which one will be easier for you to read six months from now?

I prefer the prefix mode, because I use LISP syntax for CLIPS expert system programming, and because my Xemacs editor has a Lisp major mode that works better with prefix style coding.

In this example, the code detects the schematic being viewed by the user, and then it builds a list of the underlying schematic hierarchy using recursinve programming techniques. Then the program displays the list to the user, as shown in the sample output.

Note: The procedural style was adapted from an online example developed by Cadence, and then I converted the code to prefix style.

Procedural Style This looks kind of like a C program...

Prefix Style Same functionality, but with LISP prefix style coding.

Sample Output