Page Numbers: Yes X: 306 Y: 1.0" First Page: 63
Margins: Top: 1.0" Bottom: 1.3"
Heading:
STANDARD PROCEDURES3-LISP REFERENCE MANUAL March 17, 1984
————————————————————————————————————————————
4.c.15. OTHER GENERAL UTILITIES
————————————————————————————————————————————
(ID E)
ID designates the single argument identity function. (ID E) designates the designation of E, and returns what E normalises to. The primary use is as a null ("throw-back") continuation.
F-Type:[ OBJECTS ] ← OBJECTS
Examples:(ID 3)g3
(ID (+ 2 2))g4
(ID ’(+ 2 3))g’(+ 2 3)
(ID ID)g{simple ID closure}
————————————————————————————————————————————
4.c.16. PROCESSOR
————————————————————————————————————————————
(NORMALISE EXP ENV ESC CONT)
Normalises the structure designated by EXP in the environment designated by ENV with escape designated by ESC and continuation designated by CONT. Under normal circumstances, the normal-form designator that results from this normalisation will be passed as the single argument to the continuation. Error if EXP does not designate a structure.
F-Type: [ STRUCTURES X ENVIRONMENTS X FUNCTIONS X FUNCTIONS ] ← STRUCTURES
Properties: Kernel; CPS.
Examples:Assume that SE is bound to STANDARD-ESCAPE:
(NORMALISE ’1 GLOBAL SE ID)g’1
(NORMALISE ’X (BIND ’X ’1 ↑(ECONS)) SE ID)g’1
(NORMALISE ’(+ 2 2) GLOBAL SE ID)g’4
(NORMALISE ’+ GLOBAL SE QUOTE)g’(BINDING EXP ENV)
(NORMALISE ’$TRUE GLOBAL SE QUOTE)g’EXP
(REDUCE PROC ARGS ENV CONT)
Reduces the referent of the structure designated by PROC with the referent of the structure designated by ARGS in the environment designated by ENV with escape designated by ESC and with continuation designated by CONT. Under normal circumstances, the normal-form designator that results from this process will be passed as the single argument to the continuation.
F-Type: [ STRUCTURES X STRUCTURES X ENVIRONMENTS X FUNCTIONS X FUNCTIONS ] ← STRUCTURES
Properties: Kernel; CPS.
Examples:Assume that SE is bound to STANDARD-ESCAPE:
(REDUCE ’+ ’[2 2] GLOBAL SE ID)g’4
(REDUCE ’IF ’[$TRUE 1 2] GLOBAL SE ID)g’1
(REDUCE ’+ ’[2 2] GLOBAL SE
(LAMBDA MACRO [X] ↑X))g’↑(↑PROC! . ↑ARGS!)
(READ-NORMALISE-PRINT LEVEL ENV STREAM)
Starts a READ, NORMALISE, PRINT loop with ENV designating the initial environment. STREAM designates the stream through which this driver loop communicates; the designation of LEVEL is used as a (hopefully unique) identifying prompt. Under normal circumstances, READ-NORMALISE-PRINT will not terminate.
F-Type: [ OBJECTS X SEQUENCES X STREAMS ] ← OBJECTS Properties: CPS .
Examples:1> (READ-NORMALISE-PRINT ’NEW GLOBAL PRIMARY-STREAM)
’NEW> (+ 2 2)
’NEW= 4
’NEW> ; This level is just as good as the old one.
(NORMAL S)
True just in case S designates a normal-form internal structure.
F-Type: [ STRUCTURES ] ← TRUTH-VALUES Properties: Kernel.
Examples:(NORMAL ’3)g$TRUE
(NORMAL ’(+ 2 3))g$FALSE
(NORMAL ↑(+ 2 3))g$TRUE
(NORMAL ’[1 2 3])g$TRUE
(NORMAL ’[1 2 A])g$FALSE
(NORMAL ’A)g$FALSE
(NORMAL ’’A)g$TRUE
(NORMAL-RAIL RAIL)
True just in case RAIL designates a normal-form rail.
F-Type: [ RAILS ] ← TRUTH-VALUES Properties: Kernel.
Examples:(NORMAL-RAIL ’[])g$TRUE
(NORMAL-RAIL ’[1 $TRUE #C])g$TRUE
(NORMAL-RAIL ’[1 2 A])g$FALSE
Examples:(PRIMITIVE ↑+)g$TRUE
(PRIMITIVE ↑NORMALISE)g$FALSE
(PRIMITIVE ↑IF)g$FALSE