The Revised Maclisp ManualThe PitmanualPage C-2
Published by HyperMeta Inc.
 
Prev | Index | Next
Common Lisp Conversion
CL Conversion
Trivial Changes
Easy Changes
Hard Changes
Substandard Code
Cosmetic Changes
User-Defined Functions
Non-Portable Code
Donate

Conv: Trivial Changes

[Blue Marble]
Climate Change
Got permafrost?

Changes described in this section are generally easy to take care of via simple textual substitution using either Tags Query Replace in cases where only a single replacement is suggested, or else via Tags Multiple Query Replace in cases where multiple substitutions are suggested.

The Maclisp/Zetalisp function DEFCONST is called DEFPARAMETER in Common Lisp. This name change was made to avoid confusion between Zetalisp DEFCONST and Common Lisp DEFCONSTANT, which are quite different.

    DEFCONST  becomes  DEFPARAMETER

For naming consistency with other operators, Zetalisp's MULTIPLE-VALUE became MULTIPLE-VALUE-SETQ in Common Lisp.

    MULTIPLE-VALUE  becomes  MULTIPLE-VALUE-SETQ

Common Lisp needed the name MAP for a new functionality, so the traditional Maclisp/Zetalisp MAP operation became MAPL in Common Lisp. When using Zmacs Tags Query Replace, a numeric argument is recommended to avoid stopping at MAPCAR, MAPLIST, etc.

    MAP  becomes  MAPL

Common Lisp renames the Zetalisp function FIX to be FLOOR (for naming symmetry with CEILING). In extremely rare cases, rewriting (FIX x) as (VALUES (FLOOR x)) will be necessary, but in almost all cases the more straightforward change of (FIX x) to (FLOOR x) will suffice. As with MAP, however, the name FIX is short (and is a substring of things like FIXNUM), so a numeric argument is recommended to Tags Query Replace to avoid unwanted matches.

    FIX  becomes  FLOOR

Note, however, that the Common Lisp FLOOR primitive returns multiple values. In very rare cases, you may want to change (FIX x) to (VALUES (FLOOR x)) rather than just (FLOOR x). We expect, however, that the simple change of (FIX x) to (FLOOR x) will work fine most of the time.

Common Lisp's APPLY was extended to include the functionality of Maclisp/Zetalisp LEXPR-FUNCALL.

    LEXPR-FUNCALL  becomes  APPLY

The Zetalisp name ARRAY-#-DIMS was deemed too syntactically messy for Common Lisp, so it was renamed to ARRAY-RANK to avoid having “#” in its name.

    ARRAY-#-DIMS   becomes  ARRAY-RANK
    ARRAY-/#-DIMS  becomes  ARRAY-RANK

Multi-word operators in Common Lisp generally have dashes separating the words, so Common Lisp adopted the name COPY-LIST for Zetalisp's COPYLIST operation. Common Lisp does not provide an equivalent of COPYLIST*, but Symbolics Common Lisp (the SCL package) provides COPY-LIST* for naming consistency with COPY-LIST.

    COPYLIST   becomes  COPY-LIST
    COPYLIST*  becomes  COPY-LIST*

Common Lisp's file manipulating operations are spelled out for greater clarity.

    DELETEF  becomes  DELETE-FILE
    RENAMEF  becomes  RENAME-FILE
    PROBEF   becomes  PROBE-FILE

Many I/O-related system variables have new names in Common Lisp.

    STANDARD-INPUT  becomes  *STANDARD-INPUT*
    STANDARD-OUTPUT becomes  *STANDARD-OUTPUT*
    TERMINAL-IO     becomes  *TERMINAL-IO*
    QUERY-IO        becomes  *QUERY-IO*
    DEBUG-IO        becomes  *DEBUG-IO*
    ERROR-OUTPUT    becomes  *ERROR-OUTPUT*
    READTABLE       becomes  *READTABLE*
    BASE            becomes  *PRINT-BASE*
    PRINLEVEL       becomes  *PRINT-LEVEL*
    PRINLENGTH      becomes  *PRINT-LENGTH*
    IBASE           becomes  *READ-BASE*

Note: In Common Lisp, the binding of READTABLE controls both input and output. For example, whether a CL or a ZL readtable is in effect will affect whether “/” or “\” is used for syntactic quoting by the printer on output. It will also affect whether *NOPOINT or *PRINT-RADIX* (a harder conversion to be discussed later) is looked at by the printer.


CL Conversion (1 (2) 3 4 5 6 7 8)


The Revised Maclisp Manual (Sunday Morning Edition)
Published Sunday, December 16, 2007 06:17am EST, and updated Sunday, July 6, 2008.
Prev | Index | Next