Introduction

CLtL2 Reference

SubL is a programming language intended to be very similar to a simplified version of Common Lisp where those features that are either complex, rarely-used, or difficult to implement in a prodecural language have been excised.

Unlike Common Lisp, SubL is not a purely functional language. Several SubL constructs can only be used procedurally. In order to emphasize this difference, the following naming convention for SubL constructs is used:

A SubL function will have the same name as the analogous Common Lisp function if it is intended to have the exact same basic functionality. The argument list may be simplified, but the intent and use are likely to be the same.

If there is a substantial behavioral difference between a SubL function and its Common Lisp counterpart, its name will be the Common Lisp name prepended with a single character -- either "c", "p" or "f".

"c" indicates a construct that is either only procedural or functional.
"p" indicates the procedural version of a Common Lisp construct.
"f" indicates the functional version of a Common Lisp construct.

A procedural construct in SubL is one which is suitable for evaluation as either one form in an explicit PROGN or as one form in an implicit progn, which occur in the &body sections of many of the procedural forms such as CLETPWHENCDOLIST etc.

Here is a table of all the procedural constructs in SubL and the Common Lisp analog:

 

SubL Procedural Construct   Common Lisp Equivalent

PROGN   progn
PIF   if
PWHEN   when
PUNLESS   unless
PCOND   cond
PCASE   case
CSETQ   setq
CSETF   setf
CINC   incf
CDEC   decf
CPUSH   push
CPUSHNEW   pushnew
CPOP   pop
CLET   let*
CMULTIPLE-VALUE-BIND   multiple-value-bind
CDO   do*
CDOLIST   dolist
CSOME    
CDOTIMES   dotimes
CDOHASH    
CCATCH   catch
CUNWIND-PROTECT   unwind-protect
RET   return-from

A functional construct in SubL is one which returns a value. Here is a table of all the functional constructs in SubL and the Common Lisp analog:

 

SubL Functional Construct   Common Lisp Equvalent

CAND   and
COR   or
CNOT   not
FIF   if
FWHEN   when
FUNLESS   unless

The body of a function or macro definition is considered an implicit progn, and so all forms in the body should be procedural. A function call can be used as a procedural construct. In this case, the returned value is simply ignored.