1
0
mirror of synced 2026-01-17 00:52:40 +00:00
Interlisp.medley/docs/ReleaseNote/SEC3-IRMFEATURES-I.TEDIT

33 lines
25 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1
LISP RELEASE NOTES, MEDLEY RELEASE, COMMON LISP/INTERLISP-D INTEGRATION
1
LISP RELEASE NOTES, MEDLEY RELEASE, COMMON LISP/INTERLISP-D INTEGRATION
3. COMMON LISP/INTERLISP-D INTEGRATION
1
3. COMMON LISP/INTERLISP-D INTEGRATION
1
3. COMMON LISP/INTERLISP-D INTEGRATION
6
NOTE: Chapter 3 is organized to correspond to the original Interlisp-D Reference Manual, and explains changes related to how Common Lisp affects Interlisp-D in your Lisp software development environment. To make it easy to use this chapter with the IRM, information is organized by IRM volume and section numbers. Section headings from the IRM are maintained to aid in cross-referencing.
Lyric information as well as Medley release enhancements are included. Medley additions are indicated with revision bars in the right margin.
VOLUME Iÿÿï%ÿLANGUAGE
2
Chapter 2 Litatoms
1
(2.1)
What Interlisp calls a "LITATOM" is the same as what (COMMON% LISP% SYMBOLS% NIL Common% Lisp% Symbols% NIL (3) 1)Common Lisp calls a "SYMBOL." (SYMBOLS NIL Symbols NIL (3) 1)Symbols are partitioned into separate name spaces called packages. When you type a string of characters, the resulting symbol is searched for in the "current package." A colon in the symbol separates a package name from a symbol name; for example, the string of characters "CL:AREF" denotes the symbol AREF accessible in the package CL. For a full discussion, see Guy Steele's Common Lisp, the Language.
All the functions in this section that create symbols do so in the INTERLISP package (IL), which is also where all the symbols in the Interlisp-D Reference Manual are found. Note that this is true even in cases where you might not expect it. For example, U-CASE returns a symbol in the INTERLISP package, even when its argument is in some other package; similarly with L-CASE and SUBATOM. In most cases, this is the right thing for an Interlisp program; e.g., U-CASE in some sense returns a "canonical" symbol that one might pass to a SELECTQ, regardless of which executive it was typed in. However, to perform symbol manipulations that preserve package information, you should use the appropriate Common Lisp functions (See Common Lisp the Language, Chapter 11, Packages and Chapter 18, Strings).
Symbols read under an old Interlisp readtable are also searched for in the INTERLISP package. See Section 25.8, Readtables, for more details.
Section 2.1 Using Litatoms as Variables
1
(I:2.3)
((BOUNDP (Function) BOUNDP% NIL (3) 2)BOUNDP VAR) [Function]
1
The Interlisp interpreter has been modified to consider any symbol bound to the distinguished symbol NOBIND(NOBIND NIL NIL NIL (3) NIL) to be unbound. It will signal an UNBOUND-VARIABLE condition on encountering references to such symbols. In prior releases, the interpreter only considered a symbol unbound if it had no dynamic binding and in addition its top-level value was NOBIND.
For most user code, this change has no effect, as it is unusual to bind a variable to the particular value NOBIND and still deliberately want the variable to be considered bound. However, it is a particular problem when an interpreted Interlisp function is passed to the function MAPATOMS. Since NOBIND is a symbol, it will eventually be passed as an argument to the interpreted function. The first reference to that argument within the function will signal an error.
A work-around for this problem is to use a Common Lisp function instead. Calls to this function will invoke the Common Lisp interpreter which will treat the argument as a local, not special, variable. Thus, no error will be signaled. Alternatively, one could include the argument to the Interlisp function in a LOCALVARS(LOCALVARS NIL NIL NIL (3) NIL) declaration and then compile the function before passing it to MAPATOMS(MAPATOMS (Function) NIL NIL (3) NIL). This has the advantage of significantly speeding up the MAPATOMS call.
Section 2.3 Property Lists
1
(I:2.6)
The value returned from the function REMPROP(REMPROP (Function) NIL NIL (3) NIL) has been changed in one case:
((REMPROP (Function) REMPROP% NIL (3) 2)REMPROP ATM PROP) [Function]
1
Removes all occurrences of the property PROP (and its value) from the property list of ATM. Returns PROP if any were found (T if PROP is NIL), otherwise NIL.
Section 2.4 Print Names
1
(I:2.7)
The print functions now qualify the name of a symbol with a package prefix if the symbol is not accessible in the current package. The Interlisp "PRIN1" print name of a symbol does not include the package name.
(I:2.10)
The GENSYM(GENSYM (Function) NIL NIL (3) NIL) function in Interlisp creates symbols interned in the INTERLISP package. The Common Lisp CL:GENSYM(CL:GENSYM (Function) NIL NIL (3) NIL) function creates uninterned symbols.
(I:2.11)
((MAPATOMS (Function) MAPATOMS% NIL (3) 3)MAPATOMS FN) [Function]
1
See the note for BOUNDP above.
Section 2.5 Characters
1
A "character" in Interlisp is different from the type "character" in Common Lisp. In Common Lisp, "(CHARACTERS NIL characters NIL (3) NIL)character" is a distinguished data type satisfying the predicate CL:CHARACTERP. In Interlisp, a "character" is a single-character symbol, not distinguishable from the type symbol (litatom). Interlisp also uses a more efficient object termed "character code", which is indistinguishable from the type integer.
Interlisp functions that take as an argument a "character" or "character code" do not in general accept Common Lisp characters. Similarly, an Interlisp "character" or "character code" is not acceptable to a Common Lisp function that operates on characters. However, since Common Lisp characters are a distinguished datatype, Interlisp string-manipulation functions are willing to accept them any place that a "string or symbol" is acceptable; the character object is treated as a single-character string.
To convert an Interlisp (CONVERTING% CHARACTERS NIL converting% characters NIL (3) 3)character code n to a Common Lisp character, evaluate (CL:CODE-CHAR(CL:CODE-CHAR (Function) NIL NIL NIL NIL) n). To convert a Common Lisp character to an Interlisp character code, evaluate (CL:CHAR-CODE n). For character literals, where in Interlisp one would write (CHARCODE(CHARCODE (Function) NIL NIL (3) NIL) x), to get the equivalent Common Lisp character one writes #\x. In this syntax, x can be any character or string acceptable to CHARCODE; e.g., #\GREEK-A.
2
Chapter 4 Strings
1
(I:4.1)
Interlisp strings are a subtype of Common Lisp strings(COMMON% LISP% STRINGS NIL Common% Lisp% strings NIL (3) 3). The functions in this chapter accept Common Lisp strings(STRINGS NIL strings NIL (3) 3), and produce strings that can be passed to Common Lisp string manipulation functions.
2
Chapter 5 Arrays
1
Interlisp arrays and Common Lisp arrays are disjoint data types. Interlisp arrays(ARRAYS NIL arrays NIL (3) 3) are not acceptable arguments to Common Lisp array functions, and vice versa. There are no functions that convert between the two kinds of arrays.
2
Chapter 6 Hash Arrays
1
Interlisp hash arrays(HASH% ARRAYS NIL hash% arrays NIL (3) 4) and Common Lisp hash tables are the same data type, so Interlisp and Common Lisp hash array functions may be freely intermixed. However, some of the arguments are different; e.g., the order of arguments to the map functions in (IL:MAPHASH (Function) NIL NIL (3) NIL)IL:MAPHASH and CL:MAPHASH(CL:MAPHASH (Function) NIL NIL (3) NIL) differ. The extra functionality of specifying your own hashing function is available only from Interlisp HASHARRAY(HASHARRAY NIL NIL NIL (3) NIL), not CL:MAKE-HASH-TABLE(CL:MAKE-HASH-TABLE (Function) NIL NIL (3) NIL) , though the latter does supply the three built-in types specified by Common Lisp, the Language.
2
Chapter 7 Numbers and Arithmetic Functions
1
(I:7.2)
The addition of Common Lisp data structures within the Lisp environment means that there are some invariants which used to be true for anything in the environment that are no longer true.
For example, in Interlisp, there were two kinds of numbers: (INTEGERS NIL integers NIL (3) NIL)integer and (FLOATING% POINT NIL floating% point% NIL (3) 4)floating. With Common Lisp, there are additional kinds of numbers, namely ratios(RATIOS NIL ratios NIL (3) NIL) and complex numbers(COMPLEX% NUMBERS NIL complex% numbers NIL (3) NIL), both of which satisfy the Interlisp predicate NUMBERP(NUMBERP (Predicate) NIL NIL (3) NIL). Thus, NUMBERP is no longer the simple union of FIXP(FIXP (Predicate) NIL NIL (3) NIL) and FLOATP(FLOATP (Predicate) NIL NIL (3) NIL). It used to be that a program containing
(if (NUMBERP X)
then (if (FIXP X)
then ...assume X is an integer ...
else ...can assume X is floating point...))
would be correct in Interlisp. However, this is no longer true; this program will not deal correctly with ratios or complex numbers, which are NUMBERP but neither FIXP nor FLOATP.
Section 7.2 Integer Arithmetic
1
When typing to a new Interlisp Executive, the input syntax for integers of radix other than 8 or 10 has been changed to match that of Common Lisp. Use # instead of |, e.g., #b10101 is the new syntax for binary numbers, #x1A90 for hexadecimal, etc. Suffix Q is still recognized as specifying octal radix, but you can also use Common Lisp's #o syntax.
(I:7.4)
In the Lyric release, the FASL machinery would handle some positive literals incorrectly, reading them back as negative numbers. The numbers handled incorrectly were those numbers x greater than 2**31-1 for which (mod (integer-length x) 8) was zero. The Medley release fixes this situation. Any files containing such numbers should be recompiled.
2
Chapter 10 Function Definition, Manipulation, and Evaluation
1
Section 10.1 Function Types
1
All Interlisp (NLAMBDA NIL NIL NIL (3) NIL)NLAMBDAs appear to be macros from Common Lisp's point of view. This is discussed at greater length in Common Lisp Impementation Notes, Chapter 8, Macros.
Section 10.6 Macros
1
((EXPANDMACRO (Function) EXPANDMACRO% NIL (3) 5)EXPANDMACRO EXP QUIETFLG ÿÿï% ï%ÿ ) [Function]
1
EXPANDMACRO only works on Interlisp macros, those appearing on the MACRO, BYTEMACRO or DMACRO properties of symbols. Use CL:MACROEXPAND-1 to expand Common Lisp macros and those Interlisp macros that are visible to the Common Lisp compiler and interpreter.
Section 10.6.1 DEFMACRO
1
(I:10.24)
Common Lisp does not permit a symbol to simultaneously name a function and a macro. In Lyric, this restriction also applies to Interlisp macros defined by (DEFMACRO (Macro) DEFMACRO% NIL (3) NIL)DEFMACRO. That is, evaluating DEFMACRO for a symbol automatically removes any function definition for the symbol. Thus, if your purpose for using a macro is to make a function compile in a special way, you should instead use the new form XCL:DEFOPTIMIZER(XCL:DEFOPTIMIZER (Macro) XCL:DEFOPTIMIZER% NIL (3) NIL), which affects only compilation. The Xerox Common Lisp Implementation Notes describe XCL:DEFOPTIMIZER.
Interlisp DMACRO properties have typically been used for implementation-specific optimizations. They are not subject to the above restriction on function definition. However, if a symbol has both a function definition and a (DMACRO (Property) DMACRO% NIL (3) 5)DMACRO property, the Lisp compiler assumes that the DMACRO was intended as an optimizer for the old Interlisp compiler and ignores it.
2
Chapter 11 Stack Functions
1
Section 11.1 The Spaghetti Stack
1
Stack pointers(STACK% POINTERS NIL Stack% pointers NIL (3) NIL) now print in the form
#<Stackp address/framename>.
Some restrictions were placed on spaghetti stack manipulations(STACK% MANIPULATIONS NIL stack% manipulations NIL (3) 5) in order to integrate reasonably with Common Lisp's CL:CATCH(CL:CATCH (Function) NIL NIL (3) NIL) and CL:THROW(CL:THROW (Function) NIL NIL (3) NIL). In Lyric, it is an error to return to the same frame twice, or to return to a frame that has been unwound through. This means, for example, that if you save a stack pointer to one of your ancestor frames, then perform a CL:THROW or RETFROM that returns "around" that frame, i.e., to an ancestor of that frame, then the stack pointer is no longer valid, and any attempt to use it signals an error "Stack Pointer has been released". It is also an error to attempt to return to a frame in a different process, using RETFROM, RETTO, etc.
The existence of spaghetti stacks raises the issue of under what circumstances the cleanup forms of CL:UNWIND-PROTECT(CL:UNWIND-PROTECT NIL NIL NIL (3) NIL) are performed. In Lisp, CL:THROW always runs the cleanup forms of any CL:UNWIND-PROTECT it passes. Thanks to the integration of CL:UNWIND-PROTECT with RESETLST(RESETLST NIL NIL NIL (3) NIL) and the other Interlisp context-saving functions, CL:THROW also runs the cleanup forms(CLEANUP% FORMS NIL cleanup% forms NIL (3) NIL) of any RESETLST it passes. The Interlisp control transfer constructs (RETFROM NIL NIL NIL (3) NIL)RETFROM, RETTO(RETTO NIL NIL NIL (3) NIL), RETEVAL(RETEVAL NIL NIL NIL (3) NIL) and RETAPPLY(RETAPPLY NIL NIL NIL (3) NIL) also run the cleanup forms in the analogous case, viz., when returning to a direct ancestor of the current frame. This is a significant improvement over prior releases, where RETFROM never ran any cleanup forms at all.
In the case of RETFROM, etc, returning to a non-ancestor, the cleanup forms are run for any frames that are being abandoned as a result of transferring control to the other stack control chain. However, this should not be relied on, as the frames would not be abandoned at that time if someone else happened to retain a pointer to the caller's control chain, but subsequently never returned to the frame held by the pointer. Cleanup forms are not run for frames abandoned when a stack pointer is released, either explicitly or by being garbage-collected. Cleanup forms are also not run for frames abandoned because of a control transfer via (ENVEVAL NIL NIL NIL (3) NIL)ENVEVAL or ENVAPPLY(ENVAPPLY NIL NIL NIL (3) NIL). Callers of ENVEVAL or ENVAPPLY should consider whether their intent would be served as well by RETEVAL or RETAPPLY, which do run cleanup forms in most cases.
2
Chapter 12 Miscellaneous
1
Section 12.4 System Version Information
1
All the functions listed on page 12.12 in the Interlisp-D Reference Manual have had their (SYMBOLS NIL symbols NIL (3) 6)symbols moved to the LISP (CL) package. They are not shared with the INTERLISP package and any references to them in your code will need to be qualified i.e., CL:name.
Section 12.8 Pattern Matching
1
Pattern matching(PATTERN% MATCHING NIL pattern% matching NIL (3) 6) is no longer a standard part of the environment. The functionality for Pattern matching can be found in the Lisp Library Module called MATCH.
[This page intentionally left blank](LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "3-" "") STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "3-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 723) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "3-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "3-" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "3-" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "3-" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))))) -ÌÌøT3ÌÌø ÞT3ÌÌø ÞT-ÌÌøT3HHøøT3HHøøT3HHøøT3ÌÌø ÞT2ÌÌøÞ,ØØø2HHøø-øT,<00><00>ø$-ø2T-øT-ø äøT,ÌÌø3øÞT3øÞT3ø¼T,ÌÌø2ÌÌø Þ3ÌÌø¼T3ÌÌø¼TFøø PAGEHEADING VERSOHEADFøø PAGEHEADING RECTOHEADEøø PAGEHEADINGFOOTINGVEøø PAGEHEADINGFOOTINGR3ø¼T3ø2¼T2ø¼2ø2¼MODERN
G9(DEFAULTFONT 1 (HELVETICA 12 BRR) (GACHA 8) (TERMINAL 8)) MODERN MODERN
TERMINAL

TIMESROMAN
MODERN
MODERN
MODERN
MODERN
MODERN
MODERN MODERN MODERNMODERN
MODERN
MODERN
MODERN
MODERN HRULE.GETFNMODERN
I HRULE.GETFNMODERN
I' HRULE.GETFNMODERN
' HRULE.GETFNMODERN
( HRULE.GETFNMODERN:¦7-
   HRULE.GETFNMODERN HRULE.GETFNMODERN5?IM.INDEX.GETFN IM.INDEX.GETFN|71<00> (  HRULE.GETFNMODERN   &IM.INDEX.GETFNMODERN
 
 HRULE.GETFNMODERN
eIM.INDEX.GETFNõk¨ §: IM.INDEX.GETFN?%IM.INDEX.GETFN;  HRULE.GETFNMODERN 
 &$IM.INDEX.GETFN (IM.INDEX.GETFNMODERN
 
 HRULE.GETFNMODERN
'*    HRULE.GETFNMODERN 
Õ #IM.INDEX.GETFNY &IM.INDEX.GETFN% *IM.INDEX.GETFNMODERN

 HRULE.GETFNMODERN
  HRULE.GETFNMODERN d'IM.INDEX.GETFNA
éû=IM.INDEX.GETFN' )IM.INDEX.GETFNQ @%IM.INDEX.GETFN<. HRULE.GETFNMODERN HRULE.GETFNMODERN6;IM.INDEX.GETFN;IM.INDEX.GETFNV HRULE.GETFNMODERN HRULE.GETFNMODERNRIM.INDEX.GETFN HRULE.GETFNMODERN HRULE.GETFNMODERN)IM.INDEX.GETFNä'IM.INDEX.GETFN
 'IM.INDEX.GETFNj IM.INDEX.GETFN /IM.INDEX.GETFNE HRULE.GETFNMODERN+ HRULE.GETFNMODERN¾<#IM.INDEX.GETFN 1IM.INDEX.GETFNQIM.INDEX.GETFN3IM.INDEX.GETFN0%IM.INDEX.GETFN !"IM.INDEX.GETFN$IM.INDEX.GETFN*
2
&<00>
  HRULE.GETFNMODERN  L] HRULE.GETFNMODERN= HRULE.GETFNMODERN  HRULE.GETFNMODERN 
IM.INDEX.GETFN^   HRULE.GETFNMODERN 0IM.INDEX.GETFNMODERN
   
  HRULE.GETFNMODERN
 o
w  HRULE.GETFNMODERN  œ)IM.INDEX.GETFNMODERN
É9IM.INDEX.GETFN'' â&IM.INDEX.GETFN HRULE.GETFNMODERN HRULE.GETFNMODERN! HRULE.GETFNMODERN 1IM.INDEX.GETFN  >9IM.INDEX.GETFN5%IM.INDEX.GETFN%IM.INDEX.GETFNád'IM.INDEX.GETFN&*IM.INDEX.GETFN3/IM.INDEX.GETFN7IM.INDEX.GETFNMODERN
IM.INDEX.GETFNIM.INDEX.GETFNIM.INDEX.GETFN±%§ÅIM.INDEX.GETFNMODERN
IM.INDEX.GETFNA"  HRULE.GETFNMODERN HRULE.GETFNMODERN(  HRULE.GETFNMODERN .IM.INDEX.GETFN2n  HRULE.GETFNMODERN 3IM.INDEX.GETFN<00>$:"4zº