home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / portfoli / xlisp / xlispref.txt < prev   
Encoding:
Text File  |  1991-12-31  |  403.3 KB  |  13,385 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.             XLISP 2.0 LANGUAGE REFERENCE
  13.  
  14.  
  15.                      by 
  16.  
  17.                    Tim I Mikkelsen
  18.  
  19.  
  20.                   December 11, 1989
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.     Copyright  (c) 1989 by Tim I.  Mikkelsen.  All Rights  Reserved.
  30.     No part of this document may be copied, reproduced or translated
  31.     for commercial use without prior written  consent of the author.
  32.     Permission  is granted  for  non-commercial  use as long as this
  33.     notice is left intact.
  34.  
  35.  
  36.     ________________________________________________________________
  37.  
  38.  
  39.     This document is intended to serve as a reference  for the XLISP
  40.     2.0 dialect of LISP.  It includes a description  of each symbol,
  41.     function,  special  form and keyword  available  in XLISP.  This
  42.     reference is not a complete and extensive  introduction  to LISP
  43.     programming.
  44.  
  45.     If you find problems with the reference or find that I have left
  46.     something out, drop me a line.  If you find this useful, I would
  47.     be interested in hearing that as well.  If you are into 'pretty'
  48.     looking  documents  (as  oppossed to plain ASCII text), I have a
  49.     TeX version of the reference.
  50.  
  51.  
  52.             Tim Mikkelsen
  53.             4316 Picadilly Drive
  54.             Fort Collins, Colorado  80526
  55.  
  56.  
  57. Each  entry is a symbol  of some  variety  that the  XLISP  system  will
  58. recognize.  The parts of each reference entry include:
  59.  
  60.     Name            This top line  gives  the name or  symbol of the
  61.             entry.  The   reference   has  the   entries  in
  62.             alphabetical  order.  
  63.  
  64.     Type            The entry type may be one of the following:
  65.  
  66.                 - function (subr) 
  67.                 - predicate function (subr) 
  68.                 - special form (fsubr) 
  69.                 - reader expansion 
  70.                 - defined function (closure) 
  71.                 - defined macro (closure) 
  72.                 - system variable 
  73.                 - system constant 
  74.                 - keyword 
  75.                 - object 
  76.                 - message selector 
  77.  
  78.     Location        This line  specifies if the entry is built-in to
  79.             the system or an extension.
  80.  
  81.     Source file     This line  specifies  the source  file where the
  82.             routine  or  code   associated  with  the  entry
  83.             resides.  If  the  entry  is  an  extension,  it
  84.             specifies the source file (usually "init.lsp").
  85.  
  86.     Common LISP    This  line   specifies   whether  the  entry  is
  87.     compatable    compatable  with the  defintion  of Common LISP.
  88.             There are four levels:
  89.  
  90.                 yes     - compatable with Common LISP.
  91.                 similar    - compatable, some differences.
  92.                 related    - related, major differences. 
  93.                 no     - not compatable. 
  94.  
  95.     Supported on    This line specifies machine dependencies.  A few
  96.             features  are  available   only  on  PCs  or  on
  97.             Macintoshes.  (Note that I have not included the
  98.             Macintosh specific graphics commands.)
  99.  
  100.     Syntax          This area  defines  the  syntax  or usage of the
  101.             entry.  It  is  also   used   to   specify   the
  102.             arguments.  Items that are enclosed  between a <
  103.             and a > are arguments.  Items enclosed between [
  104.             and ] are optional entries.  Items that have ...
  105.             (elipses) indicate that there can be one or many
  106.             of the  item.  Items  enclosed  between  { and }
  107.             which are  separated  by | indicate  that one of
  108.             the items should be included.
  109.  
  110.     Description     This  defines the entry,  necessary  conditions,
  111.             results, defaults, etc.
  112.  
  113.     Examples     This area shows example uses of the entry.
  114.  
  115.     Comments        This area includes  additional  information such
  116.             as  compatability   notes,  bugs,  usage  notes,
  117.             potential problems, keystroke equivalences, etc.
  118.  
  119. *
  120. ________________________________________________________________________
  121.  
  122. type: function (subr) 
  123. location: built-in
  124. source file: xlmath.c
  125. Common LISP compatible: yes
  126. supported on: all machines
  127.  
  128. SYNTAX
  129.  
  130. (* <expr1> ... )
  131.     <exprN>        -    integer or floating point number/expression
  132.  
  133. DESCRIPTION
  134.  
  135. The multiply  (*)  function  multiplies a list of numbers  together  and
  136. returns the result.
  137.  
  138. EXAMPLES
  139.  
  140.     (* 1)                    ; returns 1
  141.     (* 1 2)                    ; returns 2
  142.     (* 1 2 3)                ; returns 6
  143.     (* 1 2 3 4)                ; returns 24
  144.  
  145.     (print (+ 1 2 (* 3.5 (/ 3.9 1.45))))    ; returns and prints 12.4138
  146.  
  147.  
  148. *
  149. ________________________________________________________________________
  150.  
  151. type: variable
  152. location: built-in
  153. source file: xlinit.c  xlisp.c
  154. Common LISP compatible: yes
  155. supported on: all machines
  156.  
  157. SYNTAX
  158.  
  159. *
  160.  
  161.  
  162. DESCRIPTION
  163.  
  164. The *  variable  is  set  to the  result  of  the  previously  evaluated
  165. expression.
  166.  
  167. EXAMPLES
  168.  
  169.     (setq a 'b)                ; returns B
  170.     *                    ; returns B
  171.     *                    ; returns B
  172.  
  173. NOTE:
  174. It is best not to use this variable in a program.  
  175.  
  176.  
  177. **
  178. ________________________________________________________________________
  179.  
  180. type: variable
  181. location: built-in
  182. source file: xlinit.c  xlisp.c
  183. Common LISP compatible: yes
  184. supported on: all machines
  185.  
  186. SYNTAX
  187.  
  188. **
  189.  
  190.  
  191. DESCRIPTION
  192.  
  193. The **  variable is set to the result of the next to the last  evaluated
  194. expression.
  195.  
  196. EXAMPLES
  197.  
  198.     (setq fee 'fi)                ; returns FI
  199.     (setq fo 'fum)                ; returns FUM
  200.     **                    ; returns FI
  201.     **                    ; returns FUM
  202.     **                    ; returns FI
  203.  
  204. NOTE:
  205. It is best not to use this variable in a program.  
  206.  
  207.  
  208. ***
  209. ________________________________________________________________________
  210.  
  211. type: variable
  212. location: built-in
  213. source file: xlinit.c  xlisp.c
  214. Common LISP compatible: yes
  215. supported on: all machines
  216.  
  217. SYNTAX
  218.  
  219. ***
  220.  
  221.  
  222. DESCRIPTION
  223.  
  224. The  ***  variable  is set  to the  result  of the  second  to the  last
  225. evaluated expression.
  226.  
  227. EXAMPLES
  228.  
  229.     (setq a 'eenie)                ; returns EENIE
  230.     (setq b 'meenie)            ; returns MEENIE
  231.     (setq c 'beanie)            ; returns BEANIE
  232.     ***                    ; returns EENIE
  233.     ***                    ; returns MEENIE
  234.     ***                    ; returns BEANIE
  235.     ***                    ; returns EENIE
  236.  
  237. NOTE:
  238. It is best not to use this variable in a program.  
  239.  
  240.  
  241. +
  242. ________________________________________________________________________
  243.  
  244. type: function (subr) 
  245. location: built-in
  246. source file: xlmath.c
  247. Common LISP compatible: yes
  248. supported on: all machines
  249.  
  250. SYNTAX
  251.  
  252. (+ <expr1> ... )
  253.     <exprN>        -    integer or floating point number/expression
  254.  
  255. DESCRIPTION
  256.  
  257. The add (+)  function  adds a list of numbers  together  and returns the
  258. result.
  259.  
  260. EXAMPLES
  261.  
  262.     (+ 1)                    ; returns 1
  263.     (+ 1 2)                    ; returns 3
  264.     (+ 1 2 3)                ; returns 6
  265.     (+ 1 2 3 4)                ; returns 10
  266.  
  267.     (print (+ 1 2 (* 3.5 (/ 3.9 1.45))))    ; returns and prints 12.4138
  268.  
  269.  
  270. +
  271. ________________________________________________________________________
  272.  
  273. type: variable
  274. location: built-in
  275. source file: xlinit.c  xlisp.c
  276. Common LISP compatible: yes
  277. supported on: all machines
  278.  
  279. SYNTAX
  280.  
  281. +
  282.  
  283.  
  284. DESCRIPTION
  285.  
  286. The + variable is set to the most recent input expression.
  287.  
  288. EXAMPLES
  289.  
  290.     (setq hi 'there)            ;returns THERE
  291.     +                    ;returns (SETQ HI (QUOTE THERE))
  292.     +                    ;returns +
  293.  
  294. NOTE:
  295. It is best not to use this variable in a program.  
  296.  
  297.  
  298. ++
  299. ________________________________________________________________________
  300.  
  301. type: variable
  302. location: built-in
  303. source file: xlinit.c  xlisp.c
  304. Common LISP compatible: yes
  305. supported on: all machines
  306.  
  307. SYNTAX
  308.  
  309. ++
  310.  
  311.  
  312. DESCRIPTION
  313.  
  314. The ++ variable is set to the next to the last input expression.
  315.  
  316. EXAMPLES
  317.  
  318.     (setq fee 'fi)                ; returns FI
  319.     (setq fo 'fum)                ; returns FUM
  320.     ++                    ; returns (SETQ FEE (QUOTE FI))
  321.     ++                    ; returns (SETQ FO (QUOTE FUM))
  322.     ++                    ; returns ++
  323.  
  324. NOTE:
  325. It is best not to use this variable in a program.  
  326.  
  327.  
  328. +++
  329. ________________________________________________________________________
  330.  
  331. type: variable
  332. location: built-in
  333. source file: xlinit.c  xlisp.c
  334. Common LISP compatible: yes
  335. supported on: all machines
  336.  
  337. SYNTAX
  338.  
  339. +++
  340.  
  341.  
  342. DESCRIPTION
  343.  
  344. The +++ variable is set to the second to the last input expression.
  345.  
  346. EXAMPLES
  347.  
  348.     (setq a 'eenie)                ;returns EENIE
  349.     (setq b 'meenie)            ;returns MEENIE
  350.     (setq c 'beanie)            ;returns BEANIE
  351.     +                    ;returns (SETQ C (QUOTE BEANIE))
  352.     ++                    ;returns (SETQ C (QUOTE BEANIE))
  353.     +++                    ;returns (SETQ C (QUOTE BEANIE))
  354.     +                    ;returns +
  355.  
  356. NOTE:
  357. It is best not to use this variable in a program.  
  358.  
  359.  
  360. -
  361. ________________________________________________________________________
  362.  
  363. type: function (subr) 
  364. location: built-in
  365. source file: xlmath.c
  366. Common LISP compatible: yes
  367. supported on: all machines
  368.  
  369. SYNTAX
  370.  
  371. (- <expr1> ... )
  372.     <exprN>        -    integer or floating point number/expression
  373.  
  374. DESCRIPTION
  375.  
  376. The  subtract  (-) function  subtracts a list of numbers  from the first
  377. number in the list and returns the  result.  If there is only one number
  378. as an argument, it is negated.
  379.  
  380. EXAMPLES
  381.  
  382.     (- 1)                    ; returns -1
  383.     (- 1 2)                    ; returns -1
  384.     (- 1 2 3)                ; returns -4
  385.     (- 1 2 3 4)                ; returns -8
  386.  
  387.     (print (+ 1 2 (* 3.5 (/ 3.9 1.45))))    ; returns and prints 12.4138
  388.  
  389.  
  390. -
  391. ________________________________________________________________________
  392.  
  393. type: variable
  394. location: built-in
  395. source file: xlinit.c  xlisp.c
  396. Common LISP compatible: yes
  397. supported on: all machines
  398.  
  399. SYNTAX
  400.  
  401. -
  402.  
  403.  
  404. DESCRIPTION
  405.  
  406. The - variable is set to the expression currently being evaluated.
  407.  
  408. EXAMPLES
  409.  
  410.     -                    ; returns -
  411.     (setq a -)                ; returns (SETQ A -)
  412.     a                    ; returns (SETQ A -)
  413.  
  414. NOTE:
  415. It is best not to use this variable in a program.  
  416.  
  417.  
  418. /
  419. ________________________________________________________________________
  420.  
  421. type: function (subr) 
  422. location: built-in
  423. source file: xlmath.c
  424. Common LISP compatible: yes
  425. supported on: all machines
  426.  
  427. SYNTAX
  428.  
  429. (/ <expr1> ... )
  430.     <exprN>        -    integer or floating point number/expression
  431.  
  432. DESCRIPTION
  433.  
  434. The divide (/) function divides the first number in the list by the rest
  435. of the  numbers  in  the  list  and  returns  the  result.  If  all  the
  436. expressions  are  integers,  the  division is integer  division.  If any
  437. expression  is a  floating  point  number,  then  the  division  will be
  438. floating point division.
  439.  
  440. EXAMPLES
  441.  
  442.     (/ 1)                    ; returns 1
  443.     (/ 1 2)                    ; returns 0 (integer division)
  444.     (float (/ 1 2))                ; returns 0 (integer division)
  445.     (/ (float 1) 2)                ; returns 0.5
  446.     (/ 1 1.0 2)                ; returns 0.5     (short cut)
  447.     (/ (float 1) 2 3)            ; returns 0.166667
  448.     (/ 1 1.0 2 3 4)                ; returns 0.0416667
  449.  
  450.     (print (+ 1 2 (* 3.5 (/ 3.9 1.45))))    ; returns and prints 12.4138
  451.  
  452. COMMON LISP COMPATABILITY:
  453. Common LISP  supports a ratio data type.  This means that (/ 3 4 5) will
  454. result in the value  3/20.  In XLISP (/ 3 4 5) will result in 0 (because
  455. of integer  values).  (/ 3.0 4 5) will result in 0.15 for both XLISP and
  456. Common LISP.
  457.  
  458. NOTE:
  459. An easy way to force a sequence  of  integers to be divided as  floating
  460. point  numbers is to insert the number 1.0 after the first  argument  in
  461. the list of arguments to the divider function.
  462.  
  463.  
  464. /=
  465. ________________________________________________________________________
  466.  
  467. type: function (subr)
  468. location: built-in
  469. source file: xlmath.c
  470. Common LISP compatible: yes
  471. supported on: all machines
  472.  
  473. SYNTAX
  474.  
  475. (/= <expr1> <expr2> ... )
  476.     <exprN>        -    a numeric expression
  477.  
  478. DESCRIPTION
  479.  
  480. The /=  (NOT-EQUAL)  operation  takes an  arbitrary  number  of  numeric
  481. arguments.  It checks to see if all the numeric arguments are different.
  482. T is returned if the arguments are  numerically not  equivalent,  NIL is
  483. returned otherwise.
  484.  
  485. EXAMPLES
  486.  
  487.     (/= 1 1)                ; returns NIL
  488.     (/= 1 2)                ; returns T
  489.     (/= 1 1.0)                ; returns NIL
  490.     (/= 1 2 3)                ; returns T
  491.     (/= 1 2 2)                ; returns NIL
  492.  
  493.     (/= "a" "b")                ; error: bad argument type
  494.     (setq a 1) (setq b 12.4)        ; set up A and B with values
  495.     (/= a b)                ; returns NIL
  496.  
  497. BUG:
  498. The XLISP /= (NOT-EQUAL)  function checks to see if the each argument is
  499. different from the next in the list.  This means that (/= 1 2 3) returns
  500. T as it is supposed to, but that (/= 1 2 3 2 1) returns T when it should
  501. return NIL.  This is only a problem for the /= (NOT-EQUAL) function.
  502.  
  503.  
  504. 1+
  505. ________________________________________________________________________
  506.  
  507. type: function (subr) 
  508. location: built-in
  509. source file: xlmath.c
  510. Common LISP compatible: yes
  511. supported on: all machines
  512.  
  513. SYNTAX
  514.  
  515. (1+ <expr> )
  516.     <expr>        -    integer or floating point number/expression
  517.  
  518. DESCRIPTION
  519.  
  520. The increment (1+) function adds one to a number and returns the result.
  521.  
  522. EXAMPLES
  523.  
  524.     (1+ 1)                    ; returns 2
  525.     (1+ 99.1)                ; returns 100.1
  526.     (1+ 1 2)                ; error: too many arguments
  527.  
  528.  
  529. 1-
  530. ________________________________________________________________________
  531.  
  532. type: function (subr) 
  533. location: built-in
  534. source file: xlmath.c
  535. Common LISP compatible: yes
  536. supported on: all machines
  537.  
  538. SYNTAX
  539.  
  540. (1- <expr> )
  541.     <expr>        -    integer or floating point number/expression
  542.  
  543. DESCRIPTION
  544.  
  545. The decrement (1-) function  subtracts one from a number and returns the
  546. result.
  547.  
  548. EXAMPLES
  549.  
  550.     (1- 1)                    ; returns 0
  551.     (1- 99.6)                ; returns 98.6
  552.     (1- 1 2)                ; error: too many arguments
  553.  
  554.  
  555. <
  556. ________________________________________________________________________
  557.  
  558. type: function (subr)
  559. location: built-in
  560. source file: xlmath.c
  561. Common LISP compatible: yes
  562. supported on: all machines
  563.  
  564. SYNTAX
  565.  
  566. (< <expr1> <expr2> ... )
  567.     <exprN>        -    a numeric expression
  568.  
  569. DESCRIPTION
  570.  
  571. The <  (LESS-THAN)  operation  takes  an  arbitrary  number  of  numeric
  572. arguments.  It  checks  to see if  all  the  numbers  are  monotonically
  573. increasing.  T  is   returned   if  the   arguments   are   numerically,
  574. monotonically  increasing, , NIL is returned  otherwise.  In the case of
  575. two  arguments,  this has the effect of  testing if <expr1> is less than
  576. <expr2>.
  577.  
  578. EXAMPLES
  579.  
  580.     (< 1 2)                    ; returns T
  581.     (< 1 1)                    ; returns NIL
  582.     (< -1.5 -1.4)                ; returns T
  583.     (< 1 2 3 4)                ; returns T
  584.     (< 1 2 3 2)                ; returns NIL
  585.  
  586.     (< "a" "b")                ; error: bad argument type
  587.     (setq a 12) (setq b 13.99)        ; set up A and B with values
  588.     (< a b)                    ; returns T
  589.     (< b a)                    ; returns NIL
  590.  
  591.  
  592. <=
  593. ________________________________________________________________________
  594.  
  595. type: function (subr)
  596. location: built-in
  597. source file: xlmath.c
  598. Common LISP compatible: yes
  599. supported on: all machines
  600.  
  601. SYNTAX
  602.  
  603. (<= <expr1> <expr2> ... )
  604.     <exprN>        -    a numeric expression
  605.  
  606. DESCRIPTION
  607.  
  608. The <=  (LESS-THAN-OR-EQUAL)  operation  takes an  arbitrary  number  of
  609. numeric   arguments.  It   checks  to  see  if  all  the   numbers   are
  610. monotonically  non-decreasing.  T  is  returned  if  the  arguments  are
  611. numerically,  monotonically  non-decreasing, NIL is returned  otherwise.
  612. For two  arguments,  this has the effect of  testing  if <expr1> is less
  613. than or equal to <expr2>.
  614.  
  615. EXAMPLES
  616.  
  617.     (<= 1 1)                ; returns T
  618.     (<= 1 2)                ; returns T
  619.     (<= 2.0 1.99)                ; returns NIL
  620.     (<= 1 2 3 3)                ; returns T
  621.     (<= 1 2 3 3 2)                ; returns NIL
  622.  
  623.     (<= "aa" "aa")                ; error: bad argument type
  624.     (setq a 12) (setq b 999.999)        ; set up A and B with values
  625.     (<= a b)                ; returns T
  626.     (<= b a)                ; returns NIL
  627.  
  628.  
  629. =
  630. ________________________________________________________________________
  631.  
  632. type: function (subr)
  633. location: built-in
  634. source file: xlmath.c
  635. Common LISP compatible: yes
  636. supported on: all machines
  637.  
  638. SYNTAX
  639.  
  640. (= <expr1> <expr2> ... )
  641.     <exprN>        -    a numeric expression
  642.  
  643. DESCRIPTION
  644.  
  645. The  =  (EQUALITY)  operation  takes  an  arbitrary  number  of  numeric
  646. arguments.  It  checks  to  see if  all  the  numbers  are  equal.  T is
  647. returned if all of the  arguments are  numerically  equal to each other,
  648. NIL is returned otherwise.
  649.  
  650. EXAMPLES
  651.  
  652.     (= 1 1)                    ; returns T
  653.     (= 1 2)                    ; returns NIL
  654.     (= 1 1.0)                ; returns T
  655.     (= 1 1.0 1 (+ 0 1))            ; returns T
  656.     (= 1 1.0 1.00001)            ; returns NIL
  657.  
  658.     (= "a" "b")                ; error: bad argument type
  659.     (setq a 1) (setq b 1.0)            ; set up A and B with values
  660.     (= a b)                    ; returns T
  661.  
  662.  
  663. >
  664. ________________________________________________________________________
  665.  
  666. type: function (subr)
  667. location: built-in
  668. source file: xlmath.c
  669. Common LISP compatible: yes
  670. supported on: all machines
  671.  
  672. SYNTAX
  673.  
  674. (> <expr1> <expr2> ... )
  675.     <exprN>        -    a numeric expression
  676.  
  677. DESCRIPTION
  678.  
  679. The >  (GREATER-THAN)  operation  takes an  arbitrary  number of numeric
  680. arguments.  It  checks  to see if  all  the  numbers  are  monotonically
  681. decreasing.  T  is   returned   if  the   arguments   are   numerically,
  682. monotonically decreasing, NIL is returned otherwise.  For two arguments,
  683. this has the effect of testing if <expr1> is greater than <expr2>.
  684.  
  685. EXAMPLES
  686.  
  687.     (> 1 1)                    ; returns NIL
  688.     (> 1 2)                    ; returns NIL
  689.     (> 2.0 1.99)                ; returns T
  690.     (> 3 2 1)                ; returns T
  691.     (> 3 2 2)                ; returns NIL
  692.  
  693.     (> "aa" "aa")                ; error: bad argument type
  694.     (setq a 12) (setq b 999.999)        ; set up A and B with values
  695.     (> a b)                    ; returns NIL
  696.     (> b a)                    ; returns T
  697.  
  698.  
  699. >=
  700. ________________________________________________________________________
  701.  
  702. type: function (subr)
  703. location: built-in
  704. source file: xlmath.c
  705. Common LISP compatible: yes
  706. supported on: all machines
  707.  
  708. SYNTAX
  709.  
  710. (>= <expr1> <expr2> ... )
  711.     <exprN>        -    a numeric expression
  712.  
  713. DESCRIPTION
  714.  
  715. The >=  (GREATER-THAN-OR-EQUAL)  operation takes an arbitrary  number of
  716. numeric   arguments.  It   checks  to  see  if  all  the   numbers   are
  717. monotonically non-increasing.  T is returned if <expr1> is the arguments
  718. are   numerically,   monotonically   non-increasing,   NIL  is  returned
  719. otherwise.  For two arguments, this has the effect of testing if <expr1>
  720. is greater than or equal to <expr2>.
  721.  
  722. EXAMPLES
  723.  
  724.     (>= 1 2)                ; returns NIL
  725.     (>= 1 1)                ; returns T
  726.     (>= -1.5 -1.4)                ; returns NIL
  727.     (>= 3 2 1)                ; returns T
  728.     (>= 3 2 2)                ; returns T
  729.     (>= 3 2 3)                ; returns NIL
  730.  
  731.     (>= "aa" "abc")                ; error: bad argument type
  732.     (setq a 12) (setq b 13.99)        ; set up A and B with values
  733.     (>= a b)                ; returns NIL
  734.     (>= b a)                ; returns T
  735.  
  736.  
  737. abs
  738. ________________________________________________________________________
  739.  
  740. type: function (subr) 
  741. location: built-in
  742. source file: xlmath.c
  743. Common LISP compatible: yes
  744. supported on: all machines
  745.  
  746. SYNTAX
  747.  
  748. (abs <expr> )
  749.     <expr>        -    integer or floating point number/expression
  750.  
  751. DESCRIPTION
  752.  
  753. The ABS  function  finds the absolute  value of a number and returns the
  754. result.
  755.  
  756. EXAMPLES
  757.  
  758.     (abs 1)                    ; returns 1
  759.     (abs -99)                ; returns 99
  760.     (abs -99.9)                ; returns 99.9
  761.     (abs -32768)                ; returns 32768
  762.  
  763. COMMON LISP COMPATABILITY:
  764. Common LISP supports a complex  number data type which is not  supported
  765. in XLISP.
  766.  
  767.  
  768. address-of
  769. ________________________________________________________________________
  770.  
  771. type: function (subr) 
  772. location: built-in
  773. source file: xlsys.c
  774. Common LISP compatible: no
  775. supported on: all machines
  776.  
  777. SYNTAX
  778.  
  779. (address-of <expr> )
  780.     <expr>        -    an expression
  781.  
  782. DESCRIPTION
  783.  
  784. The ADDRESS-OF function returns the internal memory address of the XLISP
  785. node that corresponds to <expr>.  The value returned is an integer.
  786.  
  787. EXAMPLES
  788.  
  789.     (setq var 0)                ; set up VAR with 0
  790.     (address-of var)            ; returns 123224
  791.     (address-of 'var)            ; returns 182638
  792.     (peek (address-of var))            ; returns 83951616
  793.     (peek (1+ (address-of var)))        ; returns 16777216
  794.     (peek (+ 2 (address-of var)))        ; returns 0  <-- value of VAR
  795.     (setq var 14)                ; change the value to 14
  796.     (peek (+ 2 (address-of var)))        ; returns 14
  797.     (setq var 99)                ; change the value to 99
  798.     (peek (+ 2 (address-of var)))        ; returns 99
  799.  
  800. CAUTION:
  801. Be careful  when  modifying  the  internal  state of XLISP.  If you have
  802. modified it, it would be a good idea to exit XLISP and  re-enter  before
  803. doing any work you really want to retain.
  804.  
  805.  
  806. alloc
  807. ________________________________________________________________________
  808.  
  809. type: function (subr) 
  810. location: built-in
  811. source file: xldmem.c
  812. Common LISP compatible: no
  813. supported on: all machines
  814.  
  815. SYNTAX
  816.  
  817. (alloc  <size> )
  818.     <size>        -    an integer expression
  819.  
  820. DESCRIPTION
  821.  
  822. The ALLOC  function  changes the number of memory  nodes  allocated  per
  823. segment  whenever  memory is  expanded.  The  previous  number  of nodes
  824. allocated per segment is the value returned as the result.  The power up
  825. default if 1000 nodes per  segment.  Note that  ALLOC does not,  itself,
  826. expand memory.  You need to execute the EXPAND function to do the expand
  827. operation.
  828.  
  829. EXAMPLES
  830.  
  831.     (room)                    ; prints  Nodes:       4000
  832.                         ;      Free nodes:  1669
  833.                         ;      Segments:    4
  834.                         ;         Allocate:    1000
  835.                         ;      Total:       52570
  836.                         ;      Collections: 8
  837.                         ; returns NIL
  838.     (alloc 2000)                ; returns 1000
  839.     (room)                    ; prints  Nodes:       4000
  840.                         ;      Free nodes:  1655
  841.                         ;      Segments:    4
  842.                         ;      Allocate:    2000
  843.                         ;      Total:       52570
  844.                         ;      Collections: 8
  845.                         ; returns NIL
  846.  
  847.  
  848. and
  849. ________________________________________________________________________
  850.  
  851. type: special form (fsubr)
  852. location: built-in
  853. source file: xlcont.c
  854. Common LISP compatible: yes
  855. supported on: all machines
  856.  
  857. SYNTAX
  858.  
  859. (and  [ <expr1> ... ] )
  860.     <exprN>        -    an expression
  861.  
  862. DESCRIPTION
  863.  
  864. The AND special form evaluates a sequence of expressions and returns the
  865. effect  of a  logical  AND on  the  expressions.  If, at any  point,  an
  866. expression  is NIL,  NIL is  returned  as  AND's  result.  If all of the
  867. expressions  have a  non-NIL  value,  the  last  expression's  value  is
  868. returned as the result.  Evaluation of the expressions will stop when an
  869. expression evaluates to NIL, none of the subsequent  expressions will be
  870. evaluated.  If there are no expressions, AND returns T as its result.
  871.  
  872. EXAMPLES
  873.  
  874.     (and T "boo" "hiss" T "rah")        ; returns "rah"
  875.     (and T T T T)                ; returns T
  876.     (and)                    ; returns T
  877.     (and (princ "hi") NIL (princ "ho"))    ; prints  hi and returns NIL
  878.     (and (princ "hi") (princ " de ")     ; prints  hi de ho
  879.               (princ "ho"))        ;   returns "ho"
  880.  
  881.     (setq a 5)   (setq b 6)            ; set up A and B
  882.     (if (and (numberp a)             ; if      A is a number
  883.          (numberp b)             ;     and B is a number
  884.          (< a b) )            ;     and A<B
  885.       (print "A is less than B")        ;   THEN do this
  886.       (print "something else happened"))    ;   ELSE do this
  887.                         ; prints "A is less than B"
  888.  
  889.  
  890. :answer
  891. ________________________________________________________________________
  892.  
  893. type: message selector
  894. location: built-in
  895. source file: xlobj.c
  896. Common LISP compatible: no
  897. supported on: all machines
  898.  
  899. SYNTAX
  900.  
  901. (send <class> :answer <message> <args> <code> )
  902.     <class>        -     an existing class
  903.     <message>    -     the message symbol
  904.     <args>        -    formal argument list to the <msg> method
  905.                 of the same form as a lambda argument list
  906.     <code>        -    a list containing the method code
  907.  
  908. DESCRIPTION
  909.  
  910. The :ANSWER  message  selector adds or changes a method in the specified
  911. <class>.  This method  consists of the  <message>  selector  symbol, the
  912. <arg> formal  argument list and the executable code associated  with the
  913. <message>.
  914.  
  915. EXAMPLES
  916.     (setq myclass (send class :new '(var)))    ; create MYCLASS with VAR
  917.     (send myclass :answer :isnew '()    ; set up initialization
  918.         '((setq var nil) self))
  919.     (send myclass :answer :set-it '(value)    ; create :SET-IT message
  920.         '((setq var value)))    
  921.     (send myclass :answer :mine '()     ; create :MINE message
  922.         '((print "hi there")))        
  923.     (setq my-obj (send myclass :new))    ; create MY-OBJ of MYCLASS
  924.     (send my-obj :set-it 5)            ; VAR is set to 5
  925.     (send my-obj :mine)            ; prints  "hi there"
  926.  
  927. NOTE:
  928. When you define a <message> in a <class>,  the  <message>  is only valid
  929. for instances of the <class> or its  sub-classes.  You will get an error
  930. if you try to send the  <message>  to the  <class>  where  it was  first
  931. defined.  If you wish to add a  <message>  to the  <class>,  you need to
  932. define it in the super-class of <class>.
  933.  
  934. MESSAGE STRUCTURE:
  935. The normal XLISP  convention  for a <message> is to have a valid  symbol
  936. preceeded  by a  colon  like  :ISNEW  or  :MY-MESSAGE.  However,  it  is
  937. possible  to define a  <message>  that is a symbol  without a colon, but
  938. this makes the code less readable.
  939.  
  940.  
  941. append
  942. ________________________________________________________________________
  943.  
  944. type: function (subr) 
  945. location: built-in
  946. source file: xllist.c
  947. Common LISP compatible: yes
  948. supported on: all machines
  949.  
  950. SYNTAX
  951.  
  952. (append [ <expr1> ... ] )
  953.     <exprN>        -    a list or list expression
  954.  
  955. DESCRIPTION
  956.  
  957. The APPEND function takes an arbitrary  number of lists and splices them
  958. together into a single list.  This single list is returned.  If an empty
  959. list NIL is appended, it has no effect - it does not appear in the final
  960. list.  (Remember  that  '(NIL) is not an empty  list.)  If an atom is is
  961. appended, it also has no effect and will not appear in the final list.
  962.  
  963. EXAMPLES
  964.  
  965.     (append)                ; returns NIL
  966.     (append 'a 'b)                ; returns B
  967.     (append '(a) '(b))            ; returns (A B)
  968.     (append 'a '(b))            ; returns (B)
  969.     (append '(a) 'b)            ; returns (A . B)
  970.     (append '(a) nil)            ; returns (A)
  971.     (append (list 'a 'b) (list 'c 'd))    ; returns (A B C D)
  972.     (append '(a (b)) '(c (d)))        ; returns (A (B) C (D))
  973.     (append '(a) nil nil nil '(b))        ; returns (A B)
  974.     (append '(a) '(nil) '(b))        ; returns (A NIL B)
  975.  
  976.  
  977. apply
  978. ________________________________________________________________________
  979.  
  980. type: function (subr) 
  981. location: built-in
  982. source file: xlbfun.c
  983. Common LISP compatible: yes
  984. supported on: all machines
  985.  
  986. SYNTAX
  987.  
  988. (apply <function> <args> )
  989.     <function>    -    the function or symbol to be applied to <args>
  990.     <args>        -    a list that contains the arguments to be passed 
  991.                 to <function>
  992.  
  993. DESCRIPTION
  994.  
  995. APPLY causes  <function> to be evaluated with <args> as the  parameters.
  996. APPLY returns the result of <function>.  <args> must be in the form of a
  997. list.
  998.  
  999. EXAMPLES
  1000.  
  1001.     (defun my-add (x y)            ; create MY-ADD function
  1002.         (print "my add")
  1003.         (+ x y))
  1004.     (my-add 1 2)                ; prints "my add" returns 3
  1005.     (apply 'my-add '(2 4))            ; prints "my add" returns 6
  1006.     (apply 'my-add 1 2)            ; error: bad argument type 
  1007.     (apply 'my-add '(1 2 3))        ; error: too many arguments 
  1008.  
  1009.     (apply (function +) '(9 10))        ; returns 19
  1010.     (apply '+ '(4 6))            ; returns 10
  1011.     (apply 'print '("hello there"))        ; prints/returns "hello there"
  1012.     (apply 'print "hello there")        ; error: bad argument type
  1013.  
  1014. NOTE:
  1015. Note that when using APPLY to cause the evaluation of a system function,
  1016. you  can  use the  quoted  name  of the  function  (like  'PRINT  in the
  1017. examples).  You can also use the actual  function (like  (FUNCTION +) in
  1018. the examples).
  1019.  
  1020.  
  1021. *applyhook*
  1022. ________________________________________________________________________
  1023.  
  1024. type: system variable 
  1025. location: built-in
  1026. source file: xlglob.c  (not implemented)
  1027. Common LISP compatible: similar
  1028. supported on: all machines
  1029.  
  1030. SYNTAX
  1031.  
  1032. *applyhook*
  1033.  
  1034.  
  1035. DESCRIPTION
  1036.  
  1037. *APPLYHOOK* is a system  variable that exists and is initialized to NIL.
  1038. It is a hook that is intended to contain a user  function  that is to be
  1039. called  whenever  a function  is applied to a list of  arguments.  It is
  1040. not, however, implemented in XLISP 2.0 - it only exists as a dummy hook.
  1041.  
  1042. EXAMPLES
  1043.     *applyhook*                ; returns NIL
  1044.  
  1045. COMMON LISP COMPATABILITY:
  1046. *APPLYHOOK*  is  defined in Common  LISP and is often used to  implement
  1047. function stepping functionality in a debugger.
  1048.  
  1049.  
  1050. aref
  1051. ________________________________________________________________________
  1052.  
  1053. type: function (subr) 
  1054. location: built-in
  1055. source file: xlbfun.c
  1056. Common LISP compatible: similar
  1057. supported on: all machines
  1058.  
  1059. SYNTAX
  1060.  
  1061. (aref <array> <element> )
  1062.     <array>     -     specified array
  1063.     <element>    -    the element number to be retrieved
  1064.  
  1065. DESCRIPTION
  1066.  
  1067. AREF returns the specified  element out of a previously  created  array.
  1068. Array  elements  may be any valid  lisp data type -  including  lists or
  1069. arrays.  Arrays  made by  MAKE-ARRAY  and  accessed  by AREF are base 0.
  1070. This means the first  element is  accessed  by element  number 0 and the
  1071. last  element is  accessed  by element  number n-1 (where n is the array
  1072. size).  Array elements are initialized to NIL.
  1073.  
  1074. EXAMPLES
  1075.     (setq my-array '#(0 1 2 3 4))        ; make the array
  1076.     (aref my-array 0)            ; return 0th (first) element
  1077.     (aref my-array 4)            ; return 4th (last)  element
  1078.     (aref my-array 5)            ; error: non existant element
  1079.     my-array                ; look at array 
  1080.  
  1081.     (setq new (make-array 4))        ; make another array
  1082.     (setf (aref new 0) (make-array 4))    ; make new[0] an array of 4
  1083.     (setf (aref (aref new 0) 1) 'a)        ; set new[0,1] = 'a
  1084.     (setf (aref new 2) '(a b c))        ; set new[2] = '(a b c)
  1085.     new                    ; look at array
  1086.  
  1087. READ MACRO:
  1088. There is a built-in  read-macro  for arrays - # (the hash symbol).  This
  1089. allows you to create  arbitrary arrays with initial values without going
  1090. through a MAKE-ARRAY function.
  1091.  
  1092. NOTE:
  1093. This function  returns the value of an array element.  However, there is
  1094. no  equivalent  direct  function to set the value of an array element to
  1095. some  value.  To set an element  value, you must use the SETF  function.
  1096. The SETF function is a  generalized  function that allows you to set the
  1097. value of arbitrary lisp entities.
  1098.  
  1099. COMMON LISP COMPATABILITY:
  1100. XLISP  only  supports   one-dimensional  arrays.  Common  LISP  supports
  1101. multi-dimension arrays.
  1102.  
  1103.  
  1104. arrayp
  1105. ________________________________________________________________________
  1106.  
  1107. type: predicate function (subr)
  1108. location: built-in
  1109. source file: xlbfun.c
  1110. Common LISP compatible: yes
  1111. supported on: all machines
  1112.  
  1113. SYNTAX
  1114.  
  1115. (arrayp <expr> )
  1116.     <expr>        -    the expression to check
  1117.  
  1118. DESCRIPTION
  1119.  
  1120. The ARRAYP predicate  checks if an <expr> is an array.  T is returned if
  1121. <expr> is an array, NIL is returned otherwise.
  1122.  
  1123. EXAMPLES
  1124.  
  1125.     (arrayp #(0 1 2))            ; returns T - array 
  1126.     (setq a #(a b c))            ; 
  1127.     (arrayp a)                ; returns T - evaluates to array
  1128.  
  1129.     (arrayp '(a b c))            ; returns NIL - list
  1130.     (arrayp 1)                ; returns NIL - integer
  1131.     (arrayp 1.2)                ; returns NIL - float
  1132.     (arrayp 'a)                ; returns NIL - symbol
  1133.     (arrayp #\a)                ; returns NIL - character
  1134.     (arrayp NIL)                ; returns NIL - NIL
  1135.  
  1136.  
  1137. assoc
  1138. ________________________________________________________________________
  1139.  
  1140. type: function (subr) 
  1141. location: built-in
  1142. source file: xllist.c
  1143. Common LISP compatible: similar
  1144. supported on: all machines
  1145.  
  1146. SYNTAX
  1147.  
  1148. (assoc <expr> <a-list> [ { :test | :test-not } <test> ] )
  1149.     <expr>        -    the expression to find - an atom or list
  1150.     <a-list>    -    the association list to search
  1151.     <test>        -    optional test function (default is EQL)
  1152.  
  1153. DESCRIPTION
  1154.  
  1155. An  association  list is a collection  of list pairs of the form ( (key1
  1156. item1)  (key2  item2) ...  (keyN  itemN) ).  ASSOC  searches  through an
  1157. association  list <a-list>  looking for the key (a CAR in an association
  1158. pair)  that  matches  the  search  <expr>.  If a match  is  found,  that
  1159. association pair (keyN itemN) is returned as the result.  If no match is
  1160. found, a NIL is  returned.  You may specify your own test with the :TEST
  1161. and :TEST-NOT keywords followed by the test you which to perform.
  1162.  
  1163. EXAMPLES
  1164.  
  1165.     (setq mylist '((a . my-a)  (b . his-b)     ; set up an association
  1166.                (c . her-c) (d . end)))    ;   list
  1167.     (assoc 'a mylist)            ; returns (A . MY-A)
  1168.     (assoc 'b mylist)            ; returns (B . HIS-B)
  1169.     (assoc 1 mylist)            ; returns NIL
  1170.  
  1171.     (setq agelist '((1 (bill bob))         ; set up another 
  1172.             (2 (jane jill))     ;   association list
  1173.             (3 (tim tom))        ; 
  1174.             (5 (larry daryl daryl))    ;
  1175.                ))            ;
  1176.     (assoc 1 agelist)            ; returns (1 (BILL BOB))
  1177.     (assoc 3 agelist :test '>=)        ; returns (1 (BILL BOB))
  1178.     (assoc 3 agelist :test '<)        ; returns (5 (LARRY DARYL DARYL))
  1179.     (assoc 3 agelist :test '<=)        ; returns (3 (TIM TOM))
  1180.     (assoc 3 agelist :test-not '>=)        ; returns (5 (LARRY DARYL DARYL))
  1181.  
  1182.     (assoc '(a b) '( ((c d) e) ((a b) x) )    ; use a list as the search 
  1183.               :test 'equal)        ;   note the use of EQUAL
  1184.                         ;   returns ((A B) X)
  1185.  
  1186. NOTE:
  1187. The  ASSOC  function  can  work  with a list or  string  as the  <expr>.
  1188. However, the default EQL test does not work with lists or strings,  only
  1189. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  1190. keyword along with EQUAL for <test>.
  1191.  
  1192. COMMON LISP COMPATABILITY:
  1193. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  1194. function  that is  applied  to each  element  of  <a-list>  before it is
  1195. tested.  XLISP does not support this.
  1196.  
  1197.  
  1198. atom
  1199. ________________________________________________________________________
  1200.  
  1201. type: predicate function (subr)
  1202. location: built-in
  1203. source file: xlbfun.c
  1204. Common LISP compatible: yes
  1205. supported on: all machines
  1206.  
  1207. SYNTAX
  1208.  
  1209. (atom <expr> )
  1210.     <expr>        -    the expression to check
  1211.  
  1212. DESCRIPTION
  1213.  
  1214. The ATOM  predicate  checks if the <expr> is an atom.  T is  returned if
  1215. <expr> is an atom, NIL is returned otherwise.
  1216.  
  1217. EXAMPLES
  1218.  
  1219.     (atom 'a)                ; returns T - symbol
  1220.     (atom #'atom)                ; returns T - subr - function 
  1221.     (atom "string")                ; returns T - string
  1222.     (atom 4)                ; returns T - integer
  1223.     (atom 4.5)                ; returns T - float
  1224.     (atom object)                ; returns T - object
  1225.     (atom #(1 2 3))                ; returns T - array
  1226.     (atom #'quote)                ; returns T - fsubr
  1227.     (atom *standard-output*)        ; returns T - stream
  1228.     (atom '())                ; returns T - NIL is an atom 
  1229.     (atom #'defvar)                ; returns T - closure - macro
  1230.     (atom (lambda (x) (print x)))        ; returns T - closure - lambda
  1231.  
  1232.     (atom '(a b c))                ; returns NIL - list 
  1233.  
  1234.     (setq a '(a b))                ; set up A with value (A B)
  1235.     (atom a)                ; returns NIL - 
  1236.                         ;   value of A is not an atom
  1237.  
  1238. NOTE:
  1239. NIL or '()  is  used  in  many  places  as a  list-class  or  atom-class
  1240. expression.  Both ATOM and LISTP, when applied to NIL, return T.
  1241.  
  1242.  
  1243. &aux
  1244. ________________________________________________________________________
  1245.  
  1246. type: keyword
  1247. location: built-in
  1248. source file: xleval.c
  1249. Common LISP compatible: yes
  1250. supported on: all machines
  1251.  
  1252. SYNTAX
  1253.  
  1254. &aux [ <aux-var> | ( <aux-var> <aux-value> ) ] ...
  1255.     <aux-var>    -    auxiliary variable 
  1256.     <aux-value>    -    auxiliary variable initialization
  1257.  
  1258. DESCRIPTION
  1259.  
  1260. In XLISP, there are several times that you define a formal argument list
  1261. for a body of code (like  DEFUN,  DEFMACRO,  :ANSWER  and  LAMBDA).  The
  1262. <aux-var> variables are a mechanism for you to define variables local to
  1263. the  function  or   operation   definition.  If  there  is  an  optional
  1264. <aux-value>,  they  will be set to that  value on  entry  to the body of
  1265. code.  Otherwise,  they  are  initialized  to  NIL.  At the  end of  the
  1266. function or operation  execution,  these local  symbols and their values
  1267. are are removed.
  1268.  
  1269. EXAMPLES
  1270.  
  1271.     (defun my-add                 ; define function MY-ADD
  1272.       (num1 &rest num-list &aux sum)    ;   with 1 arg, rest, 1 aux var
  1273.       (setq sum num1)            ;   clear SUM
  1274.       (dotimes (i (length num-list) )    ;   loop through rest list
  1275.          (setq sum (+ sum (car num-list)))  ;      add the number to sum
  1276.          (setq num-list (cdr num-list)))    ;      and remove num from list
  1277.       sum)                    ;   return sum when finished
  1278.     (my-add 1 2 3 4)            ; returns 10
  1279.     (my-add 5 5 5 5 5)            ; returns 25
  1280.  
  1281.     (defun more-keys             ; define MORE-KEYS
  1282.         ( a                 ;   with 1 parameter A        
  1283.           &aux b             ;   with local var B
  1284.                (c 99)             ;        local var C= 99
  1285.                (d T)  )            ;        local var D= T
  1286.         (format T "a=~a " a)        ;   body of the function
  1287.         (format T "b=~a " b)        ;
  1288.         (format T "c=~a " c)        ;
  1289.         (format T "d=~a " d))        ;
  1290.     (more-keys "hi")            ; prints a=hi b=NIL c=99 d=T
  1291.  
  1292.  
  1293. backquote
  1294. ________________________________________________________________________
  1295.  
  1296. type: special form (fsubr)
  1297. location: built-in
  1298. source file: xlcont.c  and  xlread.c
  1299. Common LISP compatible: yes
  1300. supported on: all machines
  1301.  
  1302. SYNTAX
  1303.  
  1304. (backquote <expr> )
  1305.     <expr>        -    an expression which is not evaluated 
  1306.                 except for comma and comma-at portions
  1307.  
  1308. DESCRIPTION
  1309.  
  1310. BACKQUOTE  returns the <expr>  unevaluated - like QUOTE.  The difference
  1311. is that portions of the <expr> may be evaluated  when they are preceeded
  1312. by a COMMA (,) or COMMA-AT (,@).  COMMA will evaluate the portion of the
  1313. expression the comma  preceeds.  If the portion is an atom or a list, it
  1314. is  placed as is within  the  expression.  COMMA-AT  will  evaluate  the
  1315. portion of the expression that the comma-at preceeds.  The portion needs
  1316. to be a list.  The list is spliced into the  expression.  If the portion
  1317. is not a list, COMMA-AT will splice in nothing.
  1318.  
  1319. EXAMPLES
  1320.  
  1321.     (setq box 'stuff-inside)        ; BOX contains STUFF-INSIDE
  1322.     (print box)                ; prints STUFF-INSIDE
  1323.     (quote (i have the box))        ; returns (I HAVE THE BOX)
  1324.     (backquote (i have the box))        ; returns (I HAVE THE BOX)
  1325.     (backquote (I have (comma box)))    ; returns (I HAVE STUFF-INSIDE)
  1326.     (backquote (I have the ,@box))        ; returns (I HAVE THE)
  1327.  
  1328.     (setq automobile '(a van))        ; set up AUTOMOBILE 
  1329.     (backquote (I have automobile))        ; returns (I HAVE AUTOMOBILE)
  1330.     (backquote (I have (comma automobile)))    ; returns (I HAVE (A VAN))
  1331.     (backquote (I have ,@automobile))    ; returns (I HAVE A VAN)
  1332.     `(I have ,@automobile)            ; returns (I HAVE A VAN)
  1333.  
  1334. READ MACRO:
  1335. XLISP  supports the normal read macro of a single reverse quote (`) as a
  1336. short-hand method of writing the BACKQUOTE special form.
  1337.  
  1338. NOTE: 
  1339. BACKQUOTE and COMMA and COMMA-AT are very useful in defining  macros via
  1340. DEFMACRO.
  1341.  
  1342.  
  1343. baktrace
  1344. ________________________________________________________________________
  1345.  
  1346. type: function (subr)
  1347. location: built-in
  1348. source file: xldbug.c  and  xlsys.c
  1349. Common LISP compatible: related
  1350. supported on: all machines
  1351.  
  1352. SYNTAX
  1353.  
  1354. (baktrace  [ <level> ]  )
  1355.     <level>        -    an optional integer expression
  1356.  
  1357. DESCRIPTION
  1358.  
  1359. The BAKTRACE function is used to examine the system execution stack from
  1360. within the break look.  It shows the nested forms that got the system to
  1361. the  current  state.  The break loop can be entered  by a system  error,
  1362. ERROR,  CERROR or BREAK  functions.  If the  <levels>  parameter  is not
  1363. specified, all the nested forms will be shown back to the main loop form
  1364. that  started the  execution.  If <level> is  specified  the most recent
  1365. <level> nested forms will be shown.
  1366.  
  1367. EXAMPLES
  1368.  
  1369.     (defun out (x) (print x) (mid 99))    ; define OUT
  1370.     (defun mid (x) (print x) (in 999))    ; define MID
  1371.     (defun in (x) (print x) (break "in" x))    ; define IN with a BREAK
  1372.     (out 9)                    ; prints  9
  1373.                         ;         99
  1374.                         ;         999
  1375.                         ; break: in - 999
  1376.     (baktrace)        ; this is done from within break loop
  1377.                 ; prints  Function: #<Subr-BAKTRACE: #22cb4>
  1378.                 ;         Function: #<Subr-BREAK 
  1379.                 ;         Arguments: 
  1380.                 ;        "in"
  1381.                 ;        999
  1382.                 ;         Function: #<Closure-IN: #2bc44>
  1383.                 ;         Arguments: 
  1384.                 ;        999
  1385.                 ;         Function: #<Closure-MID: #2bd20>
  1386.                 ;         Arguments: 
  1387.                 ;           99
  1388.                 ;         Function: #<Closure-OUT: #2bec4>
  1389.                 ;         Arguments: 
  1390.                 ;           9
  1391.                 ;         NIL
  1392.  
  1393. COMMON LISP COMPATABILITY:
  1394. Common  LISP  has  a  similar  function  called  BACKTRACE.  For  XLISP,
  1395. BAKTRACE is spelled with no 'c'.
  1396.  
  1397.  
  1398. block
  1399. ________________________________________________________________________
  1400.  
  1401. type: special form (fsubr)
  1402. location: built-in
  1403. source file: xlcont.c
  1404. Common LISP compatible: yes
  1405. supported on: all machines
  1406.  
  1407. SYNTAX
  1408.  
  1409. (block  <name> [ <body> ... ] )
  1410.     <name>        -    an unevaluated symbol for the block name
  1411.     <body>        -    a series of expressions
  1412.  
  1413. DESCRIPTION
  1414.  
  1415. The BLOCK special form  specifies a  'named-block'  construct.  The last
  1416. expression  in <body>  will be  returned by the BLOCK  construct  as its
  1417. result unless a RETURN or  RETURN-FROM  is executed  within  BLOCK.  The
  1418. RETURN exit will exit the nearest  (inner-most)  BLOCK.  The RETURN-FROM
  1419. exit will exit the specified block.
  1420.  
  1421. EXAMPLES
  1422.  
  1423.     (block out                 ; outer BLOCK
  1424.        (print "outer")            ; 
  1425.        (block in                 ; inner BLOCK
  1426.         (print "inner")            ;
  1427.         (return-from out "all done")    ;
  1428.         (print "won't get here")    ;
  1429.        )                    ;
  1430.     )                    ; prints "outer"
  1431.                         ; prints "inner"
  1432.                         ; returns "all done"
  1433.  
  1434.  
  1435. both-case-p
  1436. ________________________________________________________________________
  1437.  
  1438. type: predicate function (subr) 
  1439. location: built-in
  1440. source file: xlstr.c 
  1441. Common LISP compatible: yes
  1442. versions: all machines
  1443.  
  1444. SYNTAX
  1445.  
  1446. (both-case-p <char> )
  1447.     <char>        -    a character expression
  1448.  
  1449. DESCRIPTION
  1450.  
  1451. The  BOTH-CASE-P  predicate  checks  if  the  <char>  expression  is  an
  1452. alphabetic  character.  If <char> is an  alphabetic  (either an upper or
  1453. lower  case)  character a T is  returned,  otherwise a NIL is  returned.
  1454. Upper case  characters  are 'A' (ASCII  decimal  value 65)  through  'Z'
  1455. (ASCII decimal value 90).  Lower case  characters are 'a' (ASCII decimal
  1456. value 97) through 'z' (ASCII decimal value 122).
  1457.  
  1458. EXAMPLES
  1459.  
  1460.     (both-case-p #\A)            ; returns T
  1461.     (both-case-p #\a)            ; returns T
  1462.     (both-case-p #\1)            ; returns NIL
  1463.     (both-case-p #\[)            ; returns NIL
  1464.  
  1465.  
  1466. boundp
  1467. ________________________________________________________________________
  1468.  
  1469. type: predicate function (subr)
  1470. location: built-in
  1471. source file: xlbfun.c
  1472. Common LISP compatible: yes
  1473. supported on: all machines
  1474.  
  1475. SYNTAX
  1476.  
  1477. (boundp <symbol> )
  1478.     <symbol>    -    the symbol expression to check for a value
  1479.  
  1480. DESCRIPTION
  1481.  
  1482. The BOUNDP  predicate checks to see if <symbol> is a symbol with a value
  1483. bound to it.  T is  returned if  <symbol>  has a value, NIL is  returned
  1484. otherwise.  Note that <symbol> is a symbol  expression - it is evaluated
  1485. and the resulting expression is the one that is checked.
  1486.  
  1487. EXAMPLES
  1488.  
  1489.     (setq a 1)                ; set up A with value 1
  1490.     (boundp 'a)                ; returns T - value is 1
  1491.  
  1492.     (defun foo (x) (print x))        ; set up function FOO
  1493.     (boundp 'foo)                ; returns NIL - value is closure
  1494.     (boundp 'defvar)            ; returns NIL - value is closure
  1495.     (boundp 'car)                ; returns NIL - value is closure
  1496.  
  1497.     (print myvar)                ; error: unbound variable
  1498.     (BOUNDP 'myvar)                ; returns NIL 
  1499.     (setq myvar 'abc)            ; set up MYVAR with a value
  1500.     (BOUNDP 'myvar)                ; returns T - because of SETQ
  1501.  
  1502.     (setq myvar 'qq)            ; set up MYVAR to have value QQ
  1503.     (BOUNDP myvar)                ; returns NIL - because QQ has
  1504.                         ;               no value yet
  1505.     (setq qq 'new-value)            ; set QQ to have value NEW-VALUE
  1506.     (BOUNDP myvar)                ; returns T
  1507.  
  1508.  
  1509. break
  1510. ________________________________________________________________________
  1511.  
  1512. type: function (subr) 
  1513. location: built-in
  1514. source file: xlbfun.c  and  xldbug.c
  1515. Common LISP compatible: similar
  1516. supported on: all machines
  1517.  
  1518. SYNTAX
  1519.  
  1520. (break  [ <err-msg>  [ <arg> ] ]  )
  1521.     <err-msg>    -    a string expression for the error message
  1522.     <arg>        -    an optional expression 
  1523.  
  1524. DESCRIPTION
  1525.  
  1526. The  BREAK  function  allows  the  entry  into  the  break  loop  with a
  1527. continuable  error.  The continuable  error  generated by BREAK does not
  1528. require any corrective action.  The form of the message generated is:
  1529.  
  1530.     break: <err-msg> - <arg>
  1531.     if continued: return from BREAK
  1532.  
  1533. The default for <err-msg> is  "**BREAK**".  From within the  break-loop,
  1534. if a CONTINUE form is evaluated  then a NIL is returned  from BREAK.  If
  1535. desired, the CLEAN-UP and TOP-LEVEL  functions may be evaluated to abort
  1536. out of the break loop.
  1537.  
  1538. EXAMPLES
  1539.  
  1540.     (break)                    ; break: **BREAK**
  1541.  
  1542.     (break "out")                ; break: out
  1543.  
  1544.     (break "it" "up")            ; break: it - "up"
  1545.  
  1546. COMMON LISP COMPATIBILITY:
  1547. Common  LISP and XLISP  have the same  basic  form and style for  BREAK.
  1548. However, the <err-msg>  string in Common LISP is sent to FORMAT.  FORMAT
  1549. is a output  function that takes in format strings that include  control
  1550. information.  Although,  XLISP does have the FORMAT  function, it is not
  1551. used for error  messages.  Porting  from XLISP to Common  LISP will work
  1552. fine.  When  porting  from Common  LISP to XLISP, you will need to check
  1553. for this embedded control information in the messages.
  1554.  
  1555.  
  1556. *breakenable*
  1557. ________________________________________________________________________
  1558.  
  1559. type: system variable
  1560. location: built-in
  1561. source file: xldbug.c
  1562. Common LISP compatible: no
  1563. supported on: all machines
  1564.  
  1565. SYNTAX
  1566.  
  1567. *breakenable*
  1568.  
  1569.  
  1570. DESCRIPTION
  1571.  
  1572. *BREAKENABLE* is a system variable that controls entry to the break loop
  1573. and the  trapping  of errors.  If  *BREAKENABLE*  is set to NIL, then no
  1574. errors  from  the   system,   ERROR  and  CERROR  will  be  trapped.  If
  1575. *BREAKENABLE*  is non-NIL, the break loop will handle these errors.  The
  1576. BREAK  function is not affected by  *BREAKENABLE*  and will always force
  1577. entry  to  the  break  loop.  The  INIT.LSP   initialization  file  sets
  1578. *BREAKENABLE* to T, which allows errors to be trapped by the break loop.
  1579.  
  1580. The DEBUG function causes  *BREAKENABLE* to be set to T.  NODEBUG causes
  1581. *BREAKENABLE* to be set to NIL.
  1582.  
  1583. EXAMPLES
  1584.  
  1585.     (setq *breakenable* NIL)        ; disable break loop
  1586.     (defun foo (x) (+ x x))            ; define FOO
  1587.     (foo "a")                ; error: bad argument type 
  1588.                         ;   but did NOT enter break loop
  1589.     (setq *breakenable* T)            ; enable break loop
  1590.     (foo "a")                ; error: bad argument type 
  1591.                         ;   entered break loop
  1592.  
  1593.  
  1594. car
  1595. ________________________________________________________________________
  1596.  
  1597. type: function (subr) 
  1598. location: built-in
  1599. source file: xllist.c
  1600. Common LISP compatible: yes
  1601. supported on: all machines
  1602.  
  1603. SYNTAX
  1604.  
  1605. (car <expr> )
  1606.     <expr>        -    a list or list expression
  1607.  
  1608. DESCRIPTION
  1609.  
  1610. CAR  returns  the  first  element  of  the   expression.  If  the  first
  1611. expression  is itself a list, then the sublist is returned.  If the list
  1612. is NIL, NIL is returned.
  1613.  
  1614. EXAMPLES
  1615.     (car '(a b c))                ; returns A
  1616.     (car '((a b) c d))            ; returns (A B)
  1617.     (car NIL)                ; returns NIL
  1618.     (car 'a)                ; error: bad argument type
  1619.  
  1620.     (setq bob '(1 2 3))            ; set up variable BOB
  1621.     (car bob)                ; returns 1
  1622.  
  1623. caar cadr
  1624. ________________________________________________________________________
  1625.  
  1626. type: function (subr) 
  1627. location: built-in
  1628. source file: xllist.c
  1629. Common LISP compatible: yes
  1630. supported on: all machines
  1631.  
  1632. SYNTAX
  1633.  
  1634. (caar <expr> )
  1635. (cadr <expr> )
  1636.     <expr>        -    a list or list expression
  1637.  
  1638. DESCRIPTION
  1639.  
  1640. The CAAR and CADR functions go through the list expression and perform a
  1641. sequence of CAR/CDR operations.  The sequence of operations is performed
  1642. from right to left.  So CADR does a CDR on the expression, followed by a
  1643. CAR.  If at any point the list is NIL, NIL is returned.  If at any point
  1644. a CAR  operation is performed on an atom (as opposed to a list) an error
  1645. is reported - "error:  BAD ARGUMENT".
  1646.  
  1647. EXAMPLES
  1648.     (setq mylist '( (a1 a2)         ; make a 2-level list
  1649.             (b1 b2) 
  1650.             (c1 c2) 
  1651.             (d1 d2) ) )
  1652.     (caar mylist)                ; returns A1
  1653.     (cadr mylist)                ; returns (B1 B2)
  1654.     (cdar mylist)                ; returns (A2)
  1655.     (cddr mylist)                ; returns ((C1 C2) (D1 D2))
  1656.  
  1657.     (caar 'a)                ; error: bad argument
  1658.     (caar nil)                ; returns NIL
  1659.     (cadr nil)                ; returns NIL
  1660.     (cdar nil)                ; returns NIL
  1661.     (cddr nil)                ; returns NIL
  1662.  
  1663. caaar caadr cadar caddr 
  1664. ________________________________________________________________________
  1665.  
  1666. type: function (subr) 
  1667. location: built-in
  1668. source file: xllist.c
  1669. Common LISP compatible: yes
  1670. supported on: all machines
  1671.  
  1672. SYNTAX
  1673.  
  1674. (caaar <expr> )
  1675. (caadr <expr> )
  1676. (cadar <expr> )
  1677. (caddr <expr> )
  1678.     <expr>        -    a list or list expression
  1679.  
  1680. DESCRIPTION
  1681.  
  1682. The  CAAAR,  CAADR,  CADAR  and  CADDR  functions  go  through  the list
  1683. expression  and perform a sequence of CAR/CDR  operations.  The sequence
  1684. of operations  is performed  from right to left.  So CADDR does a CDR on
  1685. the  expression,  followed by a CDR, followed by a CAR.  If at any point
  1686. the list is NIL, NIL is  returned.  If at any point a CAR  operation  is
  1687. performed  on an atom  (as  opposed  to a list) an error is  reported  -
  1688. "error:  BAD ARGUMENT".
  1689.  
  1690. EXAMPLES
  1691.     (setq mylist '( ( (a b) (c d) (e f) )    ; make a 3-level list
  1692.                     ( (g h) (i j) (k l) )
  1693.                     ( (m n) (o p) (q r) )
  1694.                     ( (s t) (u v) (w x) )
  1695.             ) )
  1696.     (caaar mylist)                ; returns A
  1697.     (caadr mylist)                ; returns (G H)
  1698.     (cadar mylist)                ; returns (C D)
  1699.     (caddr mylist)                ; returns ((M N) (O P) (Q R))
  1700.     (cdaar mylist)                ; returns (B)
  1701.     (cdadr mylist)                ; returns ((I J) (K L))
  1702.     (cddar mylist)                ; returns ((E F))
  1703.     (cdddr mylist)                ; returns (((S T) (U V) (W X)))
  1704.  
  1705. caaaar caaadr ... caddar cadddr
  1706. ________________________________________________________________________
  1707.  
  1708. type: function (subr) 
  1709. location: built-in
  1710. source file: xllist.c
  1711. Common LISP compatible: yes
  1712. supported on: all machines
  1713.  
  1714. SYNTAX
  1715.  
  1716. (caaaar <expr> )
  1717. (caaadr <expr> )
  1718. (caadar <expr> )
  1719. ...
  1720. (caddar <expr> )
  1721. (cadddr <expr> )
  1722.     <expr>        -    a list or list expression
  1723.  
  1724. DESCRIPTION
  1725.  
  1726. The CAAAAR,  CAAADR ...  CADDAR,  CADDDR  functions  go through the list
  1727. expression  and perform a sequence of CAR/CDR  operations.  The sequence
  1728. of operations is performed  from right to left.  So CAADDR does a CDR on
  1729. the  expression,  followed  by a CDR,  followed  by a CAR,  followed  by
  1730. another  CAR.  If at any point the list is NIL, NIL is  returned.  If at
  1731. anypoint a CAR  operation is performed on an atom (as opposed to a list)
  1732. an error is reported - "error:  BAD ARGUMENT".
  1733.  
  1734. EXAMPLES
  1735.     (setq mylist '( ( (a b) (c d) (e f) )    ; make a 3-level list
  1736.                     ( (g h) (i j) (k l) )
  1737.                     ( (m n) (o p) (q r) )
  1738.                     ( (s t) (u v) (w x) )
  1739.             ) )
  1740.     (caaadr mylist)                ; returns G
  1741.     (caadar mylist)                ; returns C
  1742.     (cdadar mylist)                ; returns (D)
  1743.     (cadadr mylist)                ; returns (I J)
  1744.     (cdaddr mylist)                ; returns ((O P) (Q R))
  1745.     (cadddr mylist)                ; returns ((S T) (U V) (W X))
  1746.  
  1747. case
  1748. ________________________________________________________________________
  1749.  
  1750. type: special form (fsubr)
  1751. location: built-in
  1752. source file: xlcont.c
  1753. Common LISP compatible: similar
  1754. supported on: all machines
  1755.  
  1756. SYNTAX
  1757.  
  1758. (case  <expr>  [ ( <value> <action> ) ... ]  )
  1759.     <expr>        -    an expression
  1760.     <value>        -    an unevaluated expression or list of unevaluated
  1761.                 expressions to compare against <expr>
  1762.     <action>    -    an expression 
  1763.  
  1764. DESCRIPTION
  1765.  
  1766. The CASE  special  form is a  selection  control  form.  CASE  evaluates
  1767. <expr>.  This value is then  compared  against all the <value>  entries.
  1768. If <value> is a single  atom, the atom is compared  against  <expr>.  If
  1769. <value> is a list, each of the elements of the list are compared against
  1770. <expr>.  The <action>  associated  with the first  <value> that  matches
  1771. <expr>  is  evaluated  and  returned  as CASE's  result.  If no  <value>
  1772. matches, a NIL is returned.  If the last  <value> is the T symbol and no
  1773. other  <value> has matched  <expr>, then CASE will evaluate the <action>
  1774. associated  with T.  If there  are  multiple  T  entries,  the  first is
  1775. considered to be the end of the CASE.
  1776.  
  1777. EXAMPLES
  1778.  
  1779.     (case 'a ('a "a"))            ; returns "a"
  1780.     (case 'a ('b "b"))            ; returns NIL
  1781.     (case 9 ( 1 "num") (t "ho") (t "hi"))    ; returns "ho"
  1782.     (case 'a ((1 2 3 4) "number")        ; 
  1783.         ( (a b c d) "alpha"))        ; returns "alpha"
  1784.     
  1785.     (case 'a)                ; returns NIL
  1786.     (case)                    ; returns NIL
  1787.  
  1788.     (defun print-what (parm)        ; define a function
  1789.       (case (type-of parm)            ;  check PARM type
  1790.         ( flonum   (print "float"))    ;
  1791.         ( fixnum   (print "integer"))    ;
  1792.         ( string   (print "string"))    ;
  1793.         ( cons     (print "list"))    ;
  1794.         ( T        (print "other")))    ;  otherwise 
  1795.       NIL)                    ;  and always return NIL
  1796.     (print-what 1.2)            ; prints  "float"   returns NIL
  1797.     (print-what 3)                ; prints  "integer" returns NIL
  1798.     (print-what "ab")            ; prints  "string"  returns NIL
  1799.     (print-what '(a b))            ; prints  "list"    returns NIL
  1800.     (print-what 'a)                ; prints  "other"   returns NIL
  1801.  
  1802. NOTE:
  1803. The CASE special form does not work with a list or string as the <expr>.
  1804. This is because CASE defines the test used to be the EQL test which does
  1805. not work with lists or strings, only symbols and numbers.
  1806.  
  1807. COMMON LISP COMPATABILITY:
  1808. In XLISP, you can use the value T as the last value to get the effect of
  1809. 'otherwise'.  Common LISP uses the symbol  OTHERWISE and T for this.  If
  1810. you are  porting in code from Common  LISP, be careful to make sure T is
  1811. used instead of OTHERWISE in CASE  statements.  (Note that no error will
  1812. be generated, XLISP will just try to match the <expr> to OTHERWISE.
  1813.  
  1814.  
  1815. catch
  1816. ________________________________________________________________________
  1817.  
  1818. type: special form (fsubr)
  1819. location: built-in
  1820. source file: xlcont.c
  1821. Common LISP compatible: yes
  1822. supported on: all machines
  1823.  
  1824. SYNTAX
  1825.  
  1826. (catch  <tag-symbol>  [ <expr> ... ]  )
  1827.     <tag-symbol>    -    an expression that evaluates to a symbol
  1828.     <expr>        -    an optional series of expressions to be 
  1829.                 evaluated
  1830.  
  1831. DESCRIPTION
  1832.  
  1833. The CATCH and THROW  special  forms allow for non-local  exits and traps
  1834. without going through the intermediate evaluations and function returns.
  1835. If there is a CATCH for a <sym-tag>  that has no THROW  performed to it,
  1836. CATCH returns the value  returned from <expr>.  If there is no <expr>, a
  1837. NIL is returned.  If a THROW is evaluated with no  corresponding  CATCH,
  1838. an error is  generated  -  "error:  no  target  for  THROW".  If, in the
  1839. calling   process,   more  than  one  CATCH  is  set  up  for  the  same
  1840. <tag-symbol>, the most recently  evaluated  <tag-symbol> will be the one
  1841. that does the actual catching.
  1842.  
  1843. EXAMPLES
  1844.  
  1845.     (catch 'mytag)                ; returns NIL    - no THROW
  1846.     (catch 'mytag (+ 1 (+ 2 3)))        ; returns 6     - no THROW
  1847.     (catch 'mytag (+ 1 (throw 'mytag)))    ; returns NIL    - caught it
  1848.     (catch 'mytag (+ 1 (throw 'mytag 55)))    ; returns 55    - caught it
  1849.     (catch 'mytag (throw 'foo))        ; error: no target for THROW
  1850.  
  1851.     (defun in (x)                 ; define IN
  1852.        (if (numberp x) (+ x x)        ;   if number THEN double
  1853.                    (throw 'math 42)))    ;             ELSE throw 42
  1854.     (defun out (x)                ; define OUT
  1855.       (princ "<")                ;   
  1856.       (princ  (* (in x) 2))            ;   double via multiply
  1857.       (princ ">") "there")            ;
  1858.     (defun main (x)                ; define MAIN
  1859.       (catch 'math (out x)))        ;   with CATCH
  1860.     (in 5)                    ; returns 10
  1861.     (out 5)                    ; prints  <20>   returns "there"
  1862.     (main 5)                ; prints  <20>   returns "there"
  1863.     (main 'a)                ; prints  <     returns 42
  1864.  
  1865. NOTE:
  1866. Although  CATCH  and  THROW  will  accept a  <tag-symbol>  that is not a
  1867. symbol, it will not find this  improper  <tag-symbol>.  An error will be
  1868. generated - "error:  no target for THROW".
  1869.  
  1870.  
  1871. cdr
  1872. ________________________________________________________________________
  1873.  
  1874. type: function (subr) 
  1875. location: built-in
  1876. source file: xllist.c
  1877. Common LISP compatible: yes
  1878. supported on: all machines
  1879.  
  1880. SYNTAX
  1881.  
  1882. (cdr <expr> )
  1883.     <expr>        -    a list or list expression
  1884.  
  1885. DESCRIPTION
  1886.  
  1887. CDR returns  the  remainder  of a list or list  expression  after  first
  1888. element of the list is removed.  If the list is NIL, NIL is returned.
  1889.  
  1890. EXAMPLES
  1891.     (cdr '(a b c))                ; returns (B C)
  1892.     (cdr '((a b) c d))            ; returns (C D)
  1893.     (cdr NIL)                ; returns NIL
  1894.     (cdr 'a)                ; error: bad argument type
  1895.     (cdr '(a))                ; returns NIL
  1896.  
  1897.     (setq ben '(a b c))            ; set up variable BEN
  1898.     (cdr ben)                ; returns (B C)
  1899.  
  1900. cdar cddr
  1901. ________________________________________________________________________
  1902.  
  1903. type: function (subr) 
  1904. location: built-in
  1905. source file: xllist.c
  1906. Common LISP compatible: yes
  1907. supported on: all machines
  1908.  
  1909. SYNTAX
  1910.  
  1911. (cdar <expr> )
  1912. (cddr <expr> )
  1913.     <expr>        -    a list or list expression
  1914.  
  1915. DESCRIPTION
  1916.  
  1917. The CDAR and CDDR functions go through the list expression and perform a
  1918. sequence of CAR/CDR operations.  The sequence of operations is performed
  1919. from right to left.  So CDAR does a CAR on the expression, followed by a
  1920. CDR.  If at any point the list is NIL, NIL is returned.  If at any point
  1921. a CAR  operation is performed on an atom (as opposed to a list) an error
  1922. is reported - "error:  BAD ARGUMENT".
  1923.  
  1924. EXAMPLES
  1925.     (setq mylist '( (a1 a2)         ; make a 2-level list
  1926.             (b1 b2) 
  1927.             (c1 c2) 
  1928.             (d1 d2) ) )
  1929.     (cdar mylist)                ; returns (A2)
  1930.     (cddr mylist)                ; returns ((C1 C2) (D1 D2))
  1931.     (caar mylist)                ; returns A1
  1932.     (cadr mylist)                ; returns (B1 B2)
  1933.  
  1934.     (caar 'a)                ; error: bad argument
  1935.     (caar nil)                ; returns NIL
  1936.     (cadr nil)                ; returns NIL
  1937.     (cdar nil)                ; returns NIL
  1938.     (cddr nil)                ; returns NIL
  1939.  
  1940. cdaar cdadr cddar cdddr
  1941. ________________________________________________________________________
  1942.  
  1943. type: function (subr) 
  1944. location: built-in
  1945. source file: xllist.c
  1946. Common LISP compatible: yes
  1947. supported on: all machines
  1948.  
  1949. SYNTAX
  1950.  
  1951. (cdaar <expr> )
  1952. (cdadr <expr> )
  1953. (cddar <expr> )
  1954. (cdddr <expr> )
  1955.     <expr>        -    a list or list expression
  1956.  
  1957. DESCRIPTION
  1958.  
  1959. The  CDAAR,  CDADR,  CDDAR  and  CDDDR  functions  go  through  the list
  1960. expression  and perform a sequence of CAR/CDR  operations.  The sequence
  1961. of operations  is performed  from right to left.  So CDDAR does a CAR on
  1962. the  expression,  followed by a CDR, followed by another CDR.  If at any
  1963. point the list is NIL, NIL is returned.  If at any point a CAR operation
  1964. is  performed  on an atom (as opposed to a list) an error is  reported -
  1965. "error:  BAD ARGUMENT".
  1966.  
  1967. EXAMPLES
  1968.     (setq mylist '( ( (a b) (c d) (e f) )    ; make a 3-level list
  1969.                     ( (g h) (i j) (k l) )
  1970.                     ( (m n) (o p) (q r) )
  1971.                     ( (s t) (u v) (w x) )
  1972.             ) )
  1973.     (cdaar mylist)                ; returns (B)
  1974.     (cdadr mylist)                ; returns ((I J) (K L))
  1975.     (cddar mylist)                ; returns ((E F))
  1976.     (cdddr mylist)                ; returns (((S T) (U V) (W X)))
  1977.     (caaar mylist)                ; returns A
  1978.     (caadr mylist)                ; returns (G H)
  1979.     (cadar mylist)                ; returns (C D)
  1980.     (caddr mylist)                ; returns ((M N) (O P) (Q R))
  1981.  
  1982. cdaaar cdaadr ... cdddar cddddr
  1983. ________________________________________________________________________
  1984.  
  1985. type: function (subr) 
  1986. location: built-in
  1987. source file: xllist.c
  1988. Common LISP compatible: yes
  1989. supported on: all machines
  1990.  
  1991. SYNTAX
  1992.  
  1993. (cdaaar <expr> )
  1994. (cdaadr <expr> )
  1995. ...
  1996. (cdddar <expr> )
  1997. (cddddr <expr> )
  1998.     <expr>        -    a list or list expression
  1999.  
  2000. DESCRIPTION
  2001.  
  2002. The CDAAAR,  CDAADR ....  CDDDAR,  CDDDDR  functions go through the list
  2003. expression  and perform a sequence of CAR/CDR  operations.  The sequence
  2004. of operations is performed  from right to left.  So CDDAAR does a CAR on
  2005. the  expression,  followed  by a CAR,  followed  by a CDR,  followed  by
  2006. another  CDR.  If at any point the list is NIL, NIL is  returned.  If at
  2007. anypoint a CAR  operation is performed on an atom (as opposed to a list)
  2008. an error is reported - "error:  BAD ARGUMENT".
  2009.  
  2010. EXAMPLES
  2011.     (setq mylist '( ( (a b) (c d) (e f) )    ; make a 3-level list
  2012.                     ( (g h) (i j) (k l) )
  2013.                     ( (m n) (o p) (q r) )
  2014.                     ( (s t) (u v) (w x) )
  2015.             ) )
  2016.     (cdadar mylist)                ; returns (D)
  2017.     (cdaddr mylist)                ; returns ((O P) (Q R))
  2018.     (caaadr mylist)                ; returns G
  2019.     (cadadr mylist)                ; returns (I J)
  2020.     (caadar mylist)                ; returns C
  2021.     (cadddr mylist)                ; returns ((S T) (U V) (W X))
  2022.  
  2023. cerror
  2024. ________________________________________________________________________
  2025.  
  2026. type: function (subr) 
  2027. location: built-in
  2028. source file: xlbfun.c  and  xldbug.c
  2029. Common LISP compatible: similar
  2030. supported on: all machines
  2031.  
  2032. SYNTAX
  2033.  
  2034. (cerror  <cont-msg> <err-msg>  [ <arg> ] )
  2035.     <cont-msg>    -    a string expression for the continue message
  2036.     <err-msg>    -    a string expression for the error message
  2037.     <arg>        -    an optional expression 
  2038.  
  2039. DESCRIPTION
  2040.  
  2041. The CERROR  function  allows the  generation of a continuable  error.  A
  2042. continuable error is one that can be corrected by some action within the
  2043. XLISP break loop.  The form of the message generated is:
  2044.  
  2045.     error: <err-msg> - <arg>
  2046.     if continued: <cont-msg>    
  2047.  
  2048. From within the  break-loop,  if a CONTINUE form is evaluated then a NIL
  2049. is  returned  from  CERROR.  From  within the break  loop,  forms can be
  2050. evaluated to correct the error.  If desired, the CLEAN-UP and  TOP-LEVEL
  2051. forms may be evaluated to abort out of the break loop.
  2052.  
  2053. EXAMPLES
  2054.  
  2055.     (cerror "fee" "fi" "fo")        ; CERROR generates the message -
  2056.                         ; error: fi - "fo"
  2057.                         ; if continued: fee
  2058.  
  2059.     (cerror "I will do better"         ; CERROR generates the message -
  2060.         "There's a problem, Dave")    ;
  2061.                         ; error: There's a problem, Dave
  2062.                         ; if continued: I will do better
  2063.  
  2064.                         ; example of system generated
  2065.                         ; correctable error -
  2066.     (symbol-value 'f)            ; error: unbound variable - F
  2067.                         ; if continued: 
  2068.                         ;   try evaluating symbol again
  2069.  
  2070. COMMON LISP COMPATIBILITY:
  2071. Common  LISP and XLISP  have the same  basic form and style for  CERROR.
  2072. However, the <err-msg> and  <cont-msg>  string in Common LISP is sent to
  2073. FORMAT.  FORMAT is a output  function that takes in format  strings that
  2074. include  control  information.  Although,  XLISP  does  have the  FORMAT
  2075. function,  it does not print  the  CERROR  <err-msg>  with  FORMAT.  So,
  2076. Porting  from XLISP to Common  LISP will work fine.  When  porting  from
  2077. Common LISP to XLISP, you will need to check for this  embedded  control
  2078. information in the error messages.
  2079.  
  2080. NOTE:
  2081. In the XLISP system, the only correctable  system errors have to do with
  2082. the value of a symbol being  unbound.  In these cases, you can do a SETQ
  2083. or SET from within the break loop and then CONTINUE.
  2084.  
  2085. NOTE:
  2086. Remember  that  *BREAKENABLE*  needs to non-NIL for ERROR and CERROR and
  2087. system  errors  to be  caught  by  the  normal  system  break  loop.  If
  2088. *BREAKENABLE*  is NIL, ERROR and CERROR and system  errors can be caught
  2089. by an ERRSET form.  If there is no surrounding  ERRSET, no error message
  2090. is generated and the break loop is not entered.
  2091.  
  2092.  
  2093. char
  2094. ________________________________________________________________________
  2095.  
  2096. type: function (subr) 
  2097. location: built-in
  2098. source file: xlstr.c
  2099. Common LISP compatible: yes
  2100. supported on: all machines
  2101.  
  2102. SYNTAX
  2103.  
  2104. (char <string> <position> )
  2105.     <string>    -    a string expression
  2106.     <position>    -    an integer expression
  2107.  
  2108. DESCRIPTION
  2109.  
  2110. The CHAR  function  returns the ASCII  numeric value of the character at
  2111. the  specified  <position>  in the  <string>.  A <position>  of 0 is the
  2112. first character in the string.
  2113.  
  2114. EXAMPLES
  2115.  
  2116.     (char "12345" 0)            ; returns #\1
  2117.     (char "12 45" 2)            ; returns #\Space
  2118.  
  2119.     (string (char "1234" 3))        ; returns "4"
  2120.     (char "1234" 9)                ; error: index out of range
  2121.  
  2122.  
  2123. char/=
  2124. ________________________________________________________________________
  2125.  
  2126. type: function (subr) 
  2127. location: built-in
  2128. source file: xlstr.c
  2129. Common LISP compatible: yes
  2130. supported on: all machines
  2131.  
  2132. SYNTAX
  2133.  
  2134. (char/= <char1> <charN> ... )
  2135.     <char1>        -    a character expression
  2136.     <charN>        -    character expression(s) to compare
  2137.  
  2138. DESCRIPTION
  2139.  
  2140. The CHAR/=  (character-NOT-EQUAL)  function  takes one or more character
  2141. arguments.  It  checks  to  see  if  all  the  character  arguments  are
  2142. different values.  T is returned if the arguments are of different ASCII
  2143. value.  In the case of two arguments,  this has the effect of testing if
  2144. <char1>  is not  equal to  <char2>.  This test is case  sensitive  - the
  2145. character #\a is different (and of greater ASCII value) than #\A.
  2146.  
  2147. EXAMPLES
  2148.  
  2149.     (char/= #\a #\b)            ; returns T
  2150.     (char/= #\a #\b #\c)            ; returns T
  2151.     (char/= #\a #\a)            ; returns NIL 
  2152.     (char/= #\a #\b #\b)            ; returns NIL
  2153.     (char/= #\A #\a)            ; returns T
  2154.     (char/= #\a #\A)            ; returns T
  2155.  
  2156. NOTE:
  2157. Be sure that the CHAR/=  function  is  properly  typed in.  The '/' is a
  2158. forward  slash.  It is possible to  mistakenly  type a '\'  (backslash).
  2159. This is especially  easy because the  character  mechanism is '#\a'.  If
  2160. you do use the backslash, no error will be reported because backslash is
  2161. the single escape  character and the LISP reader will evaluate  'CHAR\='
  2162. as  'CHAR='.  No error  will be  reported,  but the sense of the test is
  2163. reversed.
  2164.  
  2165.  
  2166. char<
  2167. ________________________________________________________________________
  2168.  
  2169. type: function (subr) 
  2170. location: built-in
  2171. source file: xlstr.c
  2172. Common LISP compatible: yes
  2173. supported on: all machines
  2174.  
  2175. SYNTAX
  2176.  
  2177. (char< <char1> <charN> ... )
  2178.     <char1>        -    a character expression
  2179.     <charN>        -    character expression(s) to compare
  2180.  
  2181. DESCRIPTION
  2182.  
  2183. The CHAR<  (character-LESS-THAN)  function  takes one or more  character
  2184. arguments.  It  checks  to  see  if  all  the  character  arguments  are
  2185. monotonically  increasing.  T  is  returned  if  the  arguments  are  of
  2186. increasing  ASCII  value.  In the case of two  arguments,  this  has the
  2187. effect of testing  if <char1>  is less than  <char2>.  This test is case
  2188. sensitive - the character #\a is different  (and of greater ASCII value)
  2189. than #\A.
  2190.  
  2191. EXAMPLES
  2192.  
  2193.     (char< #\a #\b)                ; returns T
  2194.     (char< #\b #\a)                ; returns NIL
  2195.     (char< #\a #\b #\c)            ; returns T
  2196.     (char< #\a #\a)                ; returns NIL 
  2197.     (char< #\a #\b #\b)            ; returns NIL
  2198.     (char< #\A #\a)                ; returns T
  2199.     (char< #\a #\A)                ; returns NIL
  2200.  
  2201.  
  2202. char<=
  2203. ________________________________________________________________________
  2204.  
  2205. type: function (subr) 
  2206. location: built-in
  2207. source file: xlstr.c
  2208. Common LISP compatible: yes
  2209. supported on: all machines
  2210.  
  2211. SYNTAX
  2212.  
  2213. (char<= <char1> <charN> ... )
  2214.     <char1>        -    a character expression
  2215.     <charN>        -    character expression(s) to compare
  2216.  
  2217. DESCRIPTION
  2218.  
  2219. The  CHAR<=  (character-LESS-THAN-OR-EQUAL)  function  takes one or more
  2220. character  arguments.  It checks to see if all the  character  arguments
  2221. are monotonically non-decreasing.  T is returned if the arguments are of
  2222. non-decreasing  ASCII value.  In the case of two arguments, this has the
  2223. effect of  testing  if  <char1> is less than or equal to  <char2>.  This
  2224. test is case  sensitive - the character #\a is different (and of greater
  2225. ASCII value) than #\A.
  2226.  
  2227. EXAMPLES
  2228.  
  2229.     (char<= #\a #\b)            ; returns T
  2230.     (char<= #\b #\a)            ; returns NIL
  2231.     (char<= #\a #\b #\c)            ; returns T
  2232.     (char<= #\a #\a)            ; returns T 
  2233.     (char<= #\a #\b #\b)            ; returns T
  2234.     (char<= #\A #\a)            ; returns T
  2235.     (char<= #\a #\A)            ; returns NIL
  2236.  
  2237.  
  2238. char=
  2239. ________________________________________________________________________
  2240.  
  2241. type: function (subr) 
  2242. location: built-in
  2243. source file: xlstr.c
  2244. Common LISP compatible: yes
  2245. supported on: all machines
  2246.  
  2247. SYNTAX
  2248.  
  2249. (char= <char1> <charN> ... )
  2250.     <char1>        -    a character expression
  2251.     <charN>        -    character expression(s) to compare
  2252.  
  2253. DESCRIPTION
  2254.  
  2255. The CHAR=  (character-EQUALITY)  function  takes  one or more  character
  2256. arguments.  It  checks  to  see  if  all  the  character  arguments  are
  2257. equivalent.  T is returned if the arguments are of the same ASCII value.
  2258. In the case of two arguments,  this has the effect of testing if <char1>
  2259. is equal to <char2>.  This test is case sensitive - the character #\a is
  2260. different (and of greater ASCII value) than #\A.
  2261.  
  2262. EXAMPLES
  2263.  
  2264.     (char= #\a #\b)                ; returns NIL
  2265.     (char= #\b #\a)                ; returns NIL
  2266.     (char= #\a #\b #\c)            ; returns NIL
  2267.     (char= #\a #\a)                ; returns T 
  2268.     (char= #\a #\a #\a)            ; returns T 
  2269.     (char= #\a #\a #\b)            ; returns NIL
  2270.     (char= #\A #\a)                ; returns NIL
  2271.     (char= #\a #\A)                ; returns NIL
  2272.  
  2273.  
  2274. char>
  2275. ________________________________________________________________________
  2276.  
  2277. type: function (subr) 
  2278. location: built-in
  2279. source file: xlstr.c
  2280. Common LISP compatible: yes
  2281. supported on: all machines
  2282.  
  2283. SYNTAX
  2284.  
  2285. (char> <char1> <charN> ... )
  2286.     <char1>        -    a character expression
  2287.     <charN>        -    character expression(s) to compare
  2288.  
  2289. DESCRIPTION
  2290.  
  2291. The CHAR> (character-GREATER-THAN)  function takes one or more character
  2292. arguments.  It  checks  to  see  if  all  the  character  arguments  are
  2293. monotonically  decreasing.  T  is  returned  if  the  arguments  are  of
  2294. monotonically  decreasing  ASCII  value.  In the case of two  arguments,
  2295. this has the effect of testing if <char1> is greater than <char2>.  This
  2296. test is case  sensitive - the character #\a is different (and of greater
  2297. ASCII value) than #\A.
  2298.  
  2299. EXAMPLES
  2300.  
  2301.     (char> #\a #\b)                ; returns NIL
  2302.     (char> #\b #\a)                ; returns T
  2303.     (char> #\c #\b #\a)            ; returns T
  2304.     (char> #\a #\a)                ; returns NIL 
  2305.     (char> #\c #\a #\b)            ; returns NIL
  2306.     (char> #\A #\a)                ; returns NIL
  2307.     (char> #\a #\A)                ; returns T
  2308.  
  2309.  
  2310. char>=
  2311. ________________________________________________________________________
  2312.  
  2313. type: function (subr) 
  2314. location: built-in
  2315. source file: xlstr.c
  2316. Common LISP compatible: yes
  2317. supported on: all machines
  2318.  
  2319. SYNTAX
  2320.  
  2321. (char>= <char1> <charN> ... )
  2322.     <char1>        -    a character expression
  2323.     <charN>        -    character expression(s) to compare
  2324.  
  2325. DESCRIPTION
  2326.  
  2327. The CHAR>= (character-GREATER-THAN-OR-EQUAL)  function takes one or more
  2328. character  arguments.  It checks to see if all the  character  arguments
  2329. are monotonically non-increasing.  T is returned if the arguments are of
  2330. monotonically non-increasing ASCII value.  In the case of two arguments,
  2331. this has the  effect of testing  if <char1> is greater  than or equal to
  2332. <char2>.  This test is case  sensitive - the  character #\a is different
  2333. (and of greater ASCII value) than #\A.
  2334.  
  2335. EXAMPLES
  2336.  
  2337.     (char>= #\a #\b)            ; returns NIL
  2338.     (char>= #\b #\a)            ; returns T
  2339.     (char>= #\c #\b #\a)            ; returns T
  2340.     (char>= #\a #\a)            ; returns T 
  2341.     (char>= #\c #\a #\b)            ; returns NIL
  2342.     (char>= #\A #\a)            ; returns NIL
  2343.     (char>= #\a #\A)            ; returns T
  2344.  
  2345.  
  2346. characterp
  2347. ________________________________________________________________________
  2348.  
  2349. type: predicate function (subr)
  2350. location: built-in
  2351. source file: xlbfun.c
  2352. Common LISP compatible: yes
  2353. supported on: all machines
  2354.  
  2355. SYNTAX
  2356.  
  2357. (characterp <expr> )
  2358.     <expr>        -    the expression to check
  2359.  
  2360. DESCRIPTION
  2361.  
  2362. The  CHARACTERP  predicate  checks if an  <expr>  is a  character.  T is
  2363. returned if <expr> is a character, NIL is returned otherwise.
  2364.  
  2365. EXAMPLES
  2366.  
  2367.     (characterp #\a)            ; returns T - character
  2368.     (setq a #\b)                ; 
  2369.     (characterp a)                ; returns T - evaluates to char
  2370.  
  2371.     (characterp "a")            ; returns NIL - string
  2372.     (characterp '(a b c))            ; returns NIL - list
  2373.     (characterp 1)                ; returns NIL - integer
  2374.     (characterp 1.2)            ; returns NIL - float
  2375.     (characterp 'a)                ; returns NIL - symbol
  2376.     (characterp #(0 1 2))            ; returns NIL - array 
  2377.     (characterp NIL)            ; returns NIL - NIL
  2378.  
  2379.  
  2380. char-code
  2381. ________________________________________________________________________
  2382.  
  2383. type: function (subr) 
  2384. location: built-in
  2385. source file: xlstr.c 
  2386. Common LISP compatible: similar
  2387. versions: all machines
  2388.  
  2389. SYNTAX
  2390.  
  2391. (char-code <char> )
  2392.     <char>        -    a character expression
  2393.  
  2394. DESCRIPTION
  2395.  
  2396. The CHAR-CODE function returns the value of the <char> expression.
  2397.  
  2398. EXAMPLES
  2399.  
  2400.     (char-code #\0)                ; returns 48
  2401.     (char-code #\A)                ; returns 65
  2402.     (char-code #\a)                ; returns 97
  2403.     (char-code #\[)                ; returns 91
  2404.     (char-code #\newline)            ; returns 10
  2405.  
  2406.     (char-code (code-char 127))        ; returns 127
  2407.     (char-code (int-char 255))        ; returns 255
  2408.  
  2409. COMMON LISP COMPATABILITY:
  2410. Common LISP supports the concept of a complex  character  that  includes
  2411. not only the ASCII code  value, but also fonts and bits.  The bits allow
  2412. for more  than 8 bits per  character  (16 bits is  especially  useful in
  2413. oriental  languages).  The fonts  allow for up to 128  different  fonts.
  2414. This is  interesting  and neat stuff,  however,  XLISP does not  support
  2415. fonts and bits.
  2416.  
  2417. NOTE:
  2418. Because  XLISP does not  support  fonts and bits (as  discussed  above),
  2419. CHAR-CODE and CHAR-INT are identical in use.
  2420.  
  2421.  
  2422. char-downcase
  2423. ________________________________________________________________________
  2424.  
  2425. type: function (subr) 
  2426. location: built-in
  2427. source file: xlstr.c 
  2428. Common LISP compatible: yes
  2429. versions: all machines
  2430.  
  2431. SYNTAX
  2432.  
  2433. (char-downcase <char> )
  2434.     <char>        -    a character expression
  2435.  
  2436. DESCRIPTION
  2437.  
  2438. The CHAR-DOWNCASE function converts the <char> expression to lower case.
  2439. The lower case  equivalent  of <char> is returned.  If the <char> is not
  2440. alphabetic  ('a' thru 'z' or 'A' thru 'Z'), the  character  is  returned
  2441. unchanged.
  2442.  
  2443. EXAMPLES
  2444.  
  2445.     (char-downcase #\0)            ; returns #\0
  2446.     (char-downcase #\A)            ; returns #\a
  2447.     (char-downcase #\a)            ; returns #\a
  2448.     (char-downcase #\[)            ; returns #\[
  2449.     (char-downcase #\+)            ; returns #\+
  2450.  
  2451.  
  2452. char-equal
  2453. ________________________________________________________________________
  2454.  
  2455. type: function (subr) 
  2456. location: built-in
  2457. source file: xlstr.c
  2458. Common LISP compatible: yes
  2459. supported on: all machines
  2460.  
  2461. SYNTAX
  2462.  
  2463. (char-equal <char1> <charN> ... )
  2464.     <char1>        -    a character expression
  2465.     <charN>        -    character expression(s) to compare
  2466.  
  2467. DESCRIPTION
  2468.  
  2469. The  CHAR-EQUAL  function  takes  one or more  character  arguments.  It
  2470. checks  to see if all  the  character  arguments  are  equivalent.  T is
  2471. returned if the  arguments  are of the same ASCII value.  In the case of
  2472. two  arguments,  this has the effect of testing if  <char1>  is equal to
  2473. <char2>.  This  test  is  case   insensitive  -  the  character  #\a  is
  2474. considered to be the same ASCII value as #\A.
  2475.  
  2476. EXAMPLES
  2477.  
  2478.     (char-equal #\a #\b)            ; returns NIL
  2479.     (char-equal #\b #\a)            ; returns NIL
  2480.     (char-equal #\a #\b #\c)        ; returns NIL
  2481.     (char-equal #\a #\a)            ; returns T 
  2482.     (char-equal #\a #\a #\a)        ; returns T 
  2483.     (char-equal #\a #\a #\b)        ; returns NIL
  2484.     (char-equal #\A #\a)            ; returns T
  2485.     (char-equal #\a #\A)            ; returns T
  2486.  
  2487. NOTE:
  2488. The CHAR-EQUAL function is listed in the documentation that
  2489. comes with XLISP as CHAR-EQUALP.
  2490.  
  2491.  
  2492. char-greaterp
  2493. ________________________________________________________________________
  2494.  
  2495. type: predicate function (subr) 
  2496. location: built-in
  2497. source file: xlstr.c
  2498. Common LISP compatible: yes
  2499. supported on: all machines
  2500.  
  2501. SYNTAX
  2502.  
  2503. (char-greaterp <char1> <charN> ... )
  2504.     <char1>        -    a character expression
  2505.     <charN>        -    character expression(s) to compare
  2506.  
  2507. DESCRIPTION
  2508.  
  2509. The  CHAR-GREATERP  function takes one or more character  arguments.  It
  2510. checks  to  see  if  all  the  character   arguments  are  monotonically
  2511. decreasing.  T  is  returned  if  the  arguments  are  of  monotonically
  2512. decreasing  ASCII  value.  In the case of two  arguments,  this  has the
  2513. effect of testing if <char1> is greater than <char2>.  This test is case
  2514. insensitive - the character #\a is considered to be the same ASCII value
  2515. as #\A.
  2516.  
  2517. EXAMPLES
  2518.  
  2519.     (char-greaterp #\a #\b)            ; returns NIL
  2520.     (char-greaterp #\b #\a)            ; returns T
  2521.     (char-greaterp #\c #\b #\a)        ; returns T
  2522.     (char-greaterp #\a #\a)            ; returns NIL 
  2523.     (char-greaterp #\c #\a #\b)        ; returns NIL
  2524.     (char-greaterp #\A #\a)            ; returns NIL
  2525.     (char-greaterp #\a #\A)            ; returns NIL
  2526.  
  2527.  
  2528. char-int
  2529. ________________________________________________________________________
  2530.  
  2531. type: function (subr) 
  2532. location: built-in
  2533. source file: xlstr.c 
  2534. Common LISP compatible: yes
  2535. versions: all machines
  2536.  
  2537. SYNTAX
  2538.  
  2539. (char-int <char> )
  2540.     <char>        -    a character expression
  2541.  
  2542. DESCRIPTION
  2543.  
  2544. The CHAR-INT function returns the ASCII value of the <char> expression.
  2545.  
  2546. EXAMPLES
  2547.  
  2548.     (char-int #\0)                ; returns 48
  2549.     (char-int #\A)                ; returns 65
  2550.     (char-int #\a)                ; returns 97
  2551.     (char-int #\[)                ; returns 91
  2552.     (char-int #\newline)            ; returns 10
  2553.  
  2554.     (char-int (code-char 127))        ; returns 127
  2555.     (char-int (int-char 255))        ; returns 255
  2556.  
  2557. NOTE:
  2558. CHAR-CODE  and  CHAR-INT  are  identical  in  use.  See   CHAR-CODE  for
  2559. additional information.
  2560.  
  2561.  
  2562. char-lessp
  2563. ________________________________________________________________________
  2564.  
  2565. type: predicate function (subr) 
  2566. location: built-in
  2567. source file: xlstr.c
  2568. Common LISP compatible: yes
  2569. supported on: all machines
  2570.  
  2571. SYNTAX
  2572.  
  2573. (char-lessp <char1> <charN> ... )
  2574.     <char1>        -    a character expression
  2575.     <charN>        -    character expression(s) to compare
  2576.  
  2577. DESCRIPTION
  2578.  
  2579. The  CHAR-LESSP  function  takes  one or more  character  arguments.  It
  2580. checks  to  see  if  all  the  character   arguments  are  monotonically
  2581. increasing.  T is  returned if the  arguments  are of  increasing  ASCII
  2582. value.  In the case of two arguments,  this has the effect of testing if
  2583. <char1>  is less  than  <char2>.  This  test is case  insensitive  - the
  2584. character #\a is considered to be the same ASCII value as #\A.
  2585.  
  2586. EXAMPLES
  2587.  
  2588.     (char-lessp #\a #\b)            ; returns T
  2589.     (char-lessp #\b #\a)            ; returns NIL
  2590.     (char-lessp #\a #\b #\c)        ; returns T
  2591.     (char-lessp #\a #\a)            ; returns NIL 
  2592.     (char-lessp #\a #\b #\b)        ; returns NIL
  2593.     (char-lessp #\A #\a)            ; returns NIL
  2594.     (char-lessp #\a #\A)            ; returns NIL
  2595.  
  2596.  
  2597. char-not-equal
  2598. ________________________________________________________________________
  2599.  
  2600. type: function (subr) 
  2601. location: built-in
  2602. source file: xlstr.c
  2603. Common LISP compatible: yes
  2604. supported on: all machines
  2605.  
  2606. SYNTAX
  2607.  
  2608. (char-not-equal <char1> <charN> ... )
  2609.     <char1>        -    a character expression
  2610.     <charN>        -    character expression(s) to compare
  2611.  
  2612. DESCRIPTION
  2613.  
  2614. The CHAR-NOT-EQUAL  function takes one or more character  arguments.  It
  2615. checks to see if all the character arguments are different values.  T is
  2616. returned if the arguments are of different  ASCII value.  In the case of
  2617. two arguments, this has the effect of testing if <char1> is not equal to
  2618. <char2>.  This  test  is  case   insensitive  -  the  character  #\a  is
  2619. considered to be the same ASCII value as #\A.
  2620.  
  2621. EXAMPLES
  2622.  
  2623.     (char-not-equal #\a #\b)        ; returns T
  2624.     (char-not-equal #\a #\b #\c)        ; returns T
  2625.     (char-not-equal #\a #\a)        ; returns NIL 
  2626.     (char-not-equal #\a #\b #\b)        ; returns NIL
  2627.     (char-not-equal #\A #\a)        ; returns NIL
  2628.     (char-not-equal #\a #\A)        ; returns NIL
  2629.  
  2630. NOTE:
  2631. The  CHAR-NOT-EQUAL  function is listed in the documentation  that comes
  2632. with XLISP as  CHAR-NOT-EQUALP.  It functions properly in the XLISP code
  2633. as CHAR-NOT-EQUAL.
  2634.  
  2635.  
  2636. char-not-greaterp
  2637. ________________________________________________________________________
  2638.  
  2639. type: predicate function (subr) 
  2640. location: built-in
  2641. source file: xlstr.c
  2642. Common LISP compatible: yes
  2643. supported on: all machines
  2644.  
  2645. SYNTAX
  2646.  
  2647. (char-not-greaterp <char1> <charN> ... )
  2648.     <char1>        -    a character expression
  2649.     <charN>        -    character expression(s) to compare
  2650.  
  2651. DESCRIPTION
  2652.  
  2653. The  CHAR-NOT-GREATERP  function takes one or more character  arguments.
  2654. It  checks  to see if all  the  character  arguments  are  monotonically
  2655. non-decreasing.  T is returned if the  arguments  are of  non-decreasing
  2656. ASCII  value.  In the case of two  arguments,  this  has the  effect  of
  2657. testing if <char1> is less than or equal to  <char2>.  This test is case
  2658. insensitive - the character #\a is considered to be the same ASCII value
  2659. as #\A.
  2660.  
  2661. EXAMPLES
  2662.  
  2663.     (char-not-greaterp #\a #\b)        ; returns T
  2664.     (char-not-greaterp #\b #\a)        ; returns NIL
  2665.     (char-not-greaterp #\a #\b #\c)        ; returns T
  2666.     (char-not-greaterp #\a #\a)        ; returns T 
  2667.     (char-not-greaterp #\a #\b #\b)        ; returns T
  2668.     (char-not-greaterp #\A #\a)        ; returns T
  2669.     (char-not-greaterp #\a #\A)        ; returns T
  2670.  
  2671.  
  2672. char-not-lessp
  2673. ________________________________________________________________________
  2674.  
  2675. type: predicate function (subr) 
  2676. location: built-in
  2677. source file: xlstr.c
  2678. Common LISP compatible: yes
  2679. supported on: all machines
  2680.  
  2681. SYNTAX
  2682.  
  2683. (char-not-lessp <char1> <charN> ... )
  2684.     <char1>        -    a character expression
  2685.     <charN>        -    character expression(s) to compare
  2686.  
  2687. DESCRIPTION
  2688.  
  2689. The CHAR-NOT-LESSP  function takes one or more character  arguments.  It
  2690. checks  to  see  if  all  the  character   arguments  are  monotonically
  2691. non-increasing.  T is  returned if the  arguments  are of  monotonically
  2692. non-increasing  ASCII value.  In the case of two arguments, this has the
  2693. effect of testing if <char1> is greater  than or equal to <char2>.  This
  2694. test is case  insensitive - the  character #\a is  considered  to be the
  2695. same ASCII value as #\A.
  2696.  
  2697. EXAMPLES
  2698.  
  2699.     (char-not-lessp #\a #\b)        ; returns NIL
  2700.     (char-not-lessp #\b #\a)        ; returns T
  2701.     (char-not-lessp #\c #\b #\a)        ; returns T
  2702.     (char-not-lessp #\a #\a)        ; returns T 
  2703.     (char-not-lessp #\c #\a #\b)        ; returns NIL
  2704.     (char-not-lessp #\A #\a)        ; returns T
  2705.     (char-not-lessp #\a #\A)        ; returns T
  2706.  
  2707.  
  2708. char-upcase
  2709. ________________________________________________________________________
  2710.  
  2711. type: function (subr) 
  2712. location: built-in
  2713. source file: xlstr.c 
  2714. Common LISP compatible: yes
  2715. versions: all machines
  2716.  
  2717. SYNTAX
  2718.  
  2719. (char-upcase <char> )
  2720.     <char>        -    a character expression
  2721.  
  2722. DESCRIPTION
  2723.  
  2724. The CHAR-UPCASE  function converts the <char>  expression to upper case.
  2725. The upper case  equivalent  of <char> is returned.  If the <char> is not
  2726. alphabetic  ('a' thru 'z' or 'A' thru 'Z'), the  character  is  returned
  2727. unchanged.
  2728.  
  2729. EXAMPLES
  2730.  
  2731.     (char-upcase #\0)            ; returns #\0
  2732.     (char-upcase #\A)            ; returns #\A
  2733.     (char-upcase #\a)            ; returns #\A
  2734.     (char-upcase #\[)            ; returns #\[
  2735.     (char-upcase #\+)            ; returns #\+
  2736.  
  2737.  
  2738. class
  2739. ________________________________________________________________________
  2740.  
  2741. type: object
  2742. location: built-in
  2743. source file: xlobj.c
  2744. Common LISP compatible: no
  2745. supported on: all machines
  2746.  
  2747. SYNTAX
  2748.  
  2749. class 
  2750.  
  2751.  
  2752. DESCRIPTION
  2753.  
  2754. CLASS is the built-in  object class that is used to build other classes.
  2755. Classes are, essentially, the template for defining object instances.
  2756.  
  2757. EXAMPLES
  2758.     (setq myclass (send class :new '(var)))    ; create MYCLASS with VAR
  2759.     (send myclass :answer :isnew '()    ; set up initialization
  2760.         '((setq var nil) self))
  2761.     (send myclass :answer :set-it '(value)    ; create :SET-IT message
  2762.         '((setq var value)))    
  2763.     (setq my-obj (send myclass :new))    ; create MY-OBJ of MYCLASS
  2764.     (send my-obj :set-it 5)            ; VAR is set to 5
  2765.  
  2766. CLASS DEFINITION:
  2767. The internal definition of the CLASS object instance looks like:
  2768.  
  2769.     Object is #<Object: #23fe2>, Class is #<Object: #23fe2>
  2770.       MESSAGES = ((:ANSWER . #<Subr-: #23e48>) 
  2771.                 (:ISNEW . #<Subr-: #23e84>) 
  2772.               (:NEW . #<Subr-: #23ea2>))
  2773.       IVARS = (MESSAGES IVARS CVARS CVALS SUPERCLASS IVARCNT IVARTOTAL)
  2774.       CVARS = NIL
  2775.       CVALS = NIL
  2776.       SUPERCLASS = #<Object: #23fd8>
  2777.       IVARCNT = 7
  2778.       IVARTOTAL = 7
  2779.     #<Object: #23fe2>
  2780.  
  2781. The class of CLASS is CLASS, itself.  The superclass of CLASS is OBJECT.
  2782. Remember that the location  information (like #23fe2) varies from system
  2783. to system, yours will probably look different.
  2784.  
  2785. BUILT-IN METHODS:
  2786. The built in methods in XLISP include:
  2787.  
  2788.         <message>    operation
  2789.         -------------------------------------------------------
  2790.         :ANSWER        Add a method to an object.
  2791.         :CLASS        Return the object's class.
  2792.         :ISNEW        Run initialization code on object.
  2793.         :NEW        Create a new object (instance or class).
  2794.         :SHOW        Show the internal state of the object.
  2795.  
  2796. MESSAGE STRUCTURE:
  2797. The normal XLISP  convention  for a <message> is to have a valid  symbol
  2798. preceeded  by a  colon  like  :ISNEW  or  :MY-MESSAGE.  However,  it  is
  2799. possible  to define a  <message>  that is a symbol  without a colon, but
  2800. this makes the code less readable.
  2801.  
  2802.  
  2803. :class
  2804. ________________________________________________________________________
  2805.  
  2806. type: message selector
  2807. location: built-in
  2808. source file: xlobj.c
  2809. Common LISP compatible: no
  2810. supported on: all machines
  2811.  
  2812. SYNTAX
  2813.  
  2814. (send <object> :class)
  2815.     <object>    -    an existing object
  2816.  
  2817. DESCRIPTION
  2818.  
  2819. The :CLASS message  selector will cause a method to run that will return
  2820. the object which is the class of the specified  <object>.  Note that the
  2821. returned  value is an object which will look like  "#<Object:  #18d8c>".
  2822. The  <object>  must exist or an error will be  generated  - "error:  bad
  2823. argument type".
  2824.  
  2825. EXAMPLES
  2826.     (send object :class)            ; returns the CLASS object
  2827.     (send class :class)            ; returns the CLASS object
  2828.     (setq new-cls (send class :new '(var)))    ; create NEW-CLS
  2829.     (setq new-obj (send new-cls :new))    ; create NEW-OBJ of NEW-CLS
  2830.     (send new-obj :class)            ; returns the NEW-CLS object
  2831.     (send new-cls :class)            ; returns the CLASS object
  2832.  
  2833. clean-up
  2834. ________________________________________________________________________
  2835.  
  2836. type: function (subr) 
  2837. location: built-in
  2838. source file: xlbfun.c  and  xldbug.c
  2839. Common LISP compatible: no
  2840. supported on: all machines
  2841.  
  2842. SYNTAX
  2843.  
  2844. (clean-up)
  2845.  
  2846.  
  2847. DESCRIPTION
  2848.  
  2849. The CLEAN-UP function aborts one level of the break loop.  This is valid
  2850. for BREAKs,  ERRORs and CERRORs  (continuable  errors).  If CLEAN-UP  is
  2851. evaluated  while not in a break  loop, an error is  generated  - "error:
  2852. not in a break  loop".  This  error  does not  cause  XLISP to go into a
  2853. break loop.  CLEAN-UP never actually returns a value.
  2854.  
  2855. EXAMPLES
  2856.  
  2857.     (clean-up)                ; [back to previous break level]
  2858.  
  2859.     (break "out")                ; break: out
  2860.     (clean-up)                ; to exit out of break loop 
  2861.  
  2862. KEYSTROKE EQUIVALENT:
  2863. In the IBM PC and MS-DOS  versions of XLISP, a CTRL-g key  sequence  has
  2864. the same  effect  as doing a  (CLEAN-UP).  On a  Macintosh,  this can be
  2865. accomplished by a pull-down menu or a COMMAND-g.
  2866.  
  2867.  
  2868. close
  2869. ________________________________________________________________________
  2870.  
  2871. type: function (subr) 
  2872. location: built-in
  2873. source file: xlfio.c
  2874. Common LISP compatible: similar
  2875. supported on: all machines
  2876.  
  2877. SYNTAX
  2878.  
  2879. (close  <file-ptr> )
  2880.     <file-ptr>    -    a file pointer expression 
  2881.  
  2882. DESCRIPTION
  2883.  
  2884. The CLOSE function closes the file specified through <file-ptr>.  If the
  2885. file close was  successful,  then a NIL is returned as the  result.  For
  2886. the file close to be successful,  the <file-ptr> has to point to a valid
  2887. file.  If the file close was not  successful,  an error is  generated  -
  2888. "error:  file not open").
  2889.  
  2890. EXAMPLES
  2891.  
  2892.     (close (open 'f :direction :output))    ; returns NIL
  2893.  
  2894.     (setq myfile                 ; create MYFILE
  2895.        (open 'mine :direction :output))    ;
  2896.     (print "hi" myfile)            ; returns "hi"
  2897.     (close myfile)                ; returns NIL
  2898.                         ; file contains <hi>   <NL>
  2899.     (setq myfile                 ; open MYFILE for input
  2900.        (open 'mine :direction :input))    ;
  2901.     (read myfile)                ; returns "hi"    
  2902.     (close myfile)                ; returns NIL
  2903.  
  2904. COMMON LISP COMPATABILITY:
  2905. Common LISP has an XLISP  compatable  CLOSE  function.  Common LISP does
  2906. support an :ABORT keyword, which is not supported in XLISP.
  2907.  
  2908.  
  2909. code-char
  2910. ________________________________________________________________________
  2911.  
  2912. type: function (subr) 
  2913. location: built-in
  2914. source file: xlstr.c 
  2915. Common LISP compatible: similar
  2916. versions: all machines
  2917.  
  2918. SYNTAX
  2919.  
  2920. (code-char <code> )
  2921.     <code>        -    a numeric expression
  2922.  
  2923. DESCRIPTION
  2924.  
  2925. The  CODE-CHAR  function  returns  a  character  which is the  result of
  2926. turning <code>  expression into a character.  If a <code> cannot be made
  2927. into a  character,  NIL is  returned.  The range that <code>  produces a
  2928. valid character is 0 through 127.
  2929.  
  2930. EXAMPLES
  2931.  
  2932.     (code-char 48)                ; returns #\0
  2933.     (code-char 65)                ; returns #\A
  2934.     (code-char 97)                ; returns #\a
  2935.     (code-char 91)                ; returns #\[
  2936.     (code-char 10)                ; returns #\Newline
  2937.     (code-char 128)                ; returns NIL
  2938.     (code-char 999)                ; returns NIL
  2939.  
  2940. COMMON LISP COMPATABILITY:
  2941. Common LISP allows for some optional  arguments in CODE-CHAR  because it
  2942. supports the concept of a complex  character  that includes not only the
  2943. ASCII code value, but also fonts and bits.  The bits allow for more than
  2944. 8  bits  per  character  (16  bits  is  especially  useful  in  oriental
  2945. languages).  The  fonts  allow for up to 128  different  fonts.  This is
  2946. interesting  and neat stuff,  however,  XLISP does not support fonts and
  2947. bits or the optional parameters associated with them.
  2948.  
  2949. NOTE:
  2950. Unlike the CHAR-CODE and CHAR-INT functions,  CODE-CHAR and INT-CHAR are
  2951. not identical in use.  CODE-CHAR  accepts  0..127 for its range and then
  2952. produces NIL  results.  INT-CHAR  accepts  0..255 for its range and then
  2953. produces errors.
  2954.  
  2955.  
  2956. comma
  2957. ________________________________________________________________________
  2958.  
  2959. type: reader expansion
  2960. location: built-in
  2961. source file: xlcont.c  and  xlread.c
  2962. Common LISP compatible: yes
  2963. supported on: all machines
  2964.  
  2965. SYNTAX
  2966.  
  2967. (comma <expr> )
  2968.     <expr>        -    an expression which is evaluated within
  2969.                 a BACKQUOTEd expression
  2970.  
  2971. DESCRIPTION
  2972.  
  2973. A BACKQUOTE special form returns an expression  unevaluated, except that
  2974. portions of the expression may be evaluated when they are preceeded by a
  2975. COMMA (,) or  COMMA-AT  (,@).  COMMA will  evaluate  the  portion of the
  2976. expression the comma  preceeds.  If the portion is an atom or a list, it
  2977. is placed as is within the expression.
  2978.  
  2979. EXAMPLES
  2980.  
  2981.     (setq box 'stuff-inside)        ; BOX contains STUFF-INSIDE
  2982.     (print box)                ; prints STUFF-INSIDE
  2983.     (quote (i have the box))        ; returns (I HAVE THE BOX)
  2984.     (backquote (i have the box))        ; returns (I HAVE THE BOX)
  2985.     (backquote (I have (comma box)))    ; returns (I HAVE STUFF-INSIDE)
  2986.     (backquote (I have the ,@box))        ; returns (I HAVE THE)
  2987.  
  2988.     (setq automobile '(a van))        ; set up AUTOMOBILE 
  2989.     (backquote (I have automobile))        ; returns (I HAVE AUTOMOBILE)
  2990.     (backquote (I have ,automobile))    ; returns (I HAVE (A VAN))
  2991.     (backquote (I have ,@automobile))    ; returns (I HAVE A VAN)
  2992.     `(I have ,@automobile)            ; returns (I HAVE A VAN)
  2993.  
  2994. READ MACRO:
  2995. XLISP  supports  the normal  read  macro of a comma (,) as a  short-hand
  2996. method of writing the COMMA read-expansion.
  2997.  
  2998. NOTE: 
  2999. BACKQUOTE and COMMA and COMMA-AT are very useful in defining  macros via
  3000. DEFMACRO.
  3001.  
  3002.  
  3003. comma-at
  3004. ________________________________________________________________________
  3005.  
  3006. type: reader expansion
  3007. location: built-in
  3008. source file: xlcont.c  and  xlread.c
  3009. Common LISP compatible: yes
  3010. supported on: all machines
  3011.  
  3012. SYNTAX
  3013.  
  3014. (comma-at <expr> )
  3015.     <expr>        -    an expression which is evaluated within
  3016.                 a BACKQUOTEd expression
  3017.  
  3018. DESCRIPTION
  3019.  
  3020. A BACKQUOTE special form returns an expression  unevaluated, except that
  3021. portions of the expression may be evaluated when they are preceeded by a
  3022. COMMA (,) or COMMA-AT  (,@).  COMMA-AT will  evaluate the portion of the
  3023. expression that the comma-at  preceeds.  The portion needs to be a list.
  3024. The list is spliced into the  expression.  If the portion is not a list,
  3025. COMMA-AT will splice in nothing.
  3026.  
  3027. EXAMPLES
  3028.  
  3029.     (setq box 'stuff-inside)        ; BOX contains STUFF-INSIDE
  3030.     (print box)                ; prints STUFF-INSIDE
  3031.     (quote (i have the box))        ; returns (I HAVE THE BOX)
  3032.     (backquote (i have the box))        ; returns (I HAVE THE BOX)
  3033.     (backquote (I have (comma box)))    ; returns (I HAVE STUFF-INSIDE)
  3034.     (backquote (I have the ,@box))        ; returns (I HAVE THE)
  3035.  
  3036.     (setq automobile '(a van))        ; set up AUTOMOBILE 
  3037.     (backquote (I have automobile))        ; returns (I HAVE AUTOMOBILE)
  3038.     (backquote (I have (comma automobile)))    ; returns (I HAVE (A VAN))
  3039.     (backquote (I have ,@automobile))    ; returns (I HAVE A VAN)
  3040.     `(I have ,@automobile)            ; returns (I HAVE A VAN)
  3041.  
  3042. READ MACRO:
  3043. XLISP  supports  the normal  read macro of a comma (,@) as a  short-hand
  3044. method of writing the COMMA-AT read-expansion.
  3045.  
  3046. NOTE: 
  3047. BACKQUOTE and COMMA and COMMA-AT are very useful in defining  macros via
  3048. DEFMACRO.
  3049.  
  3050.  
  3051. cond
  3052. ________________________________________________________________________
  3053.  
  3054. type: special form (fsubr)
  3055. location: built-in
  3056. source file: xlcont.c
  3057. Common LISP compatible: yes
  3058. supported on: all machines
  3059.  
  3060. SYNTAX
  3061.  
  3062. (cond  [ ( <pred1> <expr1> ) [ ( <pred2> <expr2> ) ... ] ] )
  3063.     <predN>        -    a predicate (NIL/non-NIL) expression
  3064.     <exprN>        -    an expression
  3065.  
  3066. DESCRIPTION
  3067.  
  3068. The COND  special  form  evaluates  a series of  predicate /  expression
  3069. pairs.  COND will evaluate each  predicate in sequential  order until it
  3070. finds  one  that  returns  a  non-NIL  value.  The  expression  that  is
  3071. associated with the non-NIL value is evaluated.  The resulting  value of
  3072. the  evaluated   expression  is  returned  by  COND.  If  there  are  no
  3073. predicates  that return a non-NIL  value, NIL is returned by COND.  Only
  3074. one  expression  is evaluated - the first one with a non-NIL  predicate.
  3075. Note that the predicate can be a symbol or expression.
  3076.  
  3077. EXAMPLES
  3078.  
  3079.     (cond                     ; sample CONDitional
  3080.       ((not T) (print "this won't print"))    ;
  3081.       ( NIL    (print "neither will this"))    ;
  3082.       ( T      (print "this will print"))    ;
  3083.       ( T      (print "won't get here")))    ; prints "this will print"
  3084.  
  3085.     (defun print-what (parm)
  3086.      (cond                     ; start of COND
  3087.       ((numberp parm) (print "numeric"))    ;  check for number
  3088.       ((consp parm)   (print "list"))    ;  check for list
  3089.       ((null parm)       (print "nil"))    ;  check for NIL
  3090.       (T           (print "something"))) ;  catch-all
  3091.      NIL)                    ;  always return 
  3092.                         ;
  3093.     (print-what 'a)                ; prints "something"
  3094.     (print-what 12)                ; prints "numeric"
  3095.     (print-what NIL)            ; prints "nil"
  3096.     (print-what '(a b))            ; prints "list"
  3097.  
  3098.  
  3099. cons
  3100. ________________________________________________________________________
  3101.  
  3102. type: function (subr) 
  3103. location: built-in
  3104. source file: xllist.c
  3105. Common LISP compatible: yes
  3106. supported on: all machines
  3107.  
  3108. SYNTAX
  3109.  
  3110. (cons <expr-car> <expr-cdr> )
  3111.     <arg>        -    description
  3112.     <expr-car>    -    an expression 
  3113.     <expr-cdr>    -    an expression 
  3114.  
  3115. DESCRIPTION
  3116.  
  3117. The CONS function takes two  expressions  and constructs a new list from
  3118. them.  If the  <expr-cdr>  is not a  list,  then  the  result  will be a
  3119. 'dotted-pair'.
  3120.  
  3121. EXAMPLES
  3122.  
  3123.     (cons 'a 'b)                ; returns (A . B)
  3124.     (cons 'a nil)                ; returns (A)
  3125.     (cons 'a '(b))                ; returns (A B)
  3126.     (cons '(a b) '(c d))            ; returns ((A B) C D)
  3127.     (cons '(a b) 'c)            ; returns ((A B) . C)
  3128.  
  3129.     (cons (- 4 3) '(2 3))            ; returns (1 2 3)
  3130.  
  3131.  
  3132. consp
  3133. ________________________________________________________________________
  3134.  
  3135. type: predicate function (subr)
  3136. location: built-in
  3137. source file: xlbfun.c
  3138. Common LISP compatible: yes
  3139. supported on: all machines
  3140.  
  3141. SYNTAX
  3142.  
  3143. (consp <expr> )
  3144.     <expr>        -    the expression to check
  3145.  
  3146. DESCRIPTION
  3147.  
  3148. The CONSP  predicate  checks if the  <expr> is a  non-empty  list.  T is
  3149. returned if <expr> is a list, NIL is  returned  otherwise.  Note that if
  3150. the <expr> is NIL, NIL is returned.
  3151.  
  3152. EXAMPLES
  3153.  
  3154.     (consp '(a b))                ; returns T - list
  3155.     (consp '(a . b))            ; returns T - dotted pair list
  3156.  
  3157.     (consp #'defvar)            ; returns NIL - closure - macro
  3158.     (consp (lambda (x) (print x)))        ; returns NIL - closure - lambda
  3159.     (consp NIL)                ; returns NIL - NIL    
  3160.     (consp #(1 2 3))            ; returns NIL - array
  3161.     (consp *standard-output*)        ; returns NIL - stream
  3162.     (consp 1.2)                ; returns NIL - float
  3163.     (consp #'quote)                ; returns NIL - fsubr
  3164.     (consp 1)                ; returns NIL - integer
  3165.     (consp object)                ; returns NIL - object
  3166.     (consp "str")                ; returns NIL - string
  3167.     (consp #'car)                ; returns NIL - subr
  3168.     (consp 'a)                ; returns NIL - symbol
  3169.  
  3170. NOTE:
  3171. When applied to CONSP, NIL - the empty list - returns a NIL.  NIL or '()
  3172. is used in many places as a list-class  or atom-class  expression.  Both
  3173. ATOM and LISTP, when applied to NIL, return T.  If you wish to check for
  3174. a list where an empty  list is still  considered  a valid  list, use the
  3175. LISTP predicate.
  3176.  
  3177.  
  3178. :constituent
  3179. ________________________________________________________________________
  3180.  
  3181. type: keyword
  3182. location: built-in
  3183. source file: xlread.c
  3184. Common LISP compatible: no
  3185. supported on: all machines
  3186.  
  3187. SYNTAX
  3188.  
  3189. :constituent
  3190.  
  3191.  
  3192. DESCRIPTION
  3193.  
  3194. :CONSTITUENT  is an entry that is used in the  *READTABLE*.  *READTABLE*
  3195. is a system variable that contains  XLISP's data structures  relating to
  3196. the  processing of  characters  from the user (or files) and  read-macro
  3197. expansions.  The existance of the  :CONSTITUENT  keyword  means that the
  3198. specified  character  is to be used, as is, with no further  processing.
  3199. The  system  defines  that the  following  characters  are  :CONSTITUENT
  3200. characters:
  3201.  
  3202.     0123456789  !$%&*+-./  :<=>?@[]^_{}~
  3203.     ABCDEFGHIJKLMNOPQRSTUVWXYZ  abcdefghijklmnopqrstuvwxyz
  3204.  
  3205. EXAMPLES
  3206.  
  3207.     (defun look-at (table)            ; define a function to 
  3208.      (dotimes (ch 127)            ;   look in a table
  3209.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  3210.         (case entry             ;   entries with a function
  3211.           (:CONSTITUENT             ;
  3212.               (princ (int-char ch)))    ;
  3213.           (T        NIL))))        ;
  3214.      (terpri))                ;
  3215.     (look-at *readtable*)            ;  prints  !$%&*+-./0123456789
  3216.                         ;       :<=>?@ABCDEFGHIJKLM
  3217.                         ;       NOPQRSTUVWXYZ[]^_ab
  3218.                         ;       cdefghijklmnopqrstu
  3219.                         ;       vwxyz{}~
  3220.  
  3221. CAUTION:
  3222. If you experiment  with  *READTABLE*, it is useful to save the old value
  3223. in a variable, so that you can restore the system state.
  3224.  
  3225.  
  3226. continue
  3227. ________________________________________________________________________
  3228.  
  3229. type: function (subr) 
  3230. location: built-in
  3231. source file: xlbfun.c  and  xldbug.c
  3232. Common LISP compatible: no
  3233. supported on: all machines
  3234.  
  3235. SYNTAX
  3236.  
  3237. (continue)
  3238.  
  3239.  
  3240. DESCRIPTION
  3241.  
  3242. The CONTINUE function attempts to continue from the break loop.  This is
  3243. valid only for CERRORs  (continuable  errors).  If CONTINUE is evaluated
  3244. while not in a break  loop, an error is  generated  -  "error:  not in a
  3245. break  loop".  This error does not cause XLISP to go into a break  loop.
  3246. CONTINUE never actually returns a value.
  3247.  
  3248. EXAMPLES
  3249.  
  3250.     (continue)                ; error: not in a break loop
  3251.  
  3252.     (break "out")                ; break: out
  3253.     (continue)                ; to continue from break loop 
  3254.                         ; BREAK returns NIL
  3255.  
  3256. KEYSTROKE EQUIVALENT:
  3257. In the IBM PC and MS-DOS  versions of XLISP, a CTRL-p key  sequence  has
  3258. the same  effect  as doing a  (CONTINUE).  On a  Macintosh,  this can be
  3259. accomplished by a pull-down menu or a COMMAND-p.
  3260.  
  3261.  
  3262. cos
  3263. ________________________________________________________________________
  3264.  
  3265. type: function (subr) 
  3266. location: built-in
  3267. source file: xlmath.c
  3268. Common LISP compatible: yes
  3269. supported on: all machines
  3270.  
  3271. SYNTAX
  3272.  
  3273. (cos <expr> )
  3274.     <expr>        -    floating point number/expression
  3275.  
  3276. DESCRIPTION
  3277.  
  3278. The cos  function  returns  the cosine of the  <expr>.  The <expr> is in
  3279. radians.
  3280.  
  3281. EXAMPLES
  3282.  
  3283.     (cos 0.0)                ; returns 1
  3284.     (cos (/ 3.14159 2))            ; returns 1.32679e-06 (almost 0)
  3285.     (cos .5)                ; returns 0.877583
  3286.     (cos 0)                    ; error: bad integer operation
  3287.     (cos 1.)                ; error: bad integer operation
  3288.  
  3289.  
  3290. debug
  3291. ________________________________________________________________________
  3292.  
  3293. type: defined function (closure) 
  3294. location: extension
  3295. source file: init.lsp
  3296. Common LISP compatible: no
  3297. supported on: all machines
  3298.  
  3299. SYNTAX
  3300.  
  3301. (debug)
  3302.  
  3303.  
  3304. DESCRIPTION
  3305.  
  3306. The DEBUG  function  sets  *BREAKENABLE*  to T.  This has the  effect of
  3307. turning on the break  loop for  errors.  DEBUG  always  returns  T.  The
  3308. default is DEBUG enabled.
  3309.  
  3310. EXAMPLES
  3311.  
  3312.     (debug)                    ; returns T
  3313.     (+ 1 "a")                ; error: bad argument type
  3314.                         ; enters break-loop
  3315.     (clean-up)                ; from within the break-loop
  3316.     (nodebug)                ; returns NIL
  3317.     (+ 1 "a")                ; error: bad argument type
  3318.                         ; but doesn't enter break-loop
  3319.  
  3320. NOTE:
  3321. The  functions  DEBUG and NODEBUG are created in the INIT.LSP  file.  If
  3322. they do not exist in your  XLISP  system,  you might be having a problem
  3323. with  INIT.LSP.  Before you start XLISP, look in the  directory  you are
  3324. currently in, and check to see if there is an INIT.LSP.
  3325.  
  3326.  
  3327. *debug-io*
  3328. ________________________________________________________________________
  3329.  
  3330. type: system variable 
  3331. location: built-in
  3332. source file: xlinit.c  xlio.c  xldbug.c
  3333. Common LISP compatible: yes
  3334. supported on: all machines
  3335.  
  3336. SYNTAX
  3337.  
  3338. *debug-io*
  3339.  
  3340.  
  3341. DESCRIPTION
  3342.  
  3343. *DEBUG-IO* is a system variable that contains a file pointer that points
  3344. to the  stream  where  all  debug  input/output  goes to and  from.  The
  3345. default  file for  *DEBUG-IO*  is the  system  standard  error  device -
  3346. normally the keyboard and screen.
  3347.  
  3348. EXAMPLES
  3349.     *debug-io*                ; returns #<File-Stream: #243de>
  3350.  
  3351. NOTE:
  3352. *TRACE-OUTPUT*,  *DEBUG-IO* and  *ERROR-OUTPUT*  are normally all set to
  3353. the same file stream - STDERR.
  3354.  
  3355.  
  3356. defconstant
  3357. ________________________________________________________________________
  3358.  
  3359. type: defined macro (closure)
  3360. location: extension
  3361. source file: init.lsp
  3362. Common LISP compatible: similar
  3363. supported on: all machines
  3364.  
  3365. SYNTAX
  3366.  
  3367. (defconstant  <symbol>  <init-value> )
  3368.     <symbol>    -    an expression evaluating to a symbol
  3369.     <init-value>    -    an initial value expression 
  3370.  
  3371. DESCRIPTION
  3372.  
  3373. The  DEFCONSTANT  macro defines a user constant with the name  <symbol>.
  3374. The <symbol> is created with the initial value <init-value>  expression.
  3375. If  <symbol>  did  exist,  its  previous  value  will  be   overwritten.
  3376. DEFCONSTANT returns the <symbol> as its result.
  3377.  
  3378. EXAMPLES
  3379.  
  3380.     (boundp 'mvyar)                ; returns NIL - doesn't exist
  3381.     (defconstant myvar 7)            ; returns MYVAR
  3382.     (boundp 'myvar)                ; returns T
  3383.     myvar                    ; returns 7
  3384.  
  3385. BUG:
  3386. In Common LISP, the  definition of  DEFCONSTANT  is such that it returns
  3387. the <symbol> as its result.  XLISP returns the value of <symbol>.
  3388.  
  3389. COMMON LISP COMPATABILITY:
  3390. In Common LISP, any change to the value of the  DEFCONSTANT  <symbol> is
  3391. supposed to generate an error.  XLISP treats it like any user symbol and
  3392. allows it to change.
  3393.  
  3394. COMMON LISP COMPATABILITY:
  3395. Common LISP supports an additional  optional  parameter.  This parameter
  3396. is a documentation string.  XLISP does not support this.
  3397.  
  3398. NOTE:
  3399. The functions  DEFVAR,  DEFPARAMETER  and DEFCONSTANT are created in the
  3400. INIT.LSP  file.  If it does not exist in your XLISP system, you might be
  3401. having a problem  with  INIT.LSP.  Before you start  XLISP,  look in the
  3402. directory  you  are  currently  in,  and  check  to see if  there  is an
  3403. INIT.LSP.
  3404.  
  3405.  
  3406. defmacro
  3407. ________________________________________________________________________
  3408.  
  3409. type: special form (fsubr)
  3410. location: built-in
  3411. source file: xlcont.c
  3412. Common LISP compatible: yes
  3413. supported on: all machines
  3414.  
  3415. SYNTAX
  3416.  
  3417. (defmacro <symbol> <arg-list> <body> )
  3418.     <symbol>    -    The name of the macro being defined
  3419.     <arg-list>    -    A list of the formal arguments to the macro
  3420.                 of the form:    ( [ <arg1> ... ]
  3421.                           [ &optional <oarg1> ... ]
  3422.                             [ &rest <rarg> ]
  3423.                           [ &key ... ]
  3424.                             [ &aux <aux1> ... ] )
  3425.     <body>        -    A series of LISP forms (expressions) 
  3426.  
  3427. DESCRIPTION
  3428.  
  3429. DEFMACRO defines a macro expansion.  When the <symbol> name of the macro
  3430. expansion is encountered (similar to a function  invocation), the <body>
  3431. of code that was defined in the DEFMACRO is expanded  and  replaces  the
  3432. macro invocation.
  3433.  
  3434. All of the <argN>  formal  arguments  that are  defined are  required to
  3435. appear  in the  invocation  of the  macro  expansion.  If there  are any
  3436. &OPTIONAL  arguments defined, they will be filled in order.  If there is
  3437. a &REST  argument  defined, and all the required  formal  arguments  and
  3438. &OPTIONAL  arguments are filled, any and all further  parameters will be
  3439. passed into the function  via the <rarg>  argument.  Note that there can
  3440. be only  one  <rarg>  argument  for  &REST.  If there  are  insufficient
  3441. parameters  for any of the  &OPTIONAL  or  &REST  arguments,  they  will
  3442. contain  NIL.  The &AUX  variables  are a  mechanism  for you to  define
  3443. variables  local to the DEFMACRO  execution.  At the end of the function
  3444. execution, these local symbols and their values are are removed.
  3445.  
  3446. EXAMPLES
  3447.  
  3448.     (defmacro plus (num1 num2)        ; define PLUS macro
  3449.       `(+ ,num1 ,num2))            ;   which is a 2 number add
  3450.     (plus 1 2)                ; returns 3
  3451.     (setq x 10)                ; set x to 10
  3452.     (setq y 20)                ; set y to 20
  3453.     (plus x y)                ; returns 30
  3454.  
  3455.     (defmacro betterplus (num &rest nlist)    ; define a BETTERPLUS macro
  3456.       `(+ ,num ,@nlist))            ;   which can take many numbers
  3457.     (betterplus 1)                ; returns 1
  3458.     (betterplus 1 2 3)            ; returns 6
  3459.     (betterplus 1 2 3 4 5)            ; returns 15
  3460.  
  3461.  
  3462.     (defmacro atest (x &optional y &rest z) ; define ATEST macro
  3463.       (princ " x: ") (princ x)        ;   \
  3464.       (princ " y: ") (princ y)        ;    print out the parameters
  3465.       (princ " z: ") (princ z) (terpri)     ;   /      (un-evaluated)
  3466.       `(print (+ ,x ,y ,@z)) )        ;   add them together (eval'ed)
  3467.                         ;
  3468.     (atest 1)                 ; prints - x: 1 y: NIL z: NIL
  3469.                         ;   error: bad argument type 
  3470.                         ; because (+ 1 NIL) isn't valid
  3471.     (atest 1 2)                 ; prints - x: 1 y: 2 z: NIL
  3472.                         ;   returns 3
  3473.     (atest 1 2 3)                 ; prints - x: 1 y: 2 z: (3)
  3474.                         ;   returns 6
  3475.     (atest 1 2 3 4 5)             ; prints - x: 1 y: 2 z: (3 4 5)
  3476.                         ;   returns 15
  3477.                         ;
  3478.     (setq a 99)                ; set A to 99
  3479.     (setq b 101)                ; set B to 101
  3480.     (atest a b)                 ; prints - x: A y: B z: NIL
  3481.                         ;   returns 200
  3482.     (atest a b 9 10 11)             ; prints - x: A y: B z: (9 10 11)
  3483.                         ;   returns 230
  3484.  
  3485. COMMON LISP COMPATABILITY:
  3486. Common LISP supports an optional  documentation string as the first form
  3487. in the <body> of a DEFMACRO or DEFUN.  XLISP will accept this  string as
  3488. a valid form, but it will not do anything special with it.
  3489.  
  3490.  
  3491. defparameter
  3492. ________________________________________________________________________
  3493.  
  3494. type: defined macro (closure)
  3495. location: extension
  3496. source file: init.lsp
  3497. Common LISP compatible: similar
  3498. supported on: all machines
  3499.  
  3500. SYNTAX
  3501.  
  3502. (defparameter  <symbol>  <init-value> )
  3503.     <symbol>    -    an expression evaluating to a symbol
  3504.     <init-value>    -    an initial value expression 
  3505.  
  3506. DESCRIPTION
  3507.  
  3508. The DEFPARAMETER macro defines a user parameter (variable) with the name
  3509. <symbol>.  A user parameter is supposed to be a variable that should not
  3510. change  but is allowed  to change.  The  <symbol>  is  created  with the
  3511. initial  value  <init-value>  expression.  If  <symbol>  did  exist, its
  3512. previous value will be  overwritten.  DEFPARAMETER  returns the <symbol>
  3513. as its result.
  3514.  
  3515. EXAMPLES
  3516.  
  3517.     (boundp 'mvyar)                ; returns NIL - doesn't exist
  3518.     (defparameter myvar 7)            ; returns MYVAR
  3519.     (boundp 'myvar)                ; returns T
  3520.     myvar                    ; returns 7
  3521.  
  3522. BUG:
  3523. In Common LISP, the definition of  DEFPARAMETER  is such that it returns
  3524. the <symbol> as its result.  XLISP returns the value of <symbol>.
  3525.  
  3526. COMMON LISP COMPATABILITY:
  3527. Common LISP supports an additional  optional  parameter.  This parameter
  3528. is a documentation string.  XLISP does not support this.
  3529.  
  3530. NOTE:
  3531. The functions  DEFVAR,  DEFPARAMETER  and DEFCONSTANT are created in the
  3532. INIT.LSP  file.  If it does not exist in your XLISP system, you might be
  3533. having a problem  with  INIT.LSP.  Before you start  XLISP,  look in the
  3534. directory  you  are  currently  in,  and  check  to see if  there  is an
  3535. INIT.LSP.
  3536.  
  3537.  
  3538. defun
  3539. ________________________________________________________________________
  3540.  
  3541. type: special form (fsubr)
  3542. location: built-in
  3543. source file: xlcont.c
  3544. Common LISP compatible: yes
  3545. supported on: all machines
  3546.  
  3547. SYNTAX
  3548.  
  3549. (defun <symbol> <arg-list> <body> )
  3550.     <symbol>    -    The name of the function being defined
  3551.     <arg-list>    -    A list of the formal arguments to the function
  3552.                 of the form:    ( [ <arg1> ... ]
  3553.                           [ &optional <oarg1> ... ]
  3554.                             [ &rest <rarg> ]
  3555.                           [ &key ... ]
  3556.                             [ &aux <aux1> ... ] )
  3557.     <body>        -    A series of LISP forms (expressions) that
  3558.                 are executed in order.  
  3559.  
  3560. DESCRIPTION
  3561.  
  3562. DEFUN defines a new function or  re-defines an exisiting  function.  The
  3563. last form in <body> that is evaluated is the value that is returned when
  3564. the function is executed.
  3565.  
  3566. All of the <argN>  formal  arguments  that are  defined are  required to
  3567. appear in a call to the  defined  function.  If there are any  &OPTIONAL
  3568. arguments  defined,  they will be filled  in order.  If there is a &REST
  3569. argument  defined, and all the required  formal  arguments and &OPTIONAL
  3570. arguments are filled, any and all further parameters will be passed into
  3571. the function  via the <rarg>  argument.  Note that there can be only one
  3572. <rarg> argument for &REST.  If there are insufficient parameters for any
  3573. of the  &OPTIONAL or &REST  arguments,  they will contain NIL.  The &AUX
  3574. variables  are a  mechanism  for you to  define  variables  local to the
  3575. function  definition.  At the end of the function execution, these local
  3576. symbols and their values are are removed.
  3577.  
  3578. EXAMPLES
  3579.  
  3580.     (defun my-add                 ; define function MY-ADD 
  3581.       (num1 num2)                ;   with 2 formal parameters
  3582.       (+ num1 num2))            ;   that adds the two paramters
  3583.     (my-add 1 2)                ; returns 3
  3584.  
  3585.     (defun foo                 ; define function FOO
  3586.       (a b &optional c d &rest e)        ;   with some of each argument
  3587.       (print a) (print b)             ;
  3588.       (print c) (print d)             ;   print out each
  3589.       (print e))                ;
  3590.     (foo)                    ; error: too few arguments 
  3591.     (foo 1)                    ; error: too few arguments 
  3592.     (foo 1 2)                ; prints 1 2 NIL NIL NIL
  3593.     (foo 1 2 3)                ; prints 1 2 3 NIL NIL
  3594.     (foo 1 2 3 4)                ; prints 1 2 3 4 NIL
  3595.     (foo 1 2 3 4 5)                ; prints 1 2 3 4 (5)
  3596.     (foo 1 2 3 4 5 6 7 8 9)            ; prints 1 2 3 4 (5 6 7 8 9)
  3597.  
  3598.     (defun my-add                 ; define function MY-ADD
  3599.       (num1 &rest num-list &aux sum)    ;   with 1 arg, rest, 1 aux var
  3600.       (setq sum num1)            ;   clear SUM
  3601.       (dotimes (i (length num-list) )    ;   loop through rest list
  3602.          (setq sum (+ sum (car num-list)))  ;      add the number to sum
  3603.          (setq num-list (cdr num-list)))    ;      and remove num from list
  3604.       sum)                    ;   return sum when finished
  3605.     (my-add 1 2 3 4)            ; returns 10
  3606.     (my-add 5 5 5 5 5)            ; returns 25
  3607.  
  3608.  
  3609. COMMON LISP COMPATABILITY:
  3610. Common LISP supports an optional  documentation string as the first form
  3611. in the <body> of a DEFMACRO or DEFUN.  XLISP will accept this  string as
  3612. a valid form, but it will not do anything special with it.
  3613.  
  3614.  
  3615. defvar
  3616. ________________________________________________________________________
  3617.  
  3618. type: defined macro (closure)
  3619. location: extension
  3620. source file: init.lsp
  3621. Common LISP compatible: similar
  3622. supported on: all machines
  3623.  
  3624. SYNTAX
  3625.  
  3626. (defvar  <symbol>  [ <init-value> ] )
  3627.     <symbol>    -    an expression evaluating to a symbol
  3628.     <init-value>    -    an optional initial value expression 
  3629.  
  3630. DESCRIPTION
  3631.  
  3632. The DEFVAR macro  defines a user  variable  with the name  <symbol>.  If
  3633. <symbol> did not already exist, the <symbol> is created with the initial
  3634. value NIL.  If the optional <init-value>  expression is present, the new
  3635. <symbol>  will be set to the  <init-value>.  If <symbol>  did exist, its
  3636. previous value will be left  untouched.  DEFVAR  returns the <symbol> as
  3637. its result.
  3638.  
  3639. EXAMPLES
  3640.  
  3641.     (boundp 'mvyar)                ; returns NIL - doesn't exist
  3642.     (defvar myvar)                ; returns MYVAR
  3643.     (boundp 'myvar)                ; returns T
  3644.     (setq myvar 7)                ; returns 7
  3645.     (defvar myvar)                ; returns MYVAR
  3646.     myvar                    ; returns 7 - was not initialized
  3647.     (defvar myvar 99)            ; returns MYVAR
  3648.     myvar                    ; returns 7 - was not initialized
  3649.  
  3650. BUG:
  3651. In Common  LISP, the  definition  of DEFVAR is such that it returns  the
  3652. <symbol> as its result.  XLISP returns the value of <symbol>.
  3653.  
  3654. COMMON LISP COMPATABILITY:
  3655. Common LISP supports an additional  optional  parameter.  This parameter
  3656. is a documentation string.  XLISP does not support this.
  3657.  
  3658. NOTE:
  3659. The functions  DEFVAR,  DEFPARAMETER  and DEFCONSTANT are created in the
  3660. INIT.LSP  file.  If it does not exist in your XLISP system, you might be
  3661. having a problem  with  INIT.LSP.  Before you start  XLISP,  look in the
  3662. directory  you  are  currently  in,  and  check  to see if  there  is an
  3663. INIT.LSP.
  3664.  
  3665.  
  3666. delete
  3667. ________________________________________________________________________
  3668.  
  3669. type: function (subr) 
  3670. location: built-in
  3671. source file: xllist.c
  3672. Common LISP compatible: similar
  3673. supported on: all machines
  3674.  
  3675. SYNTAX
  3676.  
  3677. (delete <expr> <list>  [ { :test | :test-not } <test> ] )
  3678.     <expr>        -    the expression to delete from <list>
  3679.     <list>        -    the list to DESTRUCTIVELY modify
  3680.     <test>        -    optional test function (default is EQL)
  3681.  
  3682. DESCRIPTION
  3683.  
  3684. DELETE  destructively  modifies  the <list> by removing the <expr>.  The
  3685. destructive  aspect of this operation means that the actual symbol value
  3686. is  used  in the  list-modifying  operations  - not a  copy.  If  <expr>
  3687. appears  multiple times in the <list>, all  occurances  will be removed.
  3688. <list> must evaluate to a valid list.  An atom for <list> will result in
  3689. an error.  Having NIL for <list>  will return a NIL as the  result.  You
  3690. may specify your own test with the :TEST and :TEST-NOT keywords.
  3691.  
  3692. EXAMPLES
  3693.  
  3694.     (delete 'b NIL)                ; returns NIL
  3695.     (delete 'b '(a b b c b))        ; returns (A C)
  3696.  
  3697.     (setq a '(1 2 3)) (setq b a)        ; set up A and B
  3698.     (delete '2 a)                ; returns (1 3)
  3699.     (print a)                ; prints (1 3)    A IS MODIFIED!
  3700.     (print b)                ; prints (1 3)    B IS MODIFIED!
  3701.  
  3702.     (delete '(b) '((a)(b)(c)))        ; returns ((A) (B) (C))
  3703.                         ;   EQL doesn't work on lists
  3704.     (delete '(b) '((a)(b)(c)) :test 'equal)    ; returns ((A) (C))
  3705.  
  3706. NOTE:
  3707. The  DELETE  function  can work  with a list or  string  as the  <expr>.
  3708. However, the default EQL test does not work with lists or strings,  only
  3709. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  3710. keyword along with EQUAL for <test>.
  3711.  
  3712. COMMON LISP COMPATABILITY:
  3713. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  3714. keywords which Common LISP does.
  3715.  
  3716.  
  3717. delete-if
  3718. ________________________________________________________________________
  3719.  
  3720. type: function (subr) 
  3721. location: built-in
  3722. source file: xllist.c
  3723. Common LISP compatible: similar
  3724. supported on: all machines
  3725.  
  3726. SYNTAX
  3727.  
  3728. (delete-if <test> <list> )
  3729.     <test>        -    the test function to be performed
  3730.     <list>        -    the list to delete from 
  3731.  
  3732. DESCRIPTION
  3733.  
  3734. DELETE-IF  destructively modifies the <list> by removing the elements of
  3735. the  <list>  that  pass  the  <test>.  The  destructive  aspect  of this
  3736. operation   means  that  the  actual   symbol   value  is  used  in  the
  3737. list-modifying operations - not a copy.  <list> must evaluate to a valid
  3738. list.  An atom for  <list>  will  result  in an  error.  Having  NIL for
  3739. <list> will return a NIL as the result.
  3740.  
  3741. EXAMPLES
  3742.  
  3743.     (setq mylist '(1 2 3 4 5 6 7 8))    ; set up a list
  3744.     (delete-if 'oddp mylist)        ; returns (2 4 6 8)
  3745.     (print mylist)                ; prints  (2 4 6 8)
  3746.                         ;   note that MYLIST is affected
  3747.  
  3748.     (setq mylist '(a nil b nil c))        ; set up a list
  3749.     (delete-if 'null mylist)        ; returns (A B C)
  3750.  
  3751. BUG:
  3752. DELETE-IF will return the proper value, but it does not always  properly
  3753. modify the  symbol  containing  the value.  This seems to be true if the
  3754. first element of the <list> passes the test (and should be deleted).
  3755.  
  3756. COMMON LISP COMPATABILITY:
  3757. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  3758. keywords which Common LISP does.
  3759.  
  3760.  
  3761. delete-if-not
  3762. ________________________________________________________________________
  3763.  
  3764. type: function (subr) 
  3765. location: built-in
  3766. source file: xllist.c
  3767. Common LISP compatible: similar
  3768. supported on: all machines
  3769.  
  3770. SYNTAX
  3771.  
  3772. (delete-if-not <test> <list> )
  3773.     <test>        -    the test function to be performed
  3774.     <list>        -    the list to delete from 
  3775.  
  3776. DESCRIPTION
  3777.  
  3778. DELETE-IF-NOT destructively modifies the <list> by removing the elements
  3779. of the  <list>  that fail the  <test>.  The  destructive  aspect of this
  3780. operation   means  that  the  actual   symbol   value  is  used  in  the
  3781. list-modifying operations - not a copy.  <list> must evaluate to a valid
  3782. list.  An atom for  <list>  will  result  in an  error.  Having  NIL for
  3783. <list> will return a NIL as the result.
  3784.  
  3785. EXAMPLES
  3786.  
  3787.     (setq mylist '(1 2 3 4 5 6 7 8))    ; set up a list
  3788.     (delete-if-not 'oddp mylist)        ; returns (1 3 5 7)
  3789.     (print mylist)                ; prints  (1 3 5 7)
  3790.                         ;   note that MYLIST is affected
  3791.  
  3792.     (setq mylist '(a nil b nil c))        ; set up a list
  3793.     (delete-if-not 'null mylist)        ; returns (NIL NIL)
  3794.  
  3795. BUG:
  3796. DELETE-IF-NOT  will  return  the proper  value,  but it does not  always
  3797. properly modify the symbol  containing the value.  This seems to be true
  3798. if the first  element  of the  <list>  fails  the test  (and  should  be
  3799. deleted).
  3800.  
  3801. COMMON LISP COMPATABILITY:
  3802. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  3803. keywords which Common LISP does.
  3804.  
  3805.  
  3806. digit-char
  3807. ________________________________________________________________________
  3808.  
  3809. type: function (subr) 
  3810. location: built-in
  3811. source file: xlstr.c 
  3812. Common LISP compatible: similar
  3813. versions: all machines
  3814.  
  3815. SYNTAX
  3816.  
  3817. (digit-char <int> )
  3818.     <int>        -    an integer expression
  3819.  
  3820. DESCRIPTION
  3821.  
  3822. The DIGIT-CHAR  function takes an integer  expression <int> and converts
  3823. it into a decimal  digit  character.  So, an integer value of 0 produces
  3824. the character #\0.  An integer value of 1 produces the character #\1 and
  3825. so on.  If a valid character can be produce it is returned,  otherwise a
  3826. NIL is returned.
  3827.  
  3828. EXAMPLES
  3829.  
  3830.     (digit-char 0)                ; returns #\0
  3831.     (digit-char 9)                ; returns #\9
  3832.     (digit-char 10)                ; returns NIL
  3833.  
  3834. COMMON LISP COMPATABILITY:
  3835. Common  LISP  supports  the use of an  optional  radix  parameter.  This
  3836. option  specifies  numeric base.  This allows the DIGIT-CHAR to function
  3837. properly for hexadecimal  digits (for example).  Common LISP supports up
  3838. to base 36 radix systems.  XLISP does not support this radix  parameter.
  3839. Common LISP also supports a font parameter which XLISP does not.
  3840.  
  3841.  
  3842. digit-char-p
  3843. ________________________________________________________________________
  3844.  
  3845. type: predicate function (subr) 
  3846. location: built-in
  3847. source file: xlstr.c 
  3848. Common LISP compatible: similar
  3849. versions: all machines
  3850.  
  3851. SYNTAX
  3852.  
  3853. (digit-char-p <char> )
  3854.     <char>        -    a character expression
  3855.  
  3856. DESCRIPTION
  3857.  
  3858. The DIGIT-CHAR-P  predicate checks if the <char> expression is a numeric
  3859. digit.  If <char> is numeric  digit a T is returned,  otherwise a NIL is
  3860. returned.  Decimal  digits are '0' (ASCII  decimal value 48) through '9'
  3861. (ASCII decimal value 57).
  3862.  
  3863. EXAMPLES
  3864.  
  3865.     (digit-char-p #\0)            ; returns T
  3866.     (digit-char-p #\9)            ; returns T
  3867.     (digit-char-p #\A)            ; returns NIL
  3868.     (digit-char-p #\a)            ; returns NIL
  3869.     (digit-char-p #\.)            ; returns NIL
  3870.     (digit-char-p #\-)            ; returns NIL
  3871.     (digit-char-p #\+)            ; returns NIL
  3872.  
  3873. NOTE:
  3874. Other non-digit  characters used in numbers are NOT included:  plus (+),
  3875. minus (-), exponent (e or E) and decimal point (.).
  3876.  
  3877. COMMON LISP COMPATABILITY:
  3878. Common  LISP  supports  the use of an  optional  radix  parameter.  This
  3879. option specifies numeric base.  This allows the DIGIT-CHAR-P to function
  3880. properly for hexadecimal  digits (for example).  Common LISP supports up
  3881. to base 36 radix systems.  XLISP does not support this radix  parameter.
  3882.  
  3883.  
  3884. do
  3885. ________________________________________________________________________
  3886.  
  3887. type: special form (fsubr)
  3888. location: built-in
  3889. source file: xlcont.c
  3890. Common LISP compatible: yes
  3891. supported on: all machines
  3892.  
  3893. SYNTAX
  3894.  
  3895. (do  ( [ <binding> ... ]  ) ( <test-expr> [ <result> ] ) [ <expr> ... ]  )
  3896.     <binding>    -    a variable binding which is can take one of 
  3897.                 the following forms:
  3898.                     <symbol>   
  3899.                     ( <symbol> <init-expr> [<step-expr>] )
  3900.     <symbol>    -    a symbol
  3901.     <init-expr>    -    an initialization expression for <symbol>
  3902.     <step-expr>    -    an expression that <symbol> symbol is updated
  3903.                 at the end of each loop
  3904.     <test-expr>    -    an expression to test for loop termination 
  3905.     <result>    -    an optional expression for the returned result
  3906.     <expr>        -    expressions comprising the body of the loop
  3907.                 which may contain RETURNs, GOs or tags for GO  
  3908.  
  3909. DESCRIPTION
  3910.  
  3911. The DO  special  form is  basically  a 'while'  looping  construct  that
  3912. contains  symbols (with  optional  initializations  and updates), a loop
  3913. test (with an optional  return value) and a block of code  (expressions)
  3914. to evaluate.  The DO form evaluates its  initializations  and updates in
  3915. no  specified  order (as  opposed  to DO*  which  does it in  sequential
  3916. order).  The sequence of these events is:
  3917.  
  3918.         <init-expr> execution
  3919.         while <test-expr> do
  3920.             loop code execution
  3921.             <step-expr> execution
  3922.         end-while
  3923.         return <result>
  3924.  
  3925. The first form after the DO is the 'binding' form.  It contains a series
  3926. of <symbol>'s or  <binding>'s.  The <binding> is a <symbol>  followed by
  3927. an initialization  expression  <init-expr> and an optional  <step-expr>.
  3928. If there is no  <init-expr>,  the <symbol> will be  initialized  to NIL.
  3929. There is no  specification  as to the order of execution of the bindings
  3930. or the step expressions - except that they happen all together.
  3931.  
  3932. The DO form will go through and create and initialize the symbols.  This
  3933. is followed by evaluating  the  <test-expr>.  If  <test-expr>  returns a
  3934. non-NIL  value, the loop will  terminate.  If <test-expr>  returns a NIL
  3935. value  then  the  DO  will  sequentially  execute  the  <expr>'s.  After
  3936. execution  of  the  loop   <expr>'s,  the  <symbol>'s  are  set  to  the
  3937. <step-expr>'s  (if the  <step-expr>'s  exist).  Then, the <test-expr> is
  3938. re-evaluated,  and so on....  The value of the  <result>  expression  is
  3939. evaluated and  returned.  If no <result> is specified,  NIL is returned.
  3940. When the DO is finished execution, the <symbol>'s that were defined will
  3941. no longer exist or retain their values.
  3942.  
  3943. EXAMPLES
  3944.  
  3945.     (do (i)                 ; DO loop with var I
  3946.       ((eql i 0) "done")             ;   test and result
  3947.       (print i) (setq i 0) (print i))    ;   prints     NIL     0
  3948.                         ;   returns "done"
  3949.                         
  3950.     (do (i)                 ; DO loop with var I
  3951.       ((eql i 0))                 ;   test but no result
  3952.       (print i) (setq i 0) (print i))    ;   prints     NIL     0
  3953.                         ;   returns NIL
  3954.  
  3955.     (do                     ; DO loop
  3956.        ((i 0 (setq i (1+ i)))        ;   var I=0  increment by 1
  3957.         (j 10 (setq j (1- j)))     )    ;   var J=10 decrement by 1
  3958.        ((eql i j)  "met in the middle" )    ;   test and result
  3959.        (princ i) (princ " ")         ;   prints  0 10
  3960.        (princ j) (terpri))            ;        1 9
  3961.                         ;        2 8
  3962.                         ;        3 7
  3963.                         ;        4 6
  3964.                         ;   returns "met in the middle"
  3965.  
  3966.  
  3967. do*
  3968. ________________________________________________________________________
  3969.  
  3970. type: special form (fsubr)
  3971. location: built-in
  3972. source file: xlcont.c
  3973. Common LISP compatible: yes
  3974. supported on: all machines
  3975.  
  3976. SYNTAX
  3977.  
  3978. (do*  ( [ <binding> ... ]  ) ( <test-expr> [ <result> ] ) [ <expr> ... ]  )
  3979.     <binding>    -    a variable binding which is can take one of 
  3980.                 the following forms:
  3981.                     <symbol>    
  3982.                     ( <symbol> <init-expr> [<step-expr>] )
  3983.     <symbol>    -    a symbol
  3984.     <init-expr>    -    an initialization expression for <symbol>
  3985.     <step-expr>    -    an expression that <symbol> symbol is updated
  3986.                 at the end of each loop
  3987.     <test-expr>    -    an expression to test for loop termination 
  3988.     <result>    -    an optional expression for the returned result
  3989.     <expr>        -    expressions comprising the body of the loop
  3990.                 which may contain RETURNs, GOs or tags for GO  
  3991.  
  3992. DESCRIPTION
  3993.  
  3994. The DO* special  form is  basically  a 'while'  looping  construct  that
  3995. contains  symbols (with  optional  initializations  and updates), a loop
  3996. test (with an optional  return value) and a block of code  (expressions)
  3997. to evaluate.  The DO* form evaluates its  initializations and updates in
  3998. sequential  order (as  opposed to DO which  doesn't).  The  sequence  of
  3999. these events is:
  4000.  
  4001.         <init-expr> execution
  4002.         while <test-expr> do
  4003.             loop code execution
  4004.             <step-expr> execution
  4005.         end-while
  4006.         return <result>
  4007.  
  4008. The first  form  after the DO* is the  'binding'  form.  It  contains  a
  4009. series  of  <symbol>'s  or  <binding>'s.  The  <binding>  is a  <symbol>
  4010. followed by an  initialization  expression  <init-expr>  and an optional
  4011. <step-expr>.  If  there  is  no   <init-expr>,   the  <symbol>  will  be
  4012. initialized  to  NIL.  There  is no  specification  as to the  order  of
  4013. execution  of the  bindings or the step  expressions  - except that they
  4014. happen all together.
  4015.  
  4016. The DO* form will go through  and create  and  initialize  the  symbols.
  4017. This is followed by evaluating the <test-expr>.  If <test-expr>  returns
  4018. a non-NIL value, the loop will terminate.  If <test-expr>  returns a NIL
  4019. value  then  the DO*  will  sequentially  execute  the  <expr>'s.  After
  4020. execution  of  the  loop   <expr>'s,  the  <symbol>'s  are  set  to  the
  4021. <step-expr>'s  (if the  <step-expr>'s  exist).  Then, the <test-expr> is
  4022. re-evaluated,  and so on....  The value of the  <result>  expression  is
  4023. evaluated and  returned.  If no <result> is specified,  NIL is returned.
  4024. When the DO* is finished  execution,  the  <symbol>'s  that were defined
  4025. will no longer exist or retain their values.
  4026.  
  4027. EXAMPLES
  4028.  
  4029.     (do                      ; DO example - won't work
  4030.       ((i 0)                ;   var I=0
  4031.          (j i) )                ;   var J=I (won't work)
  4032.       ( (eql i j) "done")            ;   test and result
  4033.       (print "looping"))            ; error: unbound variable - I
  4034.                         ;
  4035.     (do*                      ; DO* example - will work
  4036.       ((i 0)                ;   var I=0
  4037.          (j i) )                ;   var J=I (proper exec. order)
  4038.       ( (eql i j) "done")            ;   test and result
  4039.       (print "looping"))            ;   returns "done"
  4040.     
  4041.     (do* (i)                 ; DO* loop with var I
  4042.       ((eql i 0) "done")             ;   test and result
  4043.       (print i) (setq i 0) (print i))    ;   prints     NIL     0
  4044.                         ;   returns "done"
  4045.                         
  4046.     (do* (i)                 ; DO* loop with var I
  4047.       ((eql i 0))                 ;   test but no result
  4048.       (print i) (setq i 0) (print i))    ;   prints     NIL     0
  4049.                         ;   returns NIL
  4050.  
  4051.     (do*                     ; DO* loop
  4052.        ((i 0 (setq i (1+ i)))        ;   var I=0  increment by 1
  4053.         (j 10 (setq j (1- j)))     )    ;   var J=10 decrement by 1
  4054.        ((eql i j)  "met in the middle" )    ;   test and result
  4055.        (princ i) (princ " ")         ;   prints  0 10
  4056.        (princ j) (terpri))            ;        1 9
  4057.                         ;        2 8
  4058.                         ;        3 7
  4059.                         ;        4 6
  4060.                         ;   returns "met in the middle"
  4061.  
  4062.  
  4063. dolist
  4064. ________________________________________________________________________
  4065.  
  4066. type: special form (fsubr)
  4067. location: built-in
  4068. source file: xlcont.c
  4069. Common LISP compatible: yes
  4070. supported on: all machines
  4071.  
  4072. SYNTAX
  4073.  
  4074. (dolist  ( <symbol> <list-expr> [ <result> ] ) [ <expr> ... ]  )
  4075.     <symbol>    -    a symbol
  4076.     <list-expr>    -    a list expression 
  4077.     <result>    -    an optional expression for the returned result
  4078.     <expr>        -    expressions comprising the body of the loop
  4079.                 which may contain RETURNs, GOs or tags for GO  
  4080.  
  4081. DESCRIPTION
  4082.  
  4083. The DOLIST  special  form is  basically a  list-oriented  'for'  looping
  4084. construct  that contains a loop  <symbol>, a <list-expr>  to draw values
  4085. from, an  optional  return  value and a block of code  (expressions)  to
  4086. evaluate.  The sequence of execution is:
  4087.  
  4088.         <symbol>  := CAR of <list-expr>
  4089.         temp-list := CDR of <list-expr>
  4090.         while  temp-list is not empty
  4091.             loop code execution
  4092.             <symbol>  := CAR of temp-list
  4093.             temp-list := CDR of temp-list
  4094.         end-while
  4095.         return <result>
  4096.  
  4097. The main loop <symbol> will take on successive values from  <list-expr>.
  4098. The DOLIST form will go through and create and  initialize the <symbol>.
  4099. After  execution of the loop  <expr>'s,  the <symbol> is set to the next
  4100. value in the <list-expr>.  This continues until the <list-expr> has been
  4101. exhausted.  The  value  of the  <result>  expression  is  evaluated  and
  4102. returned.  If no  <result>  is  specified,  NIL is  returned.  When  the
  4103. DOLIST is finished  execution,  the  <symbol>  that was defined  will no
  4104. longer exist or retain its value.  If the  <list-expr> is an empty list,
  4105. then no loop execution takes place and the <result> is returned.
  4106.  
  4107. EXAMPLES
  4108.  
  4109.     (dolist (i () "done")            ; DOLIST with I loop variable
  4110.         (print "here"))            ;   an empty list 
  4111.                         ;   and a return value
  4112.                             ;   returns "done"    
  4113.  
  4114.     (dolist (x '(a b c) "fini")         ; DOLIST with X loop variable
  4115.         (princ x))            ;   a list with (A B C)
  4116.                         ;   and a return value
  4117.                             ;   prints  ABC   returns "fini"
  4118.  
  4119.     (dolist (y '(1 2 3))             ; DOLIST with Y loop variable
  4120.         (princ (* y y)))        ;   a list with (1 2 3)
  4121.                         ;   and no return value
  4122.                         ;   prints  149   returns NIL
  4123.                         ;   returns "met in the middle"
  4124.  
  4125.  
  4126. dotimes
  4127. ________________________________________________________________________
  4128.  
  4129. type: special form (fsubr)
  4130. location: built-in
  4131. source file: xlcont.c
  4132. Common LISP compatible: yes
  4133. supported on: all machines
  4134.  
  4135. SYNTAX
  4136.  
  4137. (dotimes  ( <symbol> <end-expr> [ <result> ] ) [ <expr> ... ]  )
  4138.     <symbol>    -    a symbol
  4139.     <end-expr>    -    an integer expression 
  4140.     <result>    -    an optional expression for the returned result
  4141.     <expr>        -    expressions comprising the body of the loop
  4142.                 which may contain RETURNs, GOs or tags for GO  
  4143.  
  4144. DESCRIPTION
  4145.  
  4146. The DOTIMES  special form is basically a 'for'  looping  construct  that
  4147. contains a loop  <symbol>, an <end-expr>  to specify the final value for
  4148. <symbol>, an optional return value and a block of code  (expressions) to
  4149. evaluate.  The sequence of execution is:
  4150.  
  4151.         <symbol>  := 0
  4152.         while  <symbol> value is not equal to <end-expr> value
  4153.             loop code execution
  4154.             <symbol>  := <symbol> + 1
  4155.         end-while
  4156.         return <result>
  4157.  
  4158. The main loop  <symbol>  will take on  successive  values  from  zero to
  4159. (<end-expr>  - 1).  The  DOTIMES  form will go through  and  create  and
  4160. initialize the <symbol> to zero.  After  execution of the loop <expr>'s,
  4161. the <symbol>  value is  incremented.  This continues  until the <symbol>
  4162. value is equal to  <end-expr>.  The value of the <result>  expression is
  4163. evaluated and  returned.  If no <result> is specified,  NIL is returned.
  4164. When the DOTIMES is finished  execution,  the <symbol>  that was defined
  4165. will no longer exist or retain its value.  If the  <end-expr> is zero or
  4166. less, then there will be no execution of the loop body's code.
  4167.  
  4168. EXAMPLES
  4169.  
  4170.     (dotimes (i 4 "done") (princ i))    ; prints  0123   returns "done"
  4171.     (dotimes (i 4)        (princ i))    ; prints  0123   returns NIL
  4172.     (dotimes (i 1)        (princ i))    ; prints  0      returns NIL
  4173.     (dotimes (i 0)        (princ i))    ; returns NIL
  4174.     (dotimes (i -9)       (princ i))    ; returns NIL
  4175.  
  4176.  
  4177. dribble
  4178. ________________________________________________________________________
  4179.  
  4180. type: function (subr)  
  4181. location: built-in
  4182. source file: xlisp.c  xlsys.c  msstuff.c 
  4183. Common LISP compatible: yes
  4184. supported on: all machines
  4185.  
  4186. SYNTAX
  4187.  
  4188. (transcript [ <file-str> ] )
  4189.     <file-str>    -    a string expression for a file name
  4190.  
  4191. DESCRIPTION
  4192.  
  4193. The DRIBBLE function, when called with a <file-str>  argument, opens the
  4194. specified  file and  records a  transcript  of the XLISP  session.  When
  4195. DRIBBLE is called with no  <file-str>  argument,  it closes the  current
  4196. transcript  file  (if  any).  DRIBBLE  will  return  T if the  specified
  4197. <file-str>  was  successfully  opened.  It  will  return  a NIL  if  the
  4198. <file-str>  was not opened  successfully  or if DRIBBLE was evaluated to
  4199. close a transcript.
  4200.  
  4201. EXAMPLES
  4202.  
  4203.     (dribble "my-trans-file")        ; open file "my-trans-file"
  4204.                         ; for a session transcript
  4205.     (+ 2 2)                    
  4206.     (dribble)                ; close the transcript
  4207.  
  4208. NOTE:
  4209. It is also possible to start a transcript when invoking XLISP.  To start
  4210. xlisp with a transcript file of 'myfile' type in "xlisp -tmyfile".
  4211.  
  4212. NOTE:
  4213. The DRIBBLE  function  works in XLISP 2.0 for MS-DOS  systems.  However,
  4214. depending  on the  sources  you use - or where  you got  XLISP  2.0, the
  4215. generic  (non-DOS)  systems  might  not have the  appropriate  code  for
  4216. DRIBBLE to work properly.
  4217.  
  4218.  
  4219. endp
  4220. ________________________________________________________________________
  4221.  
  4222. type: predicate function (subr)
  4223. location: built-in
  4224. source file: xlbfun.c
  4225. Common LISP compatible: yes
  4226. supported on: all machines
  4227.  
  4228. SYNTAX
  4229.  
  4230. (endp <list> )
  4231.     <list>        -    the list to check
  4232.  
  4233. DESCRIPTION
  4234.  
  4235. The ENDP  predicate  checks  to see if  <list>  is an empty  list.  T is
  4236. returned  if the list is empty,  NIL is  returned  if the  <list> is not
  4237. empty.  The <list> has to be a valid  list.  An error is returned  if it
  4238. is not a list.
  4239.  
  4240. EXAMPLES
  4241.  
  4242.     (endp '())                ; returns T - empty list
  4243.     (endp ())                ; returns T - still empty
  4244.     (endp '(a b c))                ; returns NIL
  4245.  
  4246.     (setq a NIL)                ; set up a variable
  4247.     (endp a)                ; returns T - value = empty list
  4248.  
  4249.     (endp "a")                ; error: bad argument type - "a"
  4250.     (endp 'a)                ; error: bad argument type - A
  4251.  
  4252. NOTE:
  4253. The ENDP predicate is different from the NULL and NOT predicates in that
  4254. it requires a valid list.
  4255.  
  4256.  
  4257. eq
  4258. ________________________________________________________________________
  4259.  
  4260. type: predicate function (subr)
  4261. location: built-in
  4262. source file: xllist.c and xlsubr.c
  4263. Common LISP compatible: yes
  4264. supported on: all machines
  4265.  
  4266. SYNTAX
  4267.  
  4268. (eq <expr1> <expr2> )
  4269.     <exprN>        -    an expression to compare
  4270.  
  4271. DESCRIPTION
  4272.  
  4273. The EQ predicate  checks to see if <expr1> and <expr2> are identical.  T
  4274. is returned if they are exactly the same internal value, NIL is returned
  4275. otherwise.
  4276.  
  4277. EXAMPLES
  4278.  
  4279.     (eq 'a 'a)                ; returns T
  4280.     (eq 1 1)                ; returns T
  4281.     (eq 1 1.0)                ; returns NIL
  4282.     (eq 1.0 1.0)                ; returns NIL
  4283.     (eq "a" "a")                ; returns NIL
  4284.     (eq '(a b) '(a b))            ; returns NIL
  4285.     (eq 'a 34)                ; returns NIL
  4286.  
  4287.     (setq a '(a b))                ; set value of A to (A B)
  4288.     (setq b a)                ; set B to point to A's value
  4289.     (setq c '(a b))                ; set value of C to dif. (A B)
  4290.     (eq a b)                ; returns T
  4291.     (eq a c)                 ; returns NIL 
  4292.  
  4293.  
  4294. eql
  4295. ________________________________________________________________________
  4296.  
  4297. type: predicate function (subr)
  4298. location: built-in
  4299. source file: xllist.c and xlsubr.c
  4300. Common LISP compatible: yes
  4301. supported on: all machines
  4302.  
  4303. SYNTAX
  4304.  
  4305. (eql <expr1> <expr2> )
  4306.     <exprN>        -    an expression to compare
  4307.  
  4308. DESCRIPTION
  4309.  
  4310. The EQL predicate checks to see if <expr1> and <expr2> are identical (in
  4311. the EQ test sense - the expression  values being the same exact internal
  4312. values) or if they have the same value when the expressions are numbers.
  4313. T is returned if they are identical or have the same numeric  value, NIL
  4314. is returned otherwise.
  4315.  
  4316. EXAMPLES
  4317.  
  4318.     (eql 'a 'a)                ; returns T
  4319.     (eql 1 1)                ; returns T
  4320.     (eql 1 1.0)                ; returns NIL
  4321.     (eql 1.0 1.0)                ; returns T
  4322.     (eql "a" "a")                ; returns NIL
  4323.     (eql '(a b) '(a b))            ; returns NIL
  4324.     (eql 'a 34)                ; returns NIL
  4325.  
  4326.     (setq a '(a b))                ; set value of A to (A B)
  4327.     (setq b a)                ; set B to point to A's value
  4328.     (setq c '(a b))                ; set value of C to dif. (A B)
  4329.     (eql a b)                ; returns T
  4330.     (eql a c)                 ; returns NIL 
  4331.  
  4332.  
  4333. equal
  4334. ________________________________________________________________________
  4335.  
  4336. type: predicate function (subr)
  4337. location: built-in
  4338. source file: xllist.c and xlsubr.c
  4339. Common LISP compatible: yes
  4340. supported on: all machines
  4341.  
  4342. SYNTAX
  4343.  
  4344. (equal <expr1> <expr2> )
  4345.     <exprN>        -    an expression to compare
  4346.  
  4347. DESCRIPTION
  4348.  
  4349. The  EQUAL   predicate   checks  to  see  if  <expr1>  and  <expr2>  are
  4350. structurally  equivalent.  T is returned if they are equivalent,  NIL is
  4351. returned otherwise.
  4352.  
  4353. EXAMPLES
  4354.  
  4355.     (equal 'a 'a)                ; returns T
  4356.     (equal 1 1)                ; returns T
  4357.     (equal 1 1.0)                ; returns NIL
  4358.     (equal 1.0 1.0)                ; returns T
  4359.     (equal "a" "a")                ; returns T
  4360.     (equal '(a b) '(a b))            ; returns T
  4361.     (equal 'a 34)                ; returns NIL
  4362.  
  4363.     (setq a '(a b))                ; set value of A to (A B)
  4364.     (setq b a)                ; set B to point to A's value
  4365.     (setq c '(a b))                ; set value of C to dif. (A B)
  4366.     (equal a b)                ; returns T
  4367.     (equal a c)                 ; returns T
  4368.  
  4369.     (equal '(a b) '(A B))            ; returns T
  4370.     (equal '(a b) '(c d))            ; returns NIL
  4371.     (equal "a" "A")                ; returns NIL
  4372.     (equal "abc" "abcD")            ; returns NIL
  4373.  
  4374. NOTE:
  4375. A way to view EQUAL is that if <expr1> and  <expr2>  were  printed  (via
  4376. PRINT or PRINC), if they look the same, then EQUAL will return T.
  4377.  
  4378.  
  4379. error
  4380. ________________________________________________________________________
  4381.  
  4382. type: function (subr) 
  4383. location: built-in
  4384. source file: xlbfun.c  and  xldbug.c
  4385. Common LISP compatible: similar
  4386. supported on: all machines
  4387.  
  4388. SYNTAX
  4389.  
  4390. (error  <err-msg>  [ <arg> ] )
  4391.     <err-msg>    -    a string expression for the error message
  4392.     <arg>        -    an optional expression 
  4393.  
  4394. DESCRIPTION
  4395.  
  4396. The ERROR function allows the generation of a non-correctable  error.  A
  4397. non-correctable  error  requires  evaluation  of a CLEAN-UP or TOP-LEVEL
  4398. function from within the XLISP break loop to return to normal execution.
  4399. The form of the message generated is:
  4400.  
  4401.     error: <err-msg> - <arg>
  4402.  
  4403. From within the  break-loop, if a CONTINUE  function is evaluated then a
  4404. an error message is generated - "error:  this error can't be continued".
  4405. There is no return from the ERROR function.
  4406.  
  4407. EXAMPLES
  4408.  
  4409.     (error "fee" "fi")            ; ERROR generates the message -
  4410.                         ; error: fee - "fi"
  4411.     (error "can't get" "there")        ; ERROR generates the message -
  4412.                         ; error: Can't get - "there"
  4413.  
  4414. COMMON LISP COMPATIBILITY:
  4415. Common  LISP and XLISP  have the same  basic  form and style for  ERROR.
  4416. However, the <err-msg>  string in Common LISP is sent to FORMAT.  FORMAT
  4417. is a output  function that takes in format strings that include  control
  4418. information.  Although,  XLISP does have the FORMAT  function, it is not
  4419. used with error  messages.  Porting  from XLISP to Common LISP will work
  4420. fine.  When  porting  from Common  LISP to XLISP, you will need to check
  4421. for this embedded control information in the error messages.
  4422.  
  4423. NOTE:
  4424. Remember  that  *BREAKENABLE*  needs to non-NIL for ERROR and CERROR and
  4425. system  errors  to be  caught  by  the  normal  system  break  loop.  If
  4426. *BREAKENABLE*  is NIL, ERROR and CERROR and system  errors can be caught
  4427. by an ERRSET form.  If there is no surrounding  ERRSET, no error message
  4428. is generated and the break loop is not entered.
  4429.  
  4430.  
  4431. *error-output*
  4432. ________________________________________________________________________
  4433.  
  4434. type: system variable 
  4435. location: built-in
  4436. source file: xlinit.c  xlio.c
  4437. Common LISP compatible: yes
  4438. supported on: all machines
  4439.  
  4440. SYNTAX
  4441.  
  4442. *error-output*
  4443.  
  4444.  
  4445. DESCRIPTION
  4446.  
  4447. *ERROR-OUTPUT*  is a system  variable  that contains a file pointer that
  4448. points to the file where all error output goes to.  The default file for
  4449. *ERROR-OUTPUT*  is the  system  standard  error  device -  normally  the
  4450. screen.
  4451.  
  4452. EXAMPLES
  4453.     *error-output*                ; returns #<File-Stream: #243de>
  4454.  
  4455. NOTE:
  4456. *TRACE-OUTPUT*,  *DEBUG-IO* and  *ERROR-OUTPUT*  are normally all set to
  4457. the same file stream - STDERR.
  4458.  
  4459.  
  4460. errset
  4461. ________________________________________________________________________
  4462.  
  4463. type: special form (fsubr)
  4464. location: built-in
  4465. source file: xlcont.c
  4466. Common LISP compatible: no
  4467. supported on: all machines
  4468.  
  4469. SYNTAX
  4470.  
  4471. (errset  <expr> [ <print-flag> ]  )
  4472.     <expr>        -    an expression to be evaluated
  4473.     <print-flag>    -    an optional expression ( NIL or non-NIL )
  4474.  
  4475. DESCRIPTION
  4476.  
  4477. The ERRSET  special  form is a  mechanism  that allows the  trapping  of
  4478. errors within the execution of <expr>.  *BREAKENABLE* must be set to NIL
  4479. for the ERRSET  form to  function.  If  *BREAKENABLE*  is  non-NIL,  the
  4480. normal break loop will handle the error.  For ERRSET, if no error occurs
  4481. within <expr>, the value of the last  expression is CONSed with NIL.  If
  4482. an error occurs  within  <expr>, the error is caught by ERRSET and a NIL
  4483. is returned  from  ERRSET.  If  <print-flag>  is NIL, the error  message
  4484. normally  generated by <expr> will not be printed.  If  <print-flag>  is
  4485. non-NIL or not  present in the ERRSET  form, the error  message  will be
  4486. printed.
  4487.  
  4488. Errors  from  ERROR and CERROR and  system  errors  will be  handled  by
  4489. ERRSET.  Note  that the  CERROR  message  will only  include  the  error
  4490. message  portion,  not  the  continue  message  portion.  BREAK  is  not
  4491. intercepted by ERRSET.
  4492.  
  4493. EXAMPLES
  4494.  
  4495.     (nodebug)                ; sets *BREAKENABLE* to NIL
  4496.     (errset (error "hi" "ho"))        ; prints  error: hi - "ho"
  4497.                         ; returns NIL
  4498.     (errset (cerror "hi" "ho" "he"))    ; prints  error: ho - "he"
  4499.                         ; returns NIL
  4500.     (errset (error "hey" "ho") NIL)        ; returns NIL
  4501.     (errset (break "hey"))            ; break: hey
  4502.     (errset (+ 1 5) )            ; returns (6)
  4503.     (errset (+ 1 "a") NIL )            ; returns NIL
  4504.     (debug)                    ; re-enable break-loop on errors
  4505.  
  4506. NOTE:
  4507. Be sure to set  *BREAKENABLE*  to NIL before using ERRSET and to non-NIL
  4508. after using ERRSET.  If you don't reset *BREAKENABLE*, no errors will be
  4509. reported.
  4510.  
  4511.  
  4512. eval
  4513. ________________________________________________________________________
  4514.  
  4515. type: function (subr) 
  4516. location: built-in
  4517. source file: xlbfun.c  and  xleval.c
  4518. Common LISP compatible: yes
  4519. supported on: all machines
  4520.  
  4521. SYNTAX
  4522.  
  4523. (eval <expression> )
  4524.     <expression>    -    An arbitrary expression
  4525.  
  4526. DESCRIPTION
  4527.  
  4528. EVAL evaluates the <expression> and returns the resulting value.
  4529.  
  4530. EXAMPLES
  4531.  
  4532.     (eval '(+ 2 2))                ; returns 4
  4533.     (eval (cons '+ '(2 2 2)))        ; returns 6
  4534.     (eval (list '+ '2 '3 ))            ; returns 5
  4535.  
  4536.     (setq a 10)                ; set up A with value 10    
  4537.     (setq b 220)                ; set up B with value 220
  4538.     (eval (list '+ a b ))            ; returns 230 because
  4539.                         ;  (list '+ a b) => '(+ 10 220)
  4540.     (eval (list '+ 'a b))            ; returns 230 because
  4541.                         ;  (list '+ 'a b) => '(+ A 220)
  4542.                         ;  and A has the value 10
  4543.  
  4544.  
  4545. evalhook
  4546. ________________________________________________________________________
  4547.  
  4548. type: function (subr)
  4549. location: built-in
  4550. source file: xlbfun.c  and  xleval.c
  4551. Common LISP compatible: related
  4552. supported on: all machines
  4553.  
  4554. SYNTAX
  4555.  
  4556. (evalhook  <expr> <eval-expr> <apply-expr> [ <env> ] )
  4557.     <expr>        -    an expression to evaluate
  4558.     <eval-expr>    -    an expression for the evaluation routine
  4559.     <apply-expr>    -    an expression for APPLY - not used
  4560.     <env>        -    an environment expression - default is NIL
  4561.  
  4562. DESCRIPTION
  4563.  
  4564. EVALHOOK is a function that performs  evaluation.  The routine specified
  4565. by  <eval-expr>  is called  with the  <expr>  and <env>  parameters.  If
  4566. <eval-expr>  is NIL, then the normal  system  evaluator  is called.  The
  4567. <apply-hook> is a dummy  parameter that is not used in the current XLISP
  4568. system.  The <expr>  contains the  expression  to be  evaluated.  If the
  4569. <env>  argument  to  EVALHOOK  is not  specified,  NIL  is  used,  which
  4570. specifies  to  use  the  current  global   environment.  The  <env>,  if
  4571. specified, is a structure  composed of dotted pairs  constructed  of the
  4572. symbol and its value which have the form ((( (<sym1> .  <val1> ) (<sym2>
  4573. .  <val2> ) ...  ))).
  4574.  
  4575. EXAMPLES
  4576.  
  4577.     (setq a 100)    (setq b 200)        ; set up global values
  4578.     (evalhook '(+ a b) NIL NIL)        ; returns 300    - no <env>
  4579.     (evalhook '(+ a b) NIL NIL         ; eval with a=1 and b=2
  4580.           '((((a . 1)(b . 2)))))    ;   returns 3
  4581.  
  4582.  
  4583.     (defun myeval (exp env)            ; define MYEVAL routine
  4584.        (princ "exp: ") (print exp)        ; 
  4585.        (princ "env: ") (print env)        ;
  4586.        (evalhook exp #'myeval NIL env))    ;
  4587.     (defun foo (a) (+ a a))            ; create simple function
  4588.     (setq *evalhook* #'myeval)        ; and install MYEVAL as hook
  4589.     (foo 1)                    ; prints  
  4590.                         ; exp: (FOO 1) env:NIL
  4591.                         ; exp: 1       env:NIL
  4592.                         ; exp: (+ A A) env:((((A . 1))))
  4593.                         ; exp: A       env:((((A . 1))))
  4594.                         ; exp: A       env:((((A . 1))))
  4595.                         ; returns 2
  4596.     (top-level)                ; to clean up *evalhook*)
  4597.  
  4598. NOTE:
  4599. The EVALHOOK  function and *EVALHOOK* system variable are very useful in
  4600. the  construction of debugging  facilities  within XLISP.  The TRACE and
  4601. UNTRACE  functions  use  EVALHOOK  and  *EVALHOOK*  to  implement  their
  4602. functionality.  The other useful aspect of EVALHOOK and *EVALHOOK* is to
  4603. help in  understanding  how XLISP  works to see the  expressions,  their
  4604. environment and how they are evaluated.
  4605.  
  4606. CAUTION:
  4607. Be careful when using  *EVALHOOK*  and  EVALHOOK.  If you put in a 'bad'
  4608. definition  into  *EVALHOOK*,  you might not be able to do anything  and
  4609. will need to exit XLISP.
  4610.  
  4611. UNUSUAL BEHAVIOUR:
  4612. The EVALHOOK  function and *EVALHOOK*  system variable, by their nature,
  4613. cause some unusual  things to happen.  After you have set  *EVALHOOK* to
  4614. some non-NIL value, your function will be called.  However, when you are
  4615. all done and set  *EVALHOOK*  to NIL or some other new  routine, it will
  4616. never be set.  This is because the  XEVALHOOK  function (in the xlbfun.c
  4617. source  file)  saves the old value of  *EVALHOOK*  before  calling  your
  4618. routine, and then  restores it after the  evaluation.  The  mechanism to
  4619. reset  *EVALHOOK*  is to execute  the  TOP-LEVEL  function,  which  sets
  4620. *EVALHOOK* to NIL.
  4621.  
  4622.  
  4623. *evalhook*
  4624. ________________________________________________________________________
  4625.  
  4626. type: system variable 
  4627. location: built-in
  4628. source file: xleval.c
  4629. Common LISP compatible: related
  4630. supported on: all machines
  4631.  
  4632. SYNTAX
  4633.  
  4634. *evalhook*
  4635.  
  4636.  
  4637. DESCRIPTION
  4638.  
  4639. *EVALHOOK*  is a system  variable  whose  value is user  code  that will
  4640. intercept evaluations either through normal system evaluation or through
  4641. calls to  EVALHOOK.  The  default  value for  *EVALHOOK*  is NIL,  which
  4642. specifies  to use the  built  in  system  evaluator.  If  *EVALHOOK*  is
  4643. non-NIL,  the  routine  is  called  with   expression  and   environment
  4644. parameters.  If the  environment  argument is NIL, then the the  current
  4645. global environment is used.  The environment, if non-NIL, is a structure
  4646. composed of dotted pairs  constructed  of the symbol and its value which
  4647. have the form ((( (<sym1> .  <val1> ) (<sym2> .  <val2> ) ...  ))).
  4648.  
  4649. EXAMPLES
  4650.     (defun myeval (exp env)            ; define MYEVAL routine
  4651.        (princ "exp: ") (print exp)        ; 
  4652.        (princ "env: ") (print env)        ;
  4653.        (evalhook exp #'myeval NIL env))    ;
  4654.     (defun foo (a) (+ a a))            ; create simple function
  4655.     (setq *evalhook* #'myeval)        ; and install MYEVAL as hook
  4656.     (foo 1)                    ; prints  
  4657.                         ; exp: (FOO 1) env:NIL
  4658.                         ; exp: 1       env:NIL
  4659.                         ; exp: (+ A A) env:((((A . 1))))
  4660.                         ; exp: A       env:((((A . 1))))
  4661.                         ; exp: A       env:((((A . 1))))
  4662.                         ; returns 2
  4663.     (top-level)                ; to clean up *evalhook*)
  4664.  
  4665. NOTE:
  4666. The EVALHOOK  function and *EVALHOOK* system variable are very useful in
  4667. the  construction of debugging  facilities  within XLISP.  The TRACE and
  4668. UNTRACE  functions  use  EVALHOOK  and  *EVALHOOK*  to  implement  their
  4669. functionality.  The other useful aspect of EVALHOOK and *EVALHOOK* is to
  4670. help in  understanding  how XLISP  works to see the  expressions,  their
  4671. environment and how they are evaluated.
  4672.  
  4673. CAUTION:
  4674. Be careful when using  *EVALHOOK*  and  EVALHOOK.  If you put in a 'bad'
  4675. definition  into  *EVALHOOK*,  you might not be able to do anything  and
  4676. will need to exit XLISP.
  4677.  
  4678. UNUSUAL BEHAVIOUR:
  4679. The EVALHOOK  function and *EVALHOOK*  system variable, by their nature,
  4680. cause some unusual  things to happen.  After you have set  *EVALHOOK* to
  4681. some non-NIL value, your function will be called.  However, when you are
  4682. all done and set  *EVALHOOK*  to NIL or some other new  routine, it will
  4683. never be set.  This is because the  XEVALHOOK  function (in the xlbfun.c
  4684. source  file)  saves the old value of  *EVALHOOK*  before  calling  your
  4685. routine, and then  restores it after the  evaluation.  The  mechanism to
  4686. reset  *EVALHOOK*  is to execute  the  TOP-LEVEL  function,  which  sets
  4687. *EVALHOOK* to NIL.
  4688.  
  4689.  
  4690. evenp
  4691. ________________________________________________________________________
  4692.  
  4693. type: predicate function (subr)
  4694. location: built-in
  4695. source file: xlmath.c
  4696. Common LISP compatible: yes
  4697. supported on: all machines
  4698.  
  4699. SYNTAX
  4700.  
  4701. (evenp <expr> )
  4702.     <expr>        -    the integer numeric expression to check
  4703.  
  4704. DESCRIPTION
  4705.  
  4706. The EVENP  predicate  checks to see if the number  <expr> is even.  T is
  4707. returned  if the  number  is  even,  NIL is  returned  otherwise.  A bad
  4708. argument  type  error  is  generated  if the  <expr>  is  not a  numeric
  4709. expression.  A bad floating  point  operation is generated if the <expr>
  4710. is a floating point number.  Zero is an even number.
  4711.  
  4712. EXAMPLES
  4713.  
  4714.     (evenp 0)                ; returns T
  4715.     (evenp 1)                ; returns NIL
  4716.     (evenp 2)                ; returns T
  4717.     (evenp -1)                ; returns NIL
  4718.     (evenp -2)                ; returns T
  4719.  
  4720.     (evenp 14.0)                ; error: bad flt. pt. op.
  4721.     (evenp 'a)                ; error: bad argument type
  4722.     (setq a 2)                ; set value of A to 2
  4723.     (evenp a)                ; returns T
  4724.  
  4725.  
  4726. exit
  4727. ________________________________________________________________________
  4728.  
  4729. type: function (subr) 
  4730. location: built-in
  4731. source file: xlsys.c
  4732. Common LISP compatible: yes
  4733. supported on: all machines
  4734.  
  4735. SYNTAX
  4736.  
  4737. (exit)
  4738.  
  4739.  
  4740. DESCRIPTION
  4741.  
  4742. The EXIT function causes the current XLISP session to be terminated.  It
  4743. never returns.
  4744.  
  4745. EXAMPLES
  4746.  
  4747.     (exit)                    ; never returns
  4748.  
  4749. KEYSTROKE EQUIVALENT:
  4750. In the IBM PC and MS-DOS  versions of XLISP, a CTRL-z key  sequence  has
  4751. the  same  effect  as  doing  a  (EXIT).  On a  Macintosh,  this  can be
  4752. accomplished by a pull-down menu or a COMMAND-q.
  4753.  
  4754. NOTE:
  4755. When  XLISP is EXITed,  any  TRANSCRIPT  file is  automatically  closed.
  4756. However,  other  open  files  are  not  closed,  and  so may  lose  some
  4757. information.
  4758.  
  4759.  
  4760. exp
  4761. ________________________________________________________________________
  4762.  
  4763. type: function (subr) 
  4764. location: built-in
  4765. source file: xlmath.c
  4766. Common LISP compatible: yes
  4767. supported on: all machines
  4768.  
  4769. SYNTAX
  4770.  
  4771. (exp <power> )
  4772.     <power>        -    floating point number/expression
  4773.  
  4774. DESCRIPTION
  4775.  
  4776. The EXP function  calculates e (2.7128) raised to the specified  <power>
  4777. and returns the result.
  4778.  
  4779. EXAMPLES
  4780.  
  4781.     (exp 0.0)                ; returns 1
  4782.     (exp 1.0)                ; returns 2.71828  (e)
  4783.     (exp 2.0)                ; returns 7.38906
  4784.     (exp 10.0)                ; returns 22026.5
  4785.     (exp 0)                    ; error: bad integer operation
  4786.  
  4787. NOTE:
  4788. EXP with a large  <power> like 1000.0  causes an  incorrect  value to be
  4789. generated,  with no  error.  The  returned  value  will be a very  large
  4790. floating  point  number  near  the  computer's   limit  (something  like
  4791. 1.79000e+308).
  4792.  
  4793.  
  4794. expand
  4795. ________________________________________________________________________
  4796.  
  4797. type: function (subr) 
  4798. location: built-in
  4799. source file: xlsys.c  and  xldmem.c
  4800. Common LISP compatible: no
  4801. supported on: all machines
  4802.  
  4803. SYNTAX
  4804.  
  4805. (expand  <segments> )
  4806.     <segments>    -    an integer expression
  4807.  
  4808. DESCRIPTION
  4809.  
  4810. The  EXPAND  function   expands  memory  by  the  specified   number  of
  4811. <segments>.  The  expression  <segments> is returned as the result.  The
  4812. power up default is 1000 nodes per segment.  Note that ALLOC  allows you
  4813. to change the number of nodes per segment.
  4814.  
  4815. EXAMPLES
  4816.  
  4817.     (room)                    ; prints  Nodes:       8000
  4818.                         ;      Free nodes:  5622
  4819.                         ;      Segments:    6
  4820.                         ;      Allocate:    1000
  4821.                         ;      Total:       92586
  4822.                         ;      Collections: 8
  4823.                         ; returns NIL
  4824.     (expand 2)                ; add more nodes
  4825.     (room)                    ; prints  Nodes:       10000
  4826.                         ;      Free nodes:  7608
  4827.                         ;      Segments:    8
  4828.                         ;      Allocate:    1000
  4829.                         ;      Total:       112602
  4830.                         ;      Collections: 8
  4831.                         ; returns NIL
  4832.  
  4833. NOTE:
  4834. When GC is called or an  automatic  garbage  collection  occurs,  if the
  4835. amount of free  memory is still low after the  garbage  collection,  the
  4836. system attempts to add more segments (an automatic EXPAND).
  4837.  
  4838.  
  4839. expt
  4840. ________________________________________________________________________
  4841.  
  4842. type: function (subr) 
  4843. location: built-in
  4844. source file: xlmath.c
  4845. Common LISP compatible: yes
  4846. supported on: all machines
  4847.  
  4848. SYNTAX
  4849.  
  4850. (expt <expr> [ <power> ... ] )
  4851.     <expr>        -    floating point number/expression
  4852.     <power>        -    integer or floating point number/expression
  4853.  
  4854. DESCRIPTION
  4855.  
  4856. The EXPT function raises the <expr> to the specified <power> and returns
  4857. the result.  If there is no <power>  specified,  the <expr> is returned.
  4858. If there are multiple  <power>'s, they will be applied  sequentially  to
  4859. <expr>.
  4860.  
  4861. EXAMPLES
  4862.  
  4863.     (expt 2.0 2)                ; returns 4
  4864.     (expt 2.0 10)                ; returns 1024
  4865.     (expt 2 2)                ; error: bad integer operation
  4866.     (expt 99.9)                ; returns 99.9
  4867.     (expt 2.0 2.0 2.0)            ; returns 16
  4868.  
  4869. NOTE:
  4870. EXPT with a large  values like (expt 999.9  999.9)  causes an  incorrect
  4871. value to be generated, with no error.  The returned value will be a very
  4872. large floating point number near the computer's  limit  (something  like
  4873. 1.79000e+308).
  4874.  
  4875.  
  4876. fboundp
  4877. ________________________________________________________________________
  4878.  
  4879. type: predicate function (subr)
  4880. location: built-in
  4881. source file: xlbfun.c
  4882. Common LISP compatible: yes
  4883. supported on: all machines
  4884.  
  4885. SYNTAX
  4886.  
  4887. (fboundp <symbol> )
  4888.     <symbol>    -    the symbol expression to check for a value
  4889.  
  4890. DESCRIPTION
  4891.  
  4892. The  FBOUNDP  predicate  checks to see if  <symbol>  is a symbol  with a
  4893. function  definition  (closure)  bound to it.  T is returned if <symbol>
  4894. has a function value, NIL is returned  otherwise.  Note that <symbol> is
  4895. a symbol  expression - it is evaluated and the  resulting  expression is
  4896. the one that is checked.
  4897.  
  4898. EXAMPLES
  4899.  
  4900.     (defun foo (x) (print x))        ; set up function FOO
  4901.     (fboundp 'foo)                ; returns T - value is closure
  4902.     (fboundp 'defvar)            ; returns T - value is closure
  4903.     (fboundp 'car)                ; returns T - value is closure
  4904.  
  4905.     (setq myvar 'goo)            ; set up MYVAR to have value GOO
  4906.     (FBOUNDP myvar)                ; returns NIL - because GOO has
  4907.                         ;               no value yet
  4908.     (defmacro goo () (print "hi"))        ; define GOO macro
  4909.     (FBOUNDP myvar)                ; returns T
  4910.  
  4911.     (fboundp 'a)                ; returns NIL 
  4912.     (fboundp '1)                ; error: bad argument type - 1
  4913.     (fboundp "hi")                ; error: bad argument type - "hi"
  4914.  
  4915.  
  4916. first
  4917. ________________________________________________________________________
  4918.  
  4919. type: function (subr) 
  4920. location: built-in
  4921. source file: xlinit.c
  4922. Common LISP compatible: yes
  4923. supported on: all machines
  4924.  
  4925. SYNTAX
  4926.  
  4927. (first <expr> )
  4928.     <expr>        -    a list or list expression
  4929.  
  4930. DESCRIPTION
  4931.  
  4932. FIRST  returns  the  first  element  of the  expression.  If  the  first
  4933. expression  is itself a list, then the sublist is returned.  If the list
  4934. is NIL, NIL is returned.
  4935.  
  4936. EXAMPLES
  4937.     (first '(a b c))            ; returns A
  4938.     (first '((a b) c d))            ; returns (A B)
  4939.     (first NIL)                ; returns NIL
  4940.     (first 'a)                ; error: bad argument type
  4941.  
  4942.     (setq children '(amanda ben))        ; set up variable CHILDREN
  4943.     (first children)            ; returns AMANDA
  4944.  
  4945. flatc
  4946. ________________________________________________________________________
  4947.  
  4948. type: function (subr) 
  4949. location: built-in
  4950. source file: xlfio.c  and  xlprin.c
  4951. Common LISP compatible: no
  4952. supported on: all machines
  4953.  
  4954. SYNTAX
  4955.  
  4956. (flatc  <expr> )
  4957.     <expr>        -    an expression
  4958.  
  4959. DESCRIPTION
  4960.  
  4961. The FLATC function determines the character length that would be printed
  4962. if the  <expr>  were  printed  using  PRINC.  This means that the <expr>
  4963. would be  printed  without a  new-line.  If <expr> is a string, it would
  4964. not be printed  with  quotes  around  the  string.  The print  character
  4965. length is returned as the result.
  4966.  
  4967. EXAMPLES
  4968.  
  4969.     (flatc 1234)                ; returns 4
  4970.     (flatc '(a b c))            ; returns 7
  4971.     (flatc "abcd")                ; returns 4
  4972.     (flatc 'mybigsymbol)            ; returns 11
  4973.  
  4974.  
  4975. flatsize
  4976. ________________________________________________________________________
  4977.  
  4978. type: function (subr) 
  4979. location: built-in
  4980. source file: xlfio.c  and  xlprin.c
  4981. Common LISP compatible: no
  4982. supported on: all machines
  4983.  
  4984. SYNTAX
  4985.  
  4986. (flatsize  <expr> )
  4987.     <expr>        -    an expression
  4988.  
  4989. DESCRIPTION
  4990.  
  4991. The FLATSIZE  function  determines  the  character  length that would be
  4992. printed if the <expr>  were  printed  using  PRIN1.  This means that the
  4993. <expr>  would be printed  without a new-line.  If <expr> is a string, it
  4994. would be printed  with quotes  around the  string.  The print  character
  4995. length is returned as the result.
  4996.  
  4997. EXAMPLES
  4998.  
  4999.     (flatsize 1234)                ; returns 4
  5000.     (flatsize '(a b c))            ; returns 7
  5001.     (flatsize "abcd")            ; returns 6
  5002.     (flatsize 'mybigsymbol)            ; returns 11
  5003.  
  5004.  
  5005. flet
  5006. ________________________________________________________________________
  5007.  
  5008. type: special form (fsubr)
  5009. location: built-in
  5010. source file: xlcont.c
  5011. Common LISP compatible: yes
  5012. supported on: all machines
  5013.  
  5014. SYNTAX
  5015.  
  5016. (flet  ( [ <function> ... ]  ) <expr> ... )
  5017.     <function>    -    a function definition binding which is of the 
  5018.                 form  ( <symbol> <arg-list> <body> )
  5019.     <symbol>    -    the symbol specifying the function name
  5020.     <arg-list>    -    the argument list for the function 
  5021.     <body>        -    the body of the function
  5022.     <expr>        -    an expression
  5023.  
  5024. DESCRIPTION
  5025.  
  5026. The FLET special form is basically a local block  construct  that allows
  5027. local  <function>  definitions  followed by a block of code to evaluate.
  5028. The first form  after the FLET is the  'binding'  form.  It  contains  a
  5029. series of  <functions>.  The FLET form will go  through  and  define the
  5030. <symbol>s of the <functions> and then sequentially execute the <expr>'s.
  5031. The value of the last <expr>  evaluated  is  returned.  When the FLET is
  5032. finished  execution,  the  <symbol>'s  that were defined  will no longer
  5033. exist.
  5034.  
  5035. EXAMPLES
  5036.  
  5037.     (flet ( (fozz (x) (+ x x) ))        ; an FLET with FOZZ local func.
  5038.         (fozz 2))                ; returns 4
  5039.                         ; FOZZ no longer exists
  5040.     (fozz 2)                ; error: unbound function - FOZZ
  5041.  
  5042.                         ; an empty flet
  5043.     (flet () (print 'a))            ; prints A
  5044.  
  5045. NOTE:
  5046. FLET  does not allow  recursive  definitions  of  functions.  The  LABEL
  5047. special form does allow this.
  5048.  
  5049.  
  5050. float
  5051. ________________________________________________________________________
  5052.  
  5053. type: function (subr) 
  5054. location: built-in
  5055. source file: xlmath.c
  5056. Common LISP compatible: yes
  5057. supported on: all machines
  5058.  
  5059. SYNTAX
  5060.  
  5061. (float <expr> )
  5062.     <expr>        -    integer or floating point number/expression
  5063.  
  5064. DESCRIPTION
  5065.  
  5066. The FLOAT  function  takes a numeric  expression  and returns the result
  5067. which is forced to be a floating point number.
  5068.  
  5069. EXAMPLES
  5070.  
  5071.     (/ 1 2)                    ; returns 0 (integer division)
  5072.     (/ (float 1) 2)                ; returns 0.5
  5073.     (float (/ 1 2))                ; returns 0 (integer division)
  5074.     (/ 1 2 3)                ; returns 0 (integer division)
  5075.     (/ (float 1) 2 3)            ; returns 0.166667
  5076.  
  5077.  
  5078. *float-format*
  5079. ________________________________________________________________________
  5080.  
  5081. type: system variable 
  5082. location: built-in
  5083. source file: xlprin.c
  5084. Common LISP compatible: no
  5085. supported on: all machines
  5086.  
  5087. SYNTAX
  5088.  
  5089. *float-format*
  5090.  
  5091.  
  5092. DESCRIPTION
  5093.  
  5094. *FLOAT-FORMAT*  is a system  variable  that allows a user to specify how
  5095. floating  point  numbers  are to be  printed  by  XLISP.  The  value  of
  5096. *FLOAT-FORMAT* should be set to one of the string expressions "%e", "%f"
  5097. or "%g".  These format strings are similar to C-language  floating point
  5098. specifications.
  5099.  
  5100.     format    name        description
  5101.     ----------------------------------------------------------------
  5102.     %e      exponential     The  number  is  converted   to  decimal
  5103.                 notation of the form [-]m.nnnnnnE[+-]xx.
  5104.                 There is one leading digit.  There are 6
  5105.                 digits after the decimal point.
  5106.  
  5107.     %f      decimal         The  number  is  converted   to  decimal
  5108.                 notation of the form  [-]mmmmmm.nnnnnn .
  5109.                 There  are as  many  digits  before  the
  5110.                 decimal point as necessary.  There are 6
  5111.                 digits after the decimal point.
  5112.  
  5113.     %g      shortest        The number is  converted  to either  the
  5114.                 form of %e or %f, whichever produces the
  5115.                 shortest output string.  Non-significant
  5116.                 zeroes are not printed.
  5117.  
  5118. The default value for *FLOAT-FORMAT* is the string "%g".  
  5119.  
  5120. EXAMPLES
  5121.     (setq *float-format* "%e")        ; exponential notation
  5122.     (print 1.0)                ; prints 1.000000e+00
  5123.     (print -9e99)                ; prints -9.000000e+99
  5124.  
  5125.     (setq *float-format* "%f")        ; decimal notation
  5126.     (print 1.0)                ; prints 1.000000
  5127.     (print 1.0e4)                ; prints 10000.000000
  5128.     (print -999.99e-99)            ; prints -0.000000
  5129.  
  5130.     (setq *float-format* "%g")        ; shortest notation
  5131.     (print 1.0)                ; prints 1
  5132.     (print 1.0e6)                ; prints 1000000
  5133.     (print 1.0e7)                ; prints 1e+07
  5134.     (print -999.999e99)            ; prints -9.99999e+101
  5135.  
  5136.     (setq *float-format* "SOMETHING")    ; bad notation
  5137.     (print 1.0)                ; prints SOMETHING
  5138.     (setq *float-format* "%g")        ; reset to shortest notation
  5139.  
  5140. NOTE:
  5141. There can be other  characters  put in the string, but in general,  this
  5142. will not produce  particularly  desirable  behaviour.  There is no error
  5143. checking performed on the format string.
  5144.  
  5145.  
  5146. floatp
  5147. ________________________________________________________________________
  5148.  
  5149. type: predicate function (subr)
  5150. location: built-in
  5151. source file: xlbfun.c
  5152. Common LISP compatible: yes
  5153. supported on: all machines
  5154.  
  5155. SYNTAX
  5156.  
  5157. (floatp <expr> )
  5158.     <expr>        -    the expression to check
  5159.  
  5160. DESCRIPTION
  5161.  
  5162. The FLOATP predicate  checks if an <expr> is a floating point number.  T
  5163. is  returned  if <expr> is a  floating  point  number,  NIL is  returned
  5164. otherwise.
  5165.  
  5166. EXAMPLES
  5167.  
  5168.     (floatp 1.2)                ; returns T - float
  5169.     (floatp '1.2)                ; returns T - still a float
  5170.     (setq a 1.234)                ; 
  5171.     (floatp a)                ; returns T - evaluates to float
  5172.     (floatp 0.0)                ; returns T - float zero
  5173.  
  5174.     (floatp 0)                ; returns NIL - integer zero
  5175.     (floatp 1)                ; returns NIL - integer
  5176.     (floatp #x034)                ; returns NIL - integer readmacro 
  5177.     (floatp 'a)                ; returns NIL - symbol
  5178.     (floatp #\a)                ; returns NIL - character
  5179.     (floatp NIL)                ; returns NIL - NIL
  5180.     (floatp #(0 1 2))            ; returns NIL - array 
  5181.  
  5182.  
  5183. fmakunbound
  5184. ________________________________________________________________________
  5185.  
  5186. type: defined function (closure)
  5187. location: extension
  5188. source file: init.lsp
  5189. Common LISP compatible: yes
  5190. supported on: all machines
  5191.  
  5192. SYNTAX
  5193.  
  5194. (fmakunbound  <symbol> )
  5195.     <symbol>    -    an expression evaluating to a symbol
  5196.  
  5197. DESCRIPTION
  5198.  
  5199. The FMAKUNBOUND  function makes a symbol's function definition  unbound.
  5200. The  <symbol>  must be a valid  symbol,  but it does  not need to have a
  5201. definition.  The FMAKUNBOUND  function returns the symbol as its result.
  5202.  
  5203. EXAMPLES
  5204.  
  5205.     (defun myfn () (print "hi"))        ; define MYFN
  5206.     (myfn)                    ; prints "hi"
  5207.     (fmakunbound 'myfn)            ; returns MYFN
  5208.     (myfn)                    ; error: unbound function - MYFN
  5209.  
  5210. NOTE:
  5211. FMAKUNBOUND is not misspelled - there is no 'e' in it.
  5212.  
  5213. NOTE:
  5214. The  FMAKUNBOUND  works on  functions  (closures)  in the same way  that
  5215. MAKUNBOUND  works on variables.  Be sure to use the correct one for what
  5216. you are unbinding.  These  functions do not generate an error if you try
  5217. to unbind the wrong  type.  This is because of the  definition  of these
  5218. functions  and the fact that the function and  variable  name spaces are
  5219. separate.  You can have both a function called FOO and a variable called
  5220. FOO.
  5221.  
  5222. NOTE:
  5223. The function  FMAKUNBOUND  is created in the INIT.LSP  file.  If it does
  5224. not  exist in your  XLISP  system,  you  might be having a problem  with
  5225. INIT.LSP.  Before  you  start  XLISP,  look  in the  directory  you  are
  5226. currently in, and check to see if there is an INIT.LSP.
  5227.  
  5228.  
  5229. format
  5230. ________________________________________________________________________
  5231.  
  5232. type: function (subr) 
  5233. location: built-in
  5234. source file: xlfio.c
  5235. Common LISP compatible: similar
  5236. supported on: all machines
  5237.  
  5238. SYNTAX
  5239.  
  5240. (format <destination> <format>  [ <expr1> ... ]  )
  5241.     <destination>     -    a required destination - must be a file 
  5242.                 pointer, a stream, NIL (to create a string) 
  5243.                 or T (to print to *standard-output*)
  5244.     <format>    -    a format string
  5245.     <exprN>        -    an expression
  5246.  
  5247. DESCRIPTION
  5248.  
  5249. The FORMAT  function  prints the specified  expressions  (if any) to the
  5250. specified  <destination>  using the <format> string to control the print
  5251. format.  If the  <destination>  is NIL, a string is created and returned
  5252. with  the  contents  of  the  FORMAT.  If  the  <destination>  is T, the
  5253. printing  occurs  to  *STANDARD-OUTPUT*.  FORMAT  returns  a NIL, if the
  5254. <destination> was non-NIL.  The <format> string is a string  (surrounded
  5255. by  double-quote  characters).  This  string  contains  ASCII text to be
  5256. printed along with  formatting  directives  (identified  by a preceeding
  5257. tilde ~ character).  The character  following the tilde character is not
  5258. case sensitive (~a and ~A will function equivalently).
  5259.  
  5260. EXAMPLES
  5261.  
  5262.     (format T "Now is the time for")    ; prints  Now is the time for
  5263.     (format T "all ~A ~S to" 'good 'men)    ; prints  all GOOD MEN to 
  5264.     (format T "come to the")        ; prints  come to the
  5265.     (format T "~A of their ~S"         ; prints  aid of their "party"
  5266.         "aid" "party")            ;
  5267.  
  5268.     (format *standard-ouput* "Hello there")    ; prints  Hello there
  5269.     (format nil "ho ho ~S" 'ho)        ; returns "ho ho HO"
  5270.  
  5271.     (format T "this is ~%a break")        ; prints  this is
  5272.                         ;         a break 
  5273.     (format T "this is a long ~
  5274.                     string")            ; prints  this is a long string
  5275.  
  5276. SUPPORTED FORMAT DIRECTIVES:
  5277. The <format> string in XLISP supports the following format directives:
  5278.  
  5279.     directive    name        action
  5280.     ----------------------------------------------------------------
  5281.     ~A        ASCII        Print the <expr>. 
  5282.  
  5283.                     If  it  is  a  string  print  it
  5284.                     without  quotes.  This  is  like
  5285.                     the PRINC function.
  5286.  
  5287.     ~S        S-EXPR        Print the <expr>. 
  5288.  
  5289.                     If it is a string  print it with
  5290.                     quotes.  This is like the  PRIN1
  5291.                     function.
  5292.  
  5293.     ~%        NEW-LINE    Print a new line. 
  5294.  
  5295.     ~~        TILDE        Print a single tilde ~ character. 
  5296.  
  5297.     ~<new-line>     CONTINUE        Continue the <format>  string on
  5298.                     the next line.
  5299.  
  5300.                     This signals a line break in the
  5301.                     format.  The FORMAT will  ignore
  5302.                     all  white-space  (blanks, tabs,
  5303.                     newlines).  This is useful  when
  5304.                     the  <format>  string is  longer
  5305.                     than a program  line.  Note that
  5306.                     the  new-line   character   must
  5307.                     immediately   follow  the  tilde
  5308.                     character.
  5309.  
  5310. COMMON LISP COMPATABILITY:
  5311. The FORMAT function in Common LISP is quite  impressive.  It includes 26
  5312. different  formatting  directives.  XLISP,  as  shown  above,  does  not
  5313. include most of these.  The more difficult ones that you might encounter
  5314. are the Decimal, Octal,  heXidecimal,  Fixed-format  floating-point  and
  5315. Exponential  floating-point.  It is  possible  to  print  in  octal  and
  5316. hexadecimal  notation  by setting  *INTEGER-FORMAT*.  It is  possible to
  5317. print  in  fixed  format  and  exponential  by  setting  *FLOAT-FORMAT*.
  5318. However,  neither of these system variables are supported in Common LISP
  5319. and neither gives control over field size.
  5320.  
  5321.  
  5322. fourth
  5323. ________________________________________________________________________
  5324.  
  5325. type: function (subr) 
  5326. location: built-in
  5327. source file: xlinit.c
  5328. Common LISP compatible: yes
  5329. supported on: all machines
  5330.  
  5331. SYNTAX
  5332.  
  5333. (fourth <expr> )
  5334.     <expr>        -    a list or list expression
  5335.  
  5336. DESCRIPTION
  5337.  
  5338. FOURTH returns the fourth element of a list or list  expression.  If the
  5339. list is NIL, NIL is returned.
  5340.  
  5341. EXAMPLES
  5342.     (fourth '(1 2 3 4 5))            ; returns 4
  5343.     (fourth NIL)                ; returns NIL
  5344.  
  5345.     (setq kids '(junie vickie cindy chris))    ; set up variable KIDS
  5346.     (first kids)                ; returns JUNIE
  5347.     (second kids)                ; returns VICKIE
  5348.     (third kids)                ; returns CINDY
  5349.     (fourth kids)                ; returns CHRIS
  5350.     (rest kids)                ; returns (VICKIE CINDY CHRIS)
  5351.  
  5352. NOTE:
  5353. This  function is set to the same  code as CADDDR.  
  5354.  
  5355.  
  5356. funcall
  5357. ________________________________________________________________________
  5358.  
  5359. type: function (subr) 
  5360. location: built-in
  5361. source file: xlbfun.c
  5362. Common LISP compatible: yes
  5363. supported on: all machines
  5364.  
  5365. SYNTAX
  5366.  
  5367. (funcall <function> [<arg1> ... ] )
  5368.     <function>    -    the function or symbol to be called
  5369.     <argN>        -    an argument to be passed to <function>
  5370.  
  5371. DESCRIPTION
  5372.  
  5373. FUNCALL  calls a function with a series of  arguments.  FUNCALL  returns
  5374. the result from <function>.
  5375.  
  5376. EXAMPLES
  5377.  
  5378.     (funcall '+ 1 2 3 4)            ; returns 10
  5379.     (funcall #'+ 1 2 3 4)            ; returns 10
  5380.     (funcall '+ '1 '2 '3)            ; returns 6
  5381.  
  5382.     (setq sys-add (function +))        ; returns #<Subr-+: #22c32>
  5383.     (setq a 99)                ;
  5384.     (funcall sys-add 1 a)            ; 100
  5385.     (funcall sys-add 1 'a)            ; error: bad argument type
  5386.                         ;   you can't add a symbol
  5387.                         ;   only it's value
  5388.  
  5389.     (setq a 2)    (setq b 3)        ; set A and B values
  5390.     (funcall (if (< a b) (function +)    ; <function> can be computed
  5391.                  (function -))    ;
  5392.          a b)                ; returns 5
  5393.  
  5394.     (defun add-to-list (arg list)        ; add a list or an atom
  5395.        (funcall (if (atom arg) 'cons     ;   to the front of a list
  5396.                                'append)    ;
  5397.                     arg list))            ;
  5398.     (add-to-list 'a '(b c))            ; returns (A B C)
  5399.     (add-to-list '(a b) '(b c))        ; returns (A B B C)
  5400.  
  5401.  
  5402. function
  5403. ________________________________________________________________________
  5404.  
  5405. type: special form (fsubr)
  5406. location: built-in
  5407. source file: xlcont.c 
  5408. Common LISP compatible: yes
  5409. supported on: all machines
  5410.  
  5411. SYNTAX
  5412.  
  5413. (function <expr> )
  5414.     <expr>        -    an expression that evaluates to a function
  5415.  
  5416. DESCRIPTION
  5417.  
  5418. FUNCTION  returns the function  definition  of the <expr>.  Execution of
  5419. the <expr>  form does not occur.  FUNCTION  will  operate on  functions,
  5420. special forms, lambda-expressions and macros.
  5421.  
  5422. EXAMPLES
  5423.  
  5424.     (function car)                ; returns #<Subr-CAR: #23ac4>
  5425.     (function quote)            ; returns #<FSubr-QUOTE: #23d1c>
  5426.     #'quote                    ; returns #<FSubr-QUOTE: #23d1c>
  5427.     (function 'cdr)                ; error: not a function 
  5428.  
  5429.     (defun foo (x) (+ x x))            ; define FOO function
  5430.     (function foo)                ; returns #<Closure-FOO: #2cfb6>
  5431.     (defmacro bar (x) (+ x x))        ; define FOOMAC macro
  5432.     (function bar)                ; returns #<Closure-BAR: #2ceee>
  5433.  
  5434.     (setq my 99)                ; define a variable
  5435.     (function my)                ; error: unbound function
  5436.     (defun my (x) (print x))        ; define a function
  5437.     (function my)                ; returns #<Closure-MY: #2cdd6>
  5438.                         ;
  5439.                         ; NOTE THAT THERE ARE 2 SYMBOLS
  5440.                         ; A VARIABLE my AND A FUNCTION
  5441.                         ; my.
  5442.  
  5443. READ MACRO:
  5444. XLISP  supports  the  normal  read  macro of a hash and quote  (#') as a
  5445. short-hand method of writing the FUNCTION special form.
  5446.  
  5447.  
  5448. gc
  5449. ________________________________________________________________________
  5450.  
  5451. type: function (subr) 
  5452. location: built-in
  5453. source file: xldmem.c
  5454. Common LISP compatible: yes
  5455. supported on: all machines
  5456.  
  5457. SYNTAX
  5458.  
  5459. (gc)
  5460.  
  5461.  
  5462. DESCRIPTION
  5463.  
  5464. The GC  function  forces a garbage  collection  of the unused  memory of
  5465. XLISP.  NIL is always returned.
  5466.  
  5467. EXAMPLES
  5468.  
  5469.     (gc)                    ; force a garbage collection
  5470.  
  5471. NOTE:
  5472. The system will cause an automatic garbage  collection if it runs out of
  5473. free memory.
  5474.  
  5475. NOTE:
  5476. When GC is called or an  automatic  garbage  collection  occurs,  if the
  5477. amount of free  memory is still low after the  garbage  collection,  the
  5478. system attempts to add more segments (an automatic EXPAND).
  5479.  
  5480.  
  5481. gcd
  5482. ________________________________________________________________________
  5483.  
  5484. type: function (subr)
  5485. location: built-in
  5486. source file: xlmath.c
  5487. Common LISP compatible: yes
  5488. supported on: all machines
  5489.  
  5490. SYNTAX
  5491.  
  5492. (gcd [ <int> ... ] )
  5493.     <int>        -    an integer expression
  5494.  
  5495.  
  5496. DESCRIPTION
  5497.  
  5498. The GCD  function  returns the  greatest  common  divisor of a series of
  5499. integers.  If no  arguments  are given, a zero is returned.  If only one
  5500. argument is given, the absolute  value of the argument is returned.  The
  5501. successful result is always a positive integer.
  5502.  
  5503. EXAMPLES
  5504.     (gcd 51 34)                ; returns 17
  5505.     (gcd 99 66 22)                ; returns 11
  5506.     (gcd -99 66 -33)            ; returns 33
  5507.     (gcd -14)                ; returns 14
  5508.     (gcd 0)                    ; returns 0
  5509.     (gcd)                    ; returns 0
  5510.     (gcd .2)                ; error: bad argument type - 0.2
  5511.  
  5512. *gc-flag*
  5513. ________________________________________________________________________
  5514.  
  5515. type: system variable 
  5516. location: built-in
  5517. source file: xldmem.c
  5518. Common LISP compatible: no
  5519. supported on: all machines
  5520.  
  5521. SYNTAX
  5522.  
  5523. *gc-flag*
  5524.  
  5525.  
  5526. DESCRIPTION
  5527.  
  5528. *GC-FLAG* is a system  variable that  controls the printing of a garbage
  5529. collection message.  If *GC-FLAG* is NIL, no garbage collection messages
  5530. will be printed.  If *GC-FLAG* is non-NIL, a garbage collection  message
  5531. will be  printed  whenever  a GC takes  place.  The  default  value  for
  5532. *GC-FLAG* is NIL.  The message will be of the form:
  5533.  
  5534.     [ gc: total 4000, 2497 free ]
  5535.  
  5536.  
  5537. EXAMPLES
  5538.     *gc-flag*                ; returns NIL
  5539.     (gc)                    ; returns NIL
  5540.     (setq *gc-flag* T)            ; set up for message
  5541.     (gc)                    ; prints a gc message
  5542.  
  5543.  
  5544. *gc-hook*
  5545. ________________________________________________________________________
  5546.  
  5547. type: system variable 
  5548. location: built-in
  5549. source file: xldmem.c
  5550. Common LISP compatible: no
  5551. supported on: all machines
  5552.  
  5553. SYNTAX
  5554.  
  5555. *gc-hook*
  5556.  
  5557.  
  5558. DESCRIPTION
  5559.  
  5560. *GC-HOOK*  is a  system  variable  that  allows  a user  function  to be
  5561. performed  everytime garbage is collected (either  explicitly with GC or
  5562. automatically).  The default value for *GC-HOOK* is NIL.  When *GC-HOOK*
  5563. is set to a non-NIL  symbol, it is enabled to execute the specified user
  5564. routine.  The user  routine can be a quoted  symbol or a closure.  There
  5565. are two  parameters  to the user routine - the total number of nodes and
  5566. current free nodes after the garbage collection.
  5567.  
  5568. EXAMPLES
  5569.     *gc-hook*                ; returns NIL
  5570.     (gc)                    ; returns NIL
  5571.  
  5572.     (defun mygchook (&rest stuff)         ; define the hook 
  5573.         (print stuff)             ;
  5574.         (print "my hook"))        ;
  5575.     (setq *gc-hook* 'mygchook)        ; set up *GC-HOOK*
  5576.     (gc)                    ; prints (2640 232)
  5577.                         ;        "my hook"
  5578.                         ; returns NIL
  5579.     (setq *gc-flag* T)            ; turn on the system GC message
  5580.     (gc)                    ; prints 
  5581.                         ;   [ gc: total 2640, (2640 241)
  5582.                         ;   "my hook"
  5583.                         ;   236 free ]
  5584.                         ; returns NIL
  5585.     (setq *gc-flag* NIL)            ; turn off GC message    
  5586.  
  5587.     (setq *gc-hook* (lambda (x y)         ; enable user routine
  5588.                 (princ "\007")))    ;   that beeps at every GC
  5589.     (gc)                    ; beeps
  5590.  
  5591.     (defun expand-on-gc (total free)    ; define EXPAND-ON-GC
  5592.       (if (< (/ free 1.0 total) .1)        ; IF free/total < .10
  5593.           (progn (expand 2)            ;    THEN expand memory
  5594.                  (princ "\007") )        ;         and beep
  5595.           )                    ;    ELSE do nothing
  5596.       )                    ; NOTE: XLISP already gets more
  5597.                           ;       nodes automatically,
  5598.                         ;       this is just an example.
  5599.     (setq *gc-hook* 'expand-on-gc)        ; enable EXPAND-ON-GC
  5600.     (gc)                    ; beeps when low on nodes
  5601.  
  5602. NOTE:
  5603. The *GC-HOOK* and *GC-FLAG* facilities can interact.  If you do printing
  5604. in the *GC-HOOK* user form and enable *GC-FLAG*, the *GC-HOOK*  printing
  5605. will come out in the middle of the *GC-FLAG* message.
  5606.  
  5607. NOTE:
  5608. The *GC-HOOK*  user form is evaluated  after the execution of the actual
  5609. garbage  collection  code.  This means  that if the user form  causes an
  5610. error, it does not prevent a garbage collection.
  5611.  
  5612. NOTE:
  5613. Since *GC-HOOK* is set to a symbol, the user defined form can be changed
  5614. by doing  another DEFUN (or whatever) to the symbol in  *GC-HOOK*.  Note
  5615. also that you should  define the symbol first and then set  *GC-HOOK* to
  5616. the symbol.  If you don't, an automatic  garbage  collection might occur
  5617. before  you set  *GC-HOOK*  -  generating  an error  and  stopping  your
  5618. program.
  5619.  
  5620.  
  5621. gensym
  5622. ________________________________________________________________________
  5623.  
  5624. type: function (subr) 
  5625. location: built-in
  5626. source file: xlbfun.c
  5627. Common LISP compatible: yes
  5628. supported on: all machines
  5629.  
  5630. SYNTAX
  5631.  
  5632. (gensym [<tag>])
  5633.     <tag>        -    an optional integer or string 
  5634.  
  5635. DESCRIPTION
  5636.  
  5637. GENSYM generates and returns a symbol.  
  5638.  
  5639. The default  symbol  form is as a character G followed by a number - Gn.
  5640. The default  numbering  starts at 1.  You can change what the  generated
  5641. symbol looks like.  By calling  GENSYM with a string  <tag>, the default
  5642. string is set to string  parameter.  If an integer  number is the <tag>,
  5643. the current number is set to the integer parameter.
  5644.  
  5645. EXAMPLES
  5646.     (gensym)                ; first time => G1
  5647.     (gensym 100)                ; returns G100
  5648.     (gensym "MYGENSYM")            ; returns MYGENSYM101
  5649.     (gensym 0)                ; returns MYGENSYM0
  5650.     (gensym)                ; returns MYGENSYM1
  5651.     (gensym "G")                ; \
  5652.     (gensym 0)                ; /  put it back to 'normal'
  5653.     (gensym)                ; just like first time => G1
  5654.  
  5655. NOTE:
  5656. It takes 2 calls to GENSYM to set both portions of the GENSYM symbol.
  5657.  
  5658. NOTE:
  5659. Although it is possible to call GENSYM with numbers in the string  (like
  5660. "AB1"),  this does  generate an odd  sequence.  What will  happen is you
  5661. will get a sequence of symbols like .....AB18 AB19 AB110 AB111.....
  5662.  
  5663.  
  5664. get
  5665. ________________________________________________________________________
  5666.  
  5667. type: function (subr) 
  5668. location: built-in
  5669. source file: xlbfun.c
  5670. Common LISP compatible: similar
  5671. supported on: all machines
  5672.  
  5673. SYNTAX
  5674.  
  5675. (get <symbol> <property> )
  5676.     <symbol>    -    the symbol with a property list
  5677.     <property>    -    the property name being retrieved
  5678.  
  5679. DESCRIPTION
  5680.  
  5681. GET  returns  the  value of the  <property>  from the  <symbol>.  If the
  5682. <property>  does not exist, a NIL is returned.  The <symbol>  must be an
  5683. existing symbol.  The returned value may be a single value or a list.
  5684.  
  5685. Property  lists are lists  attached to any user defined  variables.  The
  5686. lists are in the form of (name1  val1 name2 val2  ....).  Any  number of
  5687. properties may be attached to a single variable.
  5688.  
  5689. EXAMPLES
  5690.  
  5691.     (setq person 'bobby)            ; create a var with a value
  5692.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  5693.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  5694.     (get person 'last-name)            ; retrieve LAST-NAME - boogie
  5695.     (get person 'job)            ; retrieve JOB - disc-jockey
  5696.     (get person 'height)            ; non-existant - returns NIL
  5697.     (putprop person '(10 20 30) 'stats)    ; add STATS - a list 
  5698.     (get person 'stats)            ;
  5699.  
  5700. NOTE:
  5701. You can set a  property  to the value  NIL.  However,  this NIL value is
  5702. indistinguishable  from the NIL returned when a property does not exist.
  5703.  
  5704. COMMON LISP COMPATABILITY:
  5705. Common LISP allows for an optional  default  value, which XLISP does not
  5706. support.
  5707.  
  5708.  
  5709. get-key
  5710. ________________________________________________________________________
  5711.  
  5712. type: function (subr) 
  5713. location: built-in 
  5714. source file: msstuff.c and osdefs.h and osptrs.h
  5715. Common LISP compatible: no
  5716. supported on: MS-DOS compatibles
  5717.  
  5718. SYNTAX
  5719.  
  5720. (get-key)
  5721.  
  5722.  
  5723. DESCRIPTION
  5724.  
  5725. The  GET-KEY  function  gets a single key stroke from the  keyboard  (as
  5726. opposed to an entire line - as READ does).
  5727.  
  5728. EXAMPLES
  5729.  
  5730.     (setq mychar (get-key))            ; get a character
  5731.  
  5732. NOTE:
  5733. This  function is an  extension of the XLISP  system.  It is provided in
  5734. the  MSSTUFF.C  source code file.  If your XLISP  system is built for an
  5735. IBM PC and  compatibles  or MS-DOS,  this  function  will work.  If your
  5736. system is built on UNIX or some other  operating  system, it is unlikely
  5737. that these functions will work unless you extend STUFF.C.
  5738.  
  5739.  
  5740. get-lambda-expression
  5741. ________________________________________________________________________
  5742.  
  5743. type: function (subr) 
  5744. location: built-in
  5745. source file: xlcont.c
  5746. Common LISP compatible: no
  5747. supported on: all machines
  5748.  
  5749. SYNTAX
  5750.  
  5751. (get-lambda-expression <closure> )
  5752.     <closure>    -    a closure object from a previously defined 
  5753.                 function.
  5754.  
  5755. DESCRIPTION
  5756.  
  5757. The  GET-LAMBDA-EXPRESSION  function  takes  the  <closure>  object  and
  5758. returns a reconstruction  of a LAMBDA or a MACRO expression that defines
  5759. the <closure>.  The parameter must be a <closure> expression (of the the
  5760. form #<Closure-FUNC #277e2> ).
  5761.  
  5762. EXAMPLES
  5763.  
  5764.     (defun mine (a b) (print (+ a b)))    ; define MINE defun
  5765.     (get-lambda-expression (function mine))    ; returns (LAMBDA (A B) 
  5766.                         ;        (PRINT (+ A B)))
  5767.  
  5768.     (get-lambda-expression             ;
  5769.         (lambda (a) (print a))        ; returns (LAMBDA (A) (PRINT A))
  5770.  
  5771.     (defmacro plus (n1 n2) `(+ ,n1 ,n2))    ; define PLUS macro
  5772.     (get-lambda-expression (function plus))    ; returns 
  5773.                         ;  (MACRO (N1 N2) 
  5774.                         ;    (BACKQUOTE (+ (COMMA N1) 
  5775.                         ;           (COMMA N2))))
  5776.  
  5777.  
  5778. get-macro-character
  5779. ________________________________________________________________________
  5780.  
  5781. type: defined function (closure) 
  5782. location: extension
  5783. source file: init.lsp
  5784. Common LISP compatible: related
  5785. supported on: all machines
  5786.  
  5787. SYNTAX
  5788.  
  5789. (get-macro-character <char-num> )
  5790.     <char-num>    -    an integer expression
  5791.  
  5792. DESCRIPTION
  5793.  
  5794. The GET-MACRO-CHARACTER  function returns the code that will be executed
  5795. when the specified  character  <char-num>  is  encountered  by the XLISP
  5796. reader.  The  returned  value  is  taken  from  the  *READTABLE*  system
  5797. variable  which  contains  the  reader  table  array.  The  table is 128
  5798. entries  (0..127) for each of the 7-bit ASCII  characters that XLISP can
  5799. read.  Each  entry  in  the  table  must  be one of  NIL,  :CONSTITUENT,
  5800. :SESCAPE,  :MESCAPE,  :WHITE-SPACE,  a :TMACRO  dotted pair or a :NMACRO
  5801. dotted pair.  The  GET-MACRO-CHARACTER  function will return a NIL value
  5802. if  the  table  entry  is  NIL,  :CONSTITUENT,   :SESCAPE,  :MESCAPE  or
  5803. :WHITE-SPACE.  If the table entry is :TMACRO or  :NMACRO,  then the code
  5804. associated   with  the  entry  is   returned.  :TMACRO  is  used  for  a
  5805. terminating   read-macro.  :NMACRO   is  used   for  a   non-terminating
  5806. read-macro.  GET-MACRO-CHARACTER does not differentiate whether the code
  5807. returned  is a :TMACRO or an :NMACRO.  The  function  returned  may be a
  5808. built-in  read-macro  function or a user defined lambda expression.  The
  5809. function  takes two  parameters, an input stream  specification,  and an
  5810. integer that is the character  value.  The <function>  should return NIL
  5811. if the character is  'white-space'  or a value CONSed with NIL to return
  5812. the value.
  5813.  
  5814. EXAMPLES
  5815.  
  5816.     (get-macro-character #\( )        ; returns #<Subr-: #2401e> 
  5817.     (get-macro-character #\# )        ; returns #<Subr-: #24082>
  5818.     (get-macro-character #\Space )        ; returns NIL
  5819.  
  5820. NOTE:
  5821. In the normal XLISP system the following characters have code associated
  5822. with them in the *READTABLE*:
  5823.  
  5824.         " # ' ( ) , ; `
  5825.  
  5826. NOTE:
  5827. The functions GET-MACRO-CHARACTER and SET-MACRO-CHARACTER are created in
  5828. the INIT.LSP file.  If they do not exist in your XLISP system, you might
  5829. be having a problem with  INIT.LSP.  Before you start XLISP, look in the
  5830. directory  you  are  currently  in,  and  check  to see if  there  is an
  5831. INIT.LSP.
  5832.  
  5833. COMMON LISP COMPATABILITY:
  5834. The GET-MACRO-CHARACTER  function is somewhat related to the Common LISP
  5835. GET-DISPATCH-MACRO-CHARACTER function.
  5836.  
  5837.  
  5838. get-output-stream-list
  5839. ________________________________________________________________________
  5840.  
  5841. type: function (subr) 
  5842. location: built-in
  5843. source file: xlfio.c
  5844. Common LISP compatible: no
  5845. supported on: all machines
  5846.  
  5847. SYNTAX
  5848.  
  5849. (get-output-stream-list <source> )
  5850.     <source>    -    an output stream expression
  5851.  
  5852. DESCRIPTION
  5853.  
  5854. The  GET-OUTPUT-STREAM-LIST  function empties the specified <source> and
  5855. returns  this data as a list.  The  output  stream  is  emptied  by this
  5856. operation.
  5857.  
  5858. EXAMPLES
  5859.  
  5860.     (setq out (make-string-output-stream))    ; returns #<Unnamed-Stream: #2d2cc>
  5861.     (format out "123")            ; add some data to output stream
  5862.     (get-output-stream-list out)        ; returns (#\1 #\2 #\3)
  5863.     (format out "123")            ; add some data to output stream
  5864.     (read out)                ; returns 123
  5865.     (get-output-stream-list out)        ; returns NIL
  5866.  
  5867.  
  5868. get-output-stream-string
  5869. ________________________________________________________________________
  5870.  
  5871. type: function (subr) 
  5872. location: built-in
  5873. source file: xlfio.c
  5874. Common LISP compatible: yes
  5875. supported on: all machines
  5876.  
  5877. SYNTAX
  5878.  
  5879. (get-output-stream-string <source> )
  5880.     <source>    -    an output stream expression
  5881.  
  5882. DESCRIPTION
  5883.  
  5884. The GET-OUTPUT-STREAM-STRING function empties the specified <source> and
  5885. returns this data as a single  string.  The output  stream is emptied by
  5886. this operation.
  5887.  
  5888. EXAMPLES
  5889.  
  5890.     (make-string-output-stream)        ; returns #<Unnamed-Stream: #2d9c0>
  5891.     (setq out (make-string-output-stream))    ; returns #<Unnamed-Stream: #2d95c>
  5892.     (format out "fee fi fo fum ")        ; \
  5893.     (format out "I smell the blood of ")    ;  fill up output stream
  5894.     (format out "Elmer Fudd")        ; /
  5895.     (get-output-stream-string out)        ; returns 
  5896.                         ;    "fee fi fo fum I smell
  5897.                         ;       the blood of Elmer Fudd"
  5898.     (format out "~%now what")        ; add more to output stream
  5899.     (get-output-stream-string out)        ; returns "\nnow what"
  5900.     (get-output-stream-string out)        ; returns ""
  5901.     (format out "hello")            ; add more to output stream
  5902.     (read out)                ; returns HELLO
  5903.  
  5904.  
  5905. go
  5906. ________________________________________________________________________
  5907.  
  5908. type: special form (fsubr)
  5909. location: built-in
  5910. source file: xlcont.c
  5911. Common LISP compatible: yes
  5912. supported on: all machines
  5913.  
  5914. SYNTAX
  5915.  
  5916. (go <tag-symbol> )
  5917.     <tag-symbol>    -    a symbol 
  5918.  
  5919. DESCRIPTION
  5920.  
  5921. The GO special  form  allows  'go-to'  style  branching  within  'block'
  5922. constructs  (DO, DO*, DOLIST,  DOTIMES,  TAGBODY, LOOP, PROG and PROG*).
  5923. The  <tag-symbol>  is the  'label' and must exist  somewhere  within the
  5924. 'block' that the GO occurs within.  Otherwise an error will be generated
  5925. -  "error:  no  target  for  GO".  GO  never  returns  a  value.  If the
  5926. <tag-symbol>  exists, then the execution will continue immediately after
  5927. the <tag-symbol>.
  5928.  
  5929. EXAMPLES
  5930.  
  5931.     (defun foo (i j)            ; define FOO
  5932.       (prog ()                ; with a PROG
  5933.          (print "begin")        ;
  5934.            start (print j)            ; tag - START
  5935.          (setq j (1- j))        ;
  5936.          (if (eql i j) (GO start)     ; 2-way branch
  5937.                    (GO end))    ; 
  5938.          (print "hello")        ; won't ever be reached
  5939.        end   (print "done")            ; tag - END
  5940.          (return 42)))            ; 
  5941.     (foo 1 2)                ; prints  "begin" 2 1 "done"
  5942.                         ;   returns 42
  5943.     (foo 2 1)                ; prints  "begin" 1 "done"
  5944.                         ;   returns 42
  5945.  
  5946. NOTE:
  5947. Although GO will accept a <tag-symbol> that is not a symbol, it will not
  5948. find this  improper  <tag-symbol>.  An error will be generated - "error:
  5949. no target for GO".
  5950.  
  5951.  
  5952. hash
  5953. ________________________________________________________________________
  5954.  
  5955. type: function (subr) 
  5956. location: built-in
  5957. source file: xlbfun.c  and  xlsym.c
  5958. Common LISP compatible: no
  5959. supported on: all machines
  5960.  
  5961. SYNTAX
  5962.  
  5963. (hash <name> <table-size> )
  5964.     <name>        -    a symbol or string expression
  5965.     <table-size>    -    an integer expression 
  5966.  
  5967. DESCRIPTION
  5968.  
  5969. The HASH  function  computes  and  returns an integer  index for a given
  5970. symbol  <name>  and  a  given  size  of  hash  table  <table-size>.  The
  5971. intention  is for HASH to be used with  tables  made by  MAKE-ARRAY  and
  5972. accessed by AREF.
  5973.  
  5974. EXAMPLES
  5975.  
  5976.     (hash "zzzz" 1000)            ; returns index 322
  5977.     (hash "ZZZZ" 1000)            ; returns index 626
  5978.     (hash 'ZZZZ  1000)            ; returns index 626
  5979.  
  5980.     (hash "hiho" 1000)            ; returns index 519
  5981.     (hash 'hiho  1000)            ; returns index 143
  5982.     (hash "abcd" 1000)            ; returns index 72
  5983.  
  5984.     (defun lookin (sym)             ; create a function to 
  5985.        (aref *obarray*             ;   look inside *OBARRAY*
  5986.              (hash sym (length *obarray*))));   and look for a specific
  5987.                         ;   symbol - returns a list
  5988.     (lookin 'caar)                ; returns the hash table entry
  5989.                         ;   (ZEROP CDDDDR CAAR HASH)
  5990.  
  5991. NOTE:
  5992. This is a useful function for creating and accessing tables.  It is also
  5993. useful for looking inside of XLISP's own symbol table *OBARRAY*.
  5994.  
  5995.  
  5996. if
  5997. ________________________________________________________________________
  5998.  
  5999. type: special form (fsubr)
  6000. location: built-in
  6001. source file: xlcont.c
  6002. Common LISP compatible: yes
  6003. supported on: all machines
  6004.  
  6005. SYNTAX
  6006.  
  6007. (if <test-expr>  <then-expr>   [ <else-expr> ]  )
  6008.     <test-expr>    -    an expression 
  6009.     <then-expr>    -    the THEN-CLAUSE, an expression
  6010.     <else-expr>    -    the ELSE-CLAUSE, an optional expression
  6011.  
  6012. DESCRIPTION
  6013.  
  6014. The IF special form evaluates the <test-expr>.  If <test-expr> evaluates
  6015. to a non-NIL  value, then  <then-expr>  is evaluated and returned as the
  6016. result.  If  <test-expr>  evaluates to NIL and there is an  <else-expr>,
  6017. then the  <else-expr> is evaluated and its result is returned.  If there
  6018. is no <else-expr> and <test-expr> evaluates to NIL, then NIL is returned
  6019. as a result.
  6020.  
  6021. EXAMPLES
  6022.  
  6023.     (if T (print "will print")        ; prints  "will print"
  6024.           (print "won't print"))        ;
  6025.  
  6026.     (if NIL (print "won't print")        ;
  6027.             (print "will print"))        ; prints  "will print"
  6028.  
  6029.     (if 'a T NIL)                ; returns T
  6030.     (if NIL 'nope 'yep)            ; returns YEP
  6031.  
  6032.  
  6033. int-char
  6034. ________________________________________________________________________
  6035.  
  6036. type: function (subr) 
  6037. location: built-in
  6038. source file: xlstr.c 
  6039. Common LISP compatible: similar
  6040. versions: all machines
  6041.  
  6042. SYNTAX
  6043.  
  6044. (int-char <int> )
  6045.     <int>        -    an integer numeric expression
  6046.  
  6047. DESCRIPTION
  6048.  
  6049. The INT-CHAR function returns a character which is the result of turning
  6050. the <int> expression into a character.  If a <int> cannot be made into a
  6051. character, an error is signalled.  The range that <int> produces a valid
  6052. character is 0 through 255.
  6053.  
  6054. EXAMPLES
  6055.  
  6056.     (int-char 48)                ; returns #\0
  6057.     (int-char 65)                ; returns #\A
  6058.     (int-char 97)                ; returns #\a
  6059.     (int-char 91)                ; returns #\[
  6060.     (int-char 10)                ; returns #\Newline
  6061.     (int-char 999)                ; error - character code out of
  6062.                         ;      range - 999
  6063.  
  6064. COMMON LISP COMPATABILITY:
  6065. Common LISP specifies that INT-CHAR should return a NIL when there is no
  6066. valid character for the integer value being passed in.  XLISP  generates
  6067. an error in these cases.  In some cases it is possible to substitue  the
  6068. CODE-CHAR function for INT-CHAR.
  6069.  
  6070. NOTE:
  6071. Unlike the CHAR-CODE and CHAR-INT functions,  CODE-CHAR and INT-CHAR are
  6072. not identical in use.  CODE-CHAR  accepts  0..127 for its range and then
  6073. produces NIL  results.  INT-CHAR  accepts  0..255 for its range and then
  6074. produces errors.
  6075.  
  6076.  
  6077. *integer-format*
  6078. ________________________________________________________________________
  6079.  
  6080. type: system variable 
  6081. location: built-in
  6082. source file: xlprin.c
  6083. Common LISP compatible: no
  6084. supported on: all machines
  6085.  
  6086. SYNTAX
  6087.  
  6088. *integer-format*
  6089.  
  6090.  
  6091. DESCRIPTION
  6092.  
  6093. *INTEGER-FORMAT*  is a system variable that allows a user to specify how
  6094. integer   numbers   are  to  be   printed   by   XLISP.  The   value  of
  6095. *INTEGER-FORMAT*  should be set to one of the string  expressions "%ld",
  6096. "%lo" or  "%lx".  The  character  after  the  percent  character  is the
  6097. alphabetic   'ell'  character.  These  format  strings  are  similar  to
  6098. C-language floating point specifications.
  6099.  
  6100.         format        description
  6101.         ---------------------------------------------------
  6102.         "%ld"        decimal
  6103.         "%lu"        unsigned decimal
  6104.         "%lo"        unsigned octal
  6105.         "%lx"        unsigned hexadecimal
  6106.  
  6107. The default value for *INTEGER-FORMAT* is the string "%ld".
  6108.  
  6109. EXAMPLES
  6110.     *integer-format*            ; returns "%ld"
  6111.  
  6112.     (setq *integer-format* "%ld")        ; signed decimal
  6113.     (print 1)                ; prints 1
  6114.     (print 1234)                ; prints 1234
  6115.     (print -1)                ; prints -1
  6116.     (print -1234)                ; prints -1234
  6117.  
  6118.     (setq *integer-format* "%lo")        ; octal notation
  6119.     (print 1)                ; prints 1
  6120.     (print 1234)                ; prints 2322
  6121.     (print -1)                ; prints 37777777777
  6122.     (print -1234)                ; prints 37777775456
  6123.  
  6124.     (setq *integer-format* "%lx")        ; hexadecimal notation
  6125.     (print 1)                ; prints 1
  6126.     (print -1)                ; prints ffffffff
  6127.     (print 1234)                ; prints 4d2
  6128.     (print -1234)                ; prints fffffb2e
  6129.  
  6130.     (setq *integer-format* "%u")        ; unsigned decimal
  6131.     (print 1)                ; prints 1
  6132.     (print 1234)                ; prints 1234
  6133.     (print -1)                ; prints 4294967295
  6134.     (print -1234)                ; prints 4294966062
  6135.  
  6136.     (setq *integer-format* "hi")        ; a bad notation
  6137.     (print 1)                ; prints hi
  6138.     (print 9999)                ; prints hi
  6139.  
  6140.     (setq *integer-format* "%ld")        ; reset to original "%ld"
  6141.  
  6142. NOTE:
  6143. There can be other  characters  put in the string, but in general,  this
  6144. will not produce  particularly  desirable  behaviour.  There is no error
  6145. checking performed on the format string.
  6146.  
  6147.  
  6148. integerp
  6149. ________________________________________________________________________
  6150.  
  6151. type: predicate function (subr)
  6152. location: built-in
  6153. source file: xlbfun.c
  6154. Common LISP compatible: yes
  6155. supported on: all machines
  6156.  
  6157. SYNTAX
  6158.  
  6159. (integerp <expr> )
  6160.     <expr>        -    the expression to check
  6161.  
  6162. DESCRIPTION
  6163.  
  6164. The INTEGERP  predicate  checks if an <expr> is a integer  number.  T is
  6165. returned if <expr> is a integer number, NIL is returned otherwise.
  6166.  
  6167. EXAMPLES
  6168.  
  6169.     (integerp 1)                ; returns T - integer
  6170.     (integerp #x034)            ; returns T - integer readmacro 
  6171.     (integerp '1)                ; returns T - still an integer
  6172.     (setq a 14)                ; 
  6173.     (integerp a)                ; returns T - evaluates to int.
  6174.     (integerp 0)                ; returns T - integer zero
  6175.  
  6176.     (integerp 1.2)                ; returns NIL - float
  6177.     (integerp 0.0)                ; returns NIL - float zero
  6178.     (integerp 'a)                ; returns NIL - symbol
  6179.     (integerp #\a)                ; returns NIL - character
  6180.     (integerp NIL)                ; returns NIL - NIL
  6181.     (integerp #(0 1 2))            ; returns NIL - array 
  6182.  
  6183.  
  6184. intern
  6185. ________________________________________________________________________
  6186.  
  6187. type: function (subr) 
  6188. location: built-in
  6189. source file: xlbfun.c
  6190. Common LISP compatible: similar
  6191. supported on: all machines
  6192.  
  6193. SYNTAX
  6194.  
  6195. (intern <name-str> )
  6196.     <name-str>    -    a string expression
  6197.  
  6198. DESCRIPTION
  6199.  
  6200. The INTERN  function  takes a string name - <name-str> and creates a new
  6201. interned symbol.  What this means is that the symbol  <name-str> will be
  6202. placed  into  the  symbol  hash  table  *OBARRAY*.  It's  value  will be
  6203. unbound.  It's property list will be NIL (empty).  If the symbol already
  6204. exists,  no error or action  is taken and the old  values  and  property
  6205. lists  remain  intact.  The INTERN  function  returns  the symbol as its
  6206. result.
  6207.  
  6208. EXAMPLES
  6209.  
  6210.     (defun lookin (sym)             ; create a function to 
  6211.        (aref *obarray*             ;   look inside *OBARRAY*
  6212.              (hash sym (length *obarray*))));   and look for a specific
  6213.                         ;   symbol - returns a list
  6214.  
  6215.     (lookin "FINGERS")            ; see if "FINGERS" is a symbol
  6216.                         ;   returns (:START1) - it isn't
  6217.     (intern "FINGERS")            ; intern "FINGERS" as a symbol
  6218.                         ;   returns FINGERS
  6219.     (lookin "FINGERS")            ; returns (FINGERS :START1) 
  6220.     (print fingers)                ; error: unbound variable
  6221.                         ;   it exists, but has no value
  6222.  
  6223.     (lookin "TOES")                ; returns NIL - doesn't exist
  6224.     toes                    ; error: unbound variable 
  6225.     (lookin "TOES")                ; returns (TOES)
  6226.                         ;   the act of looking for a
  6227.                         ;   value or using a symbol
  6228.                         ;   causes it to be INTERNed
  6229.  
  6230.     (lookin "KNEECAPS")            ; returns (MAX MAPLIST) - 
  6231.                         ;   KNEECAPS doesn't exist
  6232.     (setq kneecaps 'a-bone)            ; create symbol with a value
  6233.     (lookin "KNEECAPS")            ; returns (KNEECAPS MAX MAPLIST)
  6234.  
  6235. NOTE:
  6236. When you  INTERN a  symbol  like  "fingers",  this  gets  placed  in the
  6237. *OBARRAY*  symbol  table  as a lower  case  symbol.  Note  that  this is
  6238. different  from doing an INTERN on "FINGERS".  "fingers"  and  "FINGERS"
  6239. are two  different  symbols  in  *OBARRAY*.  Remember  also that  normal
  6240. symbols  created  by XLISP  are  upper  case  names.  So, an  intern  of
  6241. 'fingers or  'FINGERS  are normal  symbols,  and will be the  upper-case
  6242. symbol FINGERS.
  6243.  
  6244. COMMON LISP COMPATABILITY:
  6245. Common LISP allows an optional package  specification,  which XLISP does
  6246. not support.
  6247.  
  6248.  
  6249. :isnew
  6250. ________________________________________________________________________
  6251.  
  6252. type: message selector
  6253. location: built-in
  6254. source file: xlobj.c
  6255. Common LISP compatible: no
  6256. supported on: all machines
  6257.  
  6258. SYNTAX
  6259.  
  6260. (send <object> :isnew <args> )
  6261.     <object>    -    an existing object
  6262.     <args>        -    the arguments to be passed to the init. code
  6263. (send <class> :isnew <ivars> [ <cvars> [ <superclass> ] ] )
  6264.     <class>        -    an existing XLISP class
  6265.     <ivars>        -    list of instance variables for new class
  6266.     <cvars>        -    list of class variable symbols for new class
  6267.     <superclass>    -    superclass for new object 
  6268.                 (the default is 'OBJECT')
  6269.  
  6270. DESCRIPTION
  6271.  
  6272. The :ISNEW message selector causes an instance to run its initialization
  6273. method.  If an :ISNEW  message is sent to a class, the class  definition
  6274. and state will be reset as specified in the arguments of the message.
  6275.  
  6276. EXAMPLES
  6277.     (setq a-class                 ; create a new class A-CLASS 
  6278.         (send class :new '(state)))    ;        with STATE
  6279.     (send a-class :answer :isnew '()    ; set up initialization
  6280.         '((setq state nil) self))    ;
  6281.     (send a-class :answer :set-it '(value)    ; create :SET-IT message
  6282.         '((setq state value)))        ;
  6283.     (setq an-obj (send a-class :new))    ; create AN-OBJ out of A-CLASS
  6284.     (send an-obj :show)            ; returns object - STATE = NIL
  6285.     (send an-obj :set-it 5)            ; STATE is set to 5
  6286.     (send an-obj :show)            ; returns object - STATE = 5
  6287.     (SEND an-obj :ISNEW)            ; re-initialize AN-OBJ
  6288.     (send an-obj :show)            ; returns object - STATE = NIL
  6289.  
  6290. &key
  6291. ________________________________________________________________________
  6292.  
  6293. type: keyword
  6294. location: built-in
  6295. source file: xleval.c
  6296. Common LISP compatible: yes
  6297. supported on: all machines
  6298.  
  6299. SYNTAX
  6300.  
  6301. &key <key-arg> ...
  6302. &key ( <key-arg> [ <key-value> [ <exist-symbol> ] ] ) ...
  6303. &key ( ( <key-symbol> <key-arg> ) [ <key-value> [ <exist-symbol> ] ] ) ...
  6304.     <key-arg>    -    keyword argument
  6305.     <key-symbol>    -    keyword argument symbol
  6306.     <key-value>    -    keyword argument initialization
  6307.     <exist-symbol>    -    keyword argument existence symbol
  6308.  
  6309. DESCRIPTION
  6310.  
  6311. In XLISP, there are several times that you define a formal argument list
  6312. for a body of code (like DEFUN,  DEFMACRO,  :ANSWER and LAMBDA).  All of
  6313. the formal  arguments  that are  defined are  required  to appear in the
  6314. invocation  of the  defined  function  or  operation.  If there  are any
  6315. &OPTIONAL  arguments  defined,  they will be filled in order.  There are
  6316. other optional  arguments called KEYWORD arguments.  These arguments are
  6317. not position  dependent but can be specified in any order by a preceding
  6318. keyword  (a symbol  with a  leading  ':').  If there is no  <key-symbol>
  6319. specified in the argument list, the keyword will be constructed from the
  6320. <key-arg>  name by adding a leading  ':'.  (For  example a <key-arg>  of
  6321. FURTER will generate a keyword symbol of :FURTER).  
  6322.  
  6323. Like  the  &OPTIONAL  arguments,  there  can  be  initialization  values
  6324. provided  via the  <key-value>  argument.  If  there  is no  <key-value>
  6325. argument  and no value is provided by the function  call, the  <key-arg>
  6326. value will be NIL.
  6327.  
  6328. The  <exist-symbol>,  if  it  is  specified,  will  contain  a T if  the
  6329. <key-arg>  value was  supplied by the function  call and a NIL if it was
  6330. not  supplied  by the  function  call.  This  <exist-symbol>  allows the
  6331. programmer  to  test  for an  argument's  existence.  At the  end of the
  6332. function or operation  execution,  these local  symbols and their values
  6333. are are removed.
  6334.  
  6335. EXAMPLES
  6336.  
  6337.     (defun foo                 ; define function FOO
  6338.       (a &key b c )                ;   with some optional args
  6339.       (print a) (print b) (print c))    ;
  6340.     (foo)                    ; error: too few arguments 
  6341.     (foo 1)                    ; prints 1 NIL NIL
  6342.     (foo 1 2)                ; prints 1 NIL NIL
  6343.     (foo 1 :b 2 :c 3)            ; prints 1 2 3 
  6344.     (foo 1 :c 3 :b 2)            ; prints 1 2 3 
  6345.     (foo 1 :b 3 :b 2)            ; prints 1 3 NIL
  6346.  
  6347.     (defun fee                ; define function FEE
  6348.       (a &key (b 9 b-passed) )        ;   with some optional args
  6349.       (print a) (print b)            ;
  6350.       (if b-passed (print "b was passed")    ;
  6351.                    (print "b not passed")))    ;
  6352.     (fee)                    ; error: too few arguments
  6353.     (fee 1)                    ; prints 1 9 "b not passed"
  6354.     (fee 1 2)                ; prints 1 9 "b not passed"
  6355.     (fee 1 :b 2)                ; prints 1 2 "b was passed"
  6356.  
  6357.     (defun fi                ; define function FI
  6358.       (a &key ((:mykey b) 9 b-passed) )    ;   with some optional args
  6359.       (print a) (print b)            ;
  6360.       (if b-passed (print "b was passed")    ;
  6361.                    (print "b not passed")))    ;
  6362.     (fi)                    ; error: too few arguments
  6363.     (fi 1)                    ; prints 1 9 "b not passed"
  6364.     (fi 1 2)                ; prints 1 9 "b not passed"
  6365.     (fi 1 :b 2)                ; prints 1 9 "b not passed"
  6366.     (fi 1 :mykey 2)                ; prints 1 2 "b was passed"
  6367.  
  6368. NOTE:
  6369. There is a  &ALLOW-OTHER-KEYS  keyword in XLISP and Common LISP.  In the
  6370. case of XLISP, this keyword is extraneous  since the default for keyword
  6371. arguments is to allow other keys (without errors).
  6372.  
  6373.  
  6374. labels
  6375. ________________________________________________________________________
  6376.  
  6377. type: special form (fsubr)
  6378. location: built-in
  6379. source file: xlcont.c
  6380. Common LISP compatible: yes
  6381. supported on: all machines
  6382.  
  6383. SYNTAX
  6384.  
  6385. (labels  ( [ <function> ... ]  ) <expr> ... )
  6386.     <function>    -    a function definition binding which is of the 
  6387.                 form  ( <symbol> <arg-list> <body> )
  6388.     <symbol>    -    the symbol specifying the function name
  6389.     <arg-list>    -    the argument list for the function 
  6390.     <body>        -    the body of the function
  6391.     <expr>        -    an expression
  6392.  
  6393. DESCRIPTION
  6394.  
  6395. The LABELS special form is basically a local block construct that allows
  6396. local  <function>  definitions  followed by a block of code to evaluate.
  6397. The first form after the labels is the  'binding'  form.  It  contains a
  6398. series of <functions>.  LABELS allows the <functions> to be defined in a
  6399. mutually recursive manner.  (The similar FLET form does not allow this.)
  6400. The  LABELS  form  will go  through  and  define  the  <symbol>s  of the
  6401. <functions>  and then  sequentially  execute the <expr>'s.  The value of
  6402. the last  <expr>  evaluated  is  returned.  When the LABELS is  finished
  6403. execution, the <symbol>'s that were defined will no longer exist.
  6404.  
  6405. EXAMPLES
  6406.  
  6407.     (labels ( (fozz (x) (+ x x) ))        ; a LABELS with FOZZ local func.
  6408.         (fozz 2))                ; returns 4
  6409.                         ; FOZZ no longer exists
  6410.     (fozz 2)                ; error: unbound function - FOZZ
  6411.  
  6412.                         ; an empty LABELS
  6413.     (labels () (print 'a))            ; prints A
  6414.     
  6415.                         ; LABELS form including
  6416.     (labels ( (inc (arg) (est arg))        ;   INC definition using EST
  6417.           (est (var) (* .1 var)) )    ;   EST definition
  6418.        (inc 99) )                ;   returns 9.9
  6419.                         ;
  6420.                         ; FLET form including
  6421.     (flet ( (inc (arg) (est arg))        ;   INC definition using EST
  6422.         (est (var) (* .1 var)) )    ;   EST definition
  6423.        (inc 99)                ; error: unbound function - EST
  6424.  
  6425. NOTE:
  6426. FLET  does not allow  recursive  definitions  of  functions.  The  LABEL
  6427. special form does allow this.
  6428.  
  6429.  
  6430. lambda
  6431. ________________________________________________________________________
  6432.  
  6433. type: special form (fsubr)
  6434. location: built-in
  6435. source file: xlcont.c
  6436. Common LISP compatible: yes
  6437. supported on: all machines
  6438.  
  6439. SYNTAX
  6440.  
  6441. (lambda <arg-list> [ <body> ] )
  6442.     <arg-list>    -    A list of the formal arguments to the function
  6443.                 of the form:    ( [ <arg1> ... ]
  6444.                           [ &optional <oarg1> ... ]
  6445.                             [ &rest <rarg> ]
  6446.                           [ &key ... ]
  6447.                             [ &aux <aux1> ... ] )
  6448.     <body>        -    A series of LISP forms (expressions) that
  6449.                 are executed in order.  
  6450.  
  6451. DESCRIPTION
  6452.  
  6453. LAMBDA returns a function definition - an executable function - that has
  6454. no name.
  6455.  
  6456. All of the <argN>  formal  arguments  that are  defined are  required to
  6457. appear in a call to the  defined  function.  If there are any  &OPTIONAL
  6458. arguments  defined,  they will be filled  in order.  If there is a &REST
  6459. argument  defined, and all the required  formal  arguments and &OPTIONAL
  6460. arguments are filled, any and all further parameters will be passed into
  6461. the function  via the <rarg>  argument.  Note that there can be only one
  6462. <rarg> argument for &REST.  If there are insufficient parameters for any
  6463. of the  &OPTIONAL or &REST  arguments,  they will contain NIL.  The &AUX
  6464. variables  are a  mechanism  for you to  define  variables  local to the
  6465. function  definition.  At the end of the function execution, these local
  6466. symbols and their values are are removed.
  6467.  
  6468. EXAMPLES
  6469.  
  6470.     (funcall (lambda (a b) (* a b)) 4 8 )    ; evaluate a lambda function
  6471.                         ;   returns 32
  6472.     (funcall (lambda '(a b) (+ a b)) 1 2)    ; evaluate another 
  6473.                         ;   returns 3
  6474.     (funcall (lambda (a b)             ; evaluate a more complex one
  6475.             (print "a no-name fnc")     ;   prints "a no-name fnc"
  6476.             (* a b)) 3 8)        ;   and returns 24
  6477.  
  6478. NOTE:
  6479. Using a SETQ on a LAMBDA  expression is not the same as a DEFUN.  A SETQ
  6480. on a LAMBDA  will give the  variable  the value of the  LAMBDA  closure.
  6481. This does not mean that the variable name can be used as a function.
  6482.  
  6483.  
  6484. last
  6485. ________________________________________________________________________
  6486.  
  6487. type: function (subr) 
  6488. location: built-in
  6489. source file: xllist.c
  6490. Common LISP compatible: yes
  6491. supported on: all machines
  6492.  
  6493. SYNTAX
  6494.  
  6495. (last <list-expr> )
  6496.     <list-expr>    -    a list or list expression
  6497.  
  6498. DESCRIPTION
  6499.  
  6500. The LAST function  returns a list containing the last node or element of
  6501. a list.  If the last node is a sub-list, this is returned unaffected.
  6502.  
  6503. EXAMPLES
  6504.  
  6505.     (last NIL)                ; returns NIL
  6506.     (last 'a)                ; error: bad argument type
  6507.     (last '(A))                ; returns (A)
  6508.     (last '(A B C D E))            ; returns (E)
  6509.     (last '( A (B C) (D E (F))))        ; returns ((D E (F)))
  6510.     
  6511.     (setq children '(junie vicki         ;
  6512.              cindy chris))        ;
  6513.     (last children)                ; returns CHRIS
  6514.  
  6515.  
  6516. length
  6517. ________________________________________________________________________
  6518.  
  6519. type: function (subr) 
  6520. location: built-in
  6521. source file: xllist.c
  6522. Common LISP compatible: yes
  6523. supported on: all machines
  6524.  
  6525. SYNTAX
  6526.  
  6527. (length <expr> )
  6528.     <expr>        -    a list expression or string expression 
  6529.  
  6530. DESCRIPTION
  6531.  
  6532. LENGTH returns the length of the <expr>.  If the <expr> is a string, the
  6533. number of  characters  is returned.  If the <expr> is a list, the number
  6534. of top level  elements  (atoms or sublists) is returned.  If the list is
  6535. NIL, a 0 is returned.
  6536.  
  6537. EXAMPLES
  6538.  
  6539.     (length NIL)                ; returns 0
  6540.     (length 'a)                ; error: bad argument type
  6541.     (length '(a))                ; returns 1
  6542.     (length '(1 2 3 4 5 6))            ; returns 6
  6543.     (length '(a (b c) (d (e) f) g))        ; returns 4
  6544.  
  6545.     (length "12345")            ; returns 5
  6546.  
  6547.  
  6548. let
  6549. ________________________________________________________________________
  6550.  
  6551. type: special form (fsubr)
  6552. location: built-in
  6553. source file: xlcont.c
  6554. Common LISP compatible: yes
  6555. supported on: all machines
  6556.  
  6557. SYNTAX
  6558.  
  6559. (let  ( [ <binding> ... ]  ) <expr> ... )
  6560.     <binding>    -    a variable binding which is of the form
  6561.                 <symbol>     or    ( <symbol> <init-expr> )
  6562.     <symbol>    -    a symbol
  6563.     <init-expr>    -    an initialization expression for <symbol>
  6564.     <expr>        -    an expression
  6565.  
  6566. DESCRIPTION
  6567.  
  6568. The LET special form is basically a local block  construct that contains
  6569. symbols   (with   optional   initializations)   and  a  block   of  code
  6570. (expressions)  to  evaluate.  The  first  form  after  the  LET  is  the
  6571. 'binding' form.  It contains a series of <symbol>'s or <binding>'s.  The
  6572. <binding>  is  a  <symbol>  followed  by  an  initialization  expression
  6573. <init-expr>.  If  there  is  no   <init-expr>,   the  <symbol>  will  be
  6574. initialized  to  NIL.  There  is no  specification  as to the  order  of
  6575. execution of the  bindings.  The LET form will go through and create and
  6576. initialize the symbols and then sequentially  execute the <expr>'s.  The
  6577. value  of the  last  <expr>  evaluated  is  returned.  When  the  LET is
  6578. finished  execution,  the  <symbol>'s  that were defined  will no longer
  6579. exist or retain their values.
  6580.  
  6581. EXAMPLES
  6582.  
  6583.     (let (x y z)                 ; LET with local vars
  6584.        (print x) (print y) (print z))    ;  prints   NIL NIL NIL
  6585.     (let ((a 1) (b 2) (c 3))        ; LET with local vars & init.
  6586.       (print (+ a b c)))            ;  prints and returns 6
  6587.     (let ( (a 1) (b 2) (c (+ a b)))        ; LET with local vars & init.
  6588.       (print (+ a b c)))            ;  error: unbound variable - A
  6589.                          ;  because (+ A B) init code
  6590.                         ;  depends on vars A and B
  6591.                         ;  which haven't been created
  6592.                         ;  yet - because of ordering
  6593.  
  6594.  
  6595. let*
  6596. ________________________________________________________________________
  6597.  
  6598. type: special form (fsubr)
  6599. location: built-in
  6600. source file: xlcont.c
  6601. Common LISP compatible: yes
  6602. supported on: all machines
  6603.  
  6604. SYNTAX
  6605.  
  6606. (let*  ( [ <binding> ... ]  ) <expr> ... )
  6607.     <binding>    -    a variable binding which is of the form
  6608.                 <symbol>     or    ( <symbol> <init-expr> )
  6609.     <symbol>    -    a symbol
  6610.     <init-expr>    -    an initialization expression for <symbol>
  6611.     <expr>        -    an expression
  6612.  
  6613. DESCRIPTION
  6614.  
  6615. The LET* special form is basically a local block construct that contains
  6616. symbols   (with   optional   initializations)   and  a  block   of  code
  6617. (expressions)  to  evaluate.  The  first  form  after  the  LET*  is the
  6618. 'binding' form.  It contains a series of <symbol>'s or <binding>'s.  The
  6619. <binding>  is  a  <symbol>  followed  by  an  initialization  expression
  6620. <init-expr>.  If  there  is  no   <init-expr>,   the  <symbol>  will  be
  6621. initialized  to NIL.  The  execution of the bindings will occur from the
  6622. first to the last binding.  The LET* form will go through and create and
  6623. initialize the symbols and then sequentially  execute the <expr>'s.  The
  6624. value  of the  last  <expr>  evaluated  is  returned.  When the  LET* is
  6625. finished  execution,  the  <symbol>'s  that were defined  will no longer
  6626. exist or retain their values.
  6627.  
  6628. EXAMPLES
  6629.  
  6630.     (let* (x y z)                 ; LET* with local vars
  6631.        (print x) (print y) (print z))    ;  prints   NIL NIL NIL
  6632.     (let* ((a 1) (b 2) (c 3))        ; LET* with local vars & init.
  6633.       (print (+ a b c)))            ;  prints and returns 6
  6634.     (let* ( (a 1) (b 2) (c (+ a b)))    ; LET* with local vars & init.
  6635.       (print (+ a b c)))            ;  prints and returns 6
  6636.                          ;  because (+ A B) init code
  6637.                         ;  depends on vars A and B
  6638.                         ;  which have been created -
  6639.                         ;  because of ordering of LET*
  6640.  
  6641.  
  6642. list
  6643. ________________________________________________________________________
  6644.  
  6645. type: function (subr) 
  6646. location: built-in
  6647. source file: xllist.c
  6648. Common LISP compatible: yes
  6649. supported on: all machines
  6650.  
  6651. SYNTAX
  6652.  
  6653. (list [ <expr1> ... ])
  6654.     <exprN>        -    an expression
  6655.  
  6656. DESCRIPTION
  6657.  
  6658. The LIST function  takes the  expressions  and  constructs a list out of
  6659. them.  This constructed list is returned.
  6660.  
  6661. EXAMPLES
  6662.  
  6663.     (list)                    ; returns NIL
  6664.     (list NIL)                ; returns (NIL)
  6665.     (list 'a)                ; returns (A)
  6666.     (list 'a 'b)                ; returns (A B)
  6667.     (list 'a 'b 'c)                ; returns (A B C)
  6668.     (list 'a 'b NIL)            ; returns (A B NIL)
  6669.     (list '(a b) '(c d) '( (e f) ))        ; returns ((A B) (C D) ((E F)))
  6670.     (list (+ 1 2) (+ 3 4))            ; returns (3 7)
  6671.  
  6672.  
  6673. listp
  6674. ________________________________________________________________________
  6675.  
  6676. type: predicate function (subr)
  6677. location: built-in
  6678. source file: xlbfun.c
  6679. Common LISP compatible: yes
  6680. supported on: all machines
  6681.  
  6682. SYNTAX
  6683.  
  6684. (listp <expr> )
  6685.     <expr>        -    the expression to check
  6686.  
  6687. DESCRIPTION
  6688.  
  6689. The LISTP  predicate  checks if the <expr> is a list.  T is returned  if
  6690. <expr>  is a list or an empty  list  (the NIL  value),  NIL is  returned
  6691. otherwise.
  6692.  
  6693. EXAMPLES
  6694.  
  6695.     (listp '(a b))                ; returns T - list
  6696.     (listp NIL)                ; returns T - NIL
  6697.     (listp '(a . b))            ; returns T - dotted pair list
  6698.  
  6699.     (listp (lambda (x) (print x)))        ; returns NIL - closure - lambda
  6700.     (listp #(1 2 3))            ; returns NIL - array
  6701.     (listp *standard-output*)        ; returns NIL - stream
  6702.     (listp 1.2)                ; returns NIL - float
  6703.     (listp #'quote)                ; returns NIL - fsubr
  6704.     (listp 1)                ; returns NIL - integer
  6705.     (listp object)                ; returns NIL - object
  6706.     (listp "str")                ; returns NIL - string
  6707.     (listp #'car)                ; returns NIL - subr
  6708.     (listp 'a)                ; returns NIL - symbol
  6709.  
  6710. NOTE:
  6711. NIL or '()  is  used  in  many  places  as a  list-class  or  atom-class
  6712. expression.  Both ATOM and LISTP, when applied to NIL, return T.  If you
  6713. wish to check for a non-empty list, use the CONSP predicate.
  6714.  
  6715.  
  6716. load
  6717. ________________________________________________________________________
  6718.  
  6719. type: function (subr) 
  6720. location: built-in
  6721. source file: xlsys.c  and  xlread.c
  6722. Common LISP compatible: similar
  6723. supported on: all machines
  6724.  
  6725. SYNTAX
  6726.  
  6727. (load  <file>  [ :verbose <v-flag> ] [ :print <p-flag> ] ))
  6728.     <file>        -    a string expression or symbol 
  6729.     <v-flag>    -    an optional key-word expression - default is T
  6730.     <p-flag>    -    an optional key-word expression - default is NIL
  6731.  
  6732. DESCRIPTION
  6733.  
  6734. The LOAD function  opens the <file>, reads and  evaluates  all the forms
  6735. within the <file>.  <file> may be a string expression or a symbol.  When
  6736. <file>  is a  string,  you may  specify  a  complete  file  location  or
  6737. extensions (like  "/usr/local/bin/myfile.lsp" or "A:\LISP\TIM.LSP").  If
  6738. <file>  is a string  and  includes  a file  type or an  extension  (like
  6739. ".lsp"),  then  LOAD  accesses  the  specified  file.  If  there  is  no
  6740. extension  on <file>, it will add  ".lsp".  If the  :VERBOSE  keyword is
  6741. present and  <v-flag>  is non-NIL, a load  message of the form ; loading
  6742. "xxxx.lsp" will be printed to  *STANDARD-OUTPUT*.  If the :PRINT keyword
  6743. is  present  and  <p-flag>  is  non-NIL,  the  resulting  value  of each
  6744. top-level  form in <file> will be printed to  *STANDARD-OUTPUT*.  If the
  6745. file load was successful, then T is returned as the result.  If the file
  6746. load was not successful, a NIL is returned.
  6747.  
  6748. EXAMPLES
  6749.  
  6750.     (load 'gloop)                ; prints  ; loading "GLOOP.lsp"
  6751.                         ; returns NIL   there is no file
  6752.  
  6753.     (defun foo (x) (print x))        ; create a function 
  6754.     (savefun foo)                ; create a file FOO.lsp
  6755.     (load 'foo)                ; prints  ; loading "FOO.lsp"
  6756.                         ; returns T
  6757.     (load 'foo :verbose NIL)        ; no printing    returns T
  6758.     (load 'foo :print T)            ; prints  FOO    returns T
  6759.     (load 'save :verbose T :print T)    ; prints  ; loading "FOO.lsp"
  6760.                         ; prints  FOO    returns T
  6761.     (load "foo")                ; prints  ; loading "foo.lsp"
  6762.                         ; returns NIL    didn't work
  6763.                         ; because the file is "FOO.lsp"
  6764.     (load "FOO")                ; prints  ; loading "FOO.lsp"
  6765.                         ; returns T    did work
  6766.     (load "FOO.lsp")            ; prints  ; loading "FOO.lsp"
  6767.                         ; returns T    did work
  6768.  
  6769. FILE NAMES:
  6770. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  6771. automatically made uppercase.  In using XLISP, this means you don't have
  6772. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  6773. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  6774. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  6775. if you do a (open 'foo-file :direction :output), this will create a file
  6776. named FOO-FILE  because XLISP uppercases its symbols.  If you do a (open
  6777. "foo-file" :direction :output), this will create a file named "foo-file"
  6778. because UNIX doesn't  uppercase  its file names.  Another case is if you
  6779. do (savefun  mydefun), this will create the file  "MYDEFUN.lsp".  So, if
  6780. you are having  trouble with opening and accessing  files, check to make
  6781. sure the file name is in the proper case.
  6782.  
  6783. COMMON LISP COMPATABILITY:
  6784. Common LISP has a LOAD  function  that is similar to XLISP's  LOAD.  The
  6785. only difference is that Common LISP uses an optional  keyword  parameter
  6786. :IF-DOES-NOT-EXIST which XLISP does not support.
  6787.  
  6788. NOTE:
  6789. In XLISP, the keyword  parameters are order sensitive.  If both :VERBOSE
  6790. and :PRINT keywords are used, :VERBOSE must come first.
  6791.  
  6792. KEYSTROKE EQUIVALENT:
  6793. In the  Macintosh  version of XLISP, a COMMAND-l  brings up a dialog box
  6794. for loading a file.  COMMAND-n operates  similarly, except that the load
  6795. is  done  with  :VERBOSE  and  :PRINT  flags  set.  These  can  also  be
  6796. accomplished by a pull-down menu selection.
  6797.  
  6798.  
  6799.  
  6800. logand
  6801. ________________________________________________________________________
  6802.  
  6803. type: function (subr) 
  6804. location: built-in
  6805. source file: xlmath.c
  6806. Common LISP compatible: yes
  6807. supported on: all machines
  6808.  
  6809. SYNTAX
  6810.  
  6811. (logand <expr1> ... )
  6812.     <exprN>        -    an integer expression
  6813.  
  6814. DESCRIPTION
  6815.  
  6816. The LOGAND  function  returns the logical  (bitwise)  AND of the list of
  6817. expressions.  If there is only one  argument, it is returned  unaltered.
  6818. If there are two or more  arguments,  the LOGAND  function  performs the
  6819. logical and operation successively applying the bitwise operation.
  6820.  
  6821. EXAMPLES
  6822.  
  6823.     (logand 0 0)                ; returns 0
  6824.     (logand 0 1)                ; returns 0
  6825.     (logand 1 0)                ; returns 0
  6826.     (logand 1 1)                ; returns 1
  6827.      (logand 55 #x0F)            ; returns 7
  6828.     (logand 7 #b0011)            ; returns 3
  6829.     (logand 1 2 4 8 16)            ; returns 0
  6830.     (logand 15 7 3)                ; returns 3
  6831.  
  6832. NOTE:
  6833. XLISP does not check when read-macro  expansions (like #x0FF) are out of
  6834. bounds.  It gives no error  message and will just truncate the number to
  6835. the  low-order  bits  that it can deal  with  (usually  32 bits or 8 hex
  6836. digits).
  6837.  
  6838.  
  6839. logior
  6840. ________________________________________________________________________
  6841.  
  6842. type: function (subr) 
  6843. location: built-in
  6844. source file: xlmath.c
  6845. Common LISP compatible: yes
  6846. supported on: all machines
  6847.  
  6848. SYNTAX
  6849.  
  6850. (logior <expr1> ... )
  6851.     <exprN>        -    an integer expression
  6852.  
  6853. DESCRIPTION
  6854.  
  6855. The LOGIOR function  returns the logical  (bitwise)  INCLUSIVE-OR of the
  6856. list of  expressions.  If there is only  one  argument,  it is  returned
  6857. unaltered.  If there  are two or more  arguments,  the  LOGIOR  function
  6858. performs the inclusive-or successively applying the bitwise operation.
  6859.  
  6860. EXAMPLES
  6861.  
  6862.     (logior 0 0)                ; returns 0
  6863.     (logior 0 1)                ; returns 1
  6864.     (logior 1 0)                ; returns 1
  6865.     (logior 1 1)                ; returns 1
  6866.      
  6867.     (logior 1 2 4 8 16 32 64)r⇦á✓Ö@`⇧ !③±æ0<àì∮ϕ-∈D╱ñ⇦lF╱&❎!!!'dL«Ä«Mמd╱βA%ì∮ϕ-∈D◆'$⇦o╱(זד!!!'dL«Ä«Mמd╱ª&!A%ì∮ϕ-∈D◆'$⇦o╱å╱❎!!!'dL«Ä«Mמd╱&&FaAIחΩêºAK    ë*j⇦ ì∮«dל∈ä m ¼mdϕ ¡גL¼,ࡼ,nMΣ⇦ » -מm-ϕמd❎ì-lñ⇦o╱✓זד$ .Lñ∈«ä∮IJLM∈¡כÄeג⇦    .ä ϕ.כ«dלΣ «NM∈D⇦¼«nl,∮ñ -כäϕ-ìäN«näÄN¡כl.îñì ñמ¡¼L«DìβNì ñ⇦ì∈σ¡∈Lî«D⇦ M.Äd⇦ì .ä.ä l-ג î¼-ä⇦ϕ.ì⇦⇦❎«n¼-ìÅ$⇦╱fD M.Äd∈D◆⇦ »⇧Lì,ϕ.Äe%IJAAüMì∮ϕל∈üK_______________________________________________________________________
  6868.  
  6869. type: function (subr) 
  6870. location: built-in
  6871. source file: xlmath.c
  6872. Common LISP compatible: yes
  6873. supported on: all machines
  6874.  
  6875. SYNTAX
  6876.  
  6877. (lognot  <expr> )
  6878.     <expr>        -    an integer expression
  6879.  
  6880. DESCRIPTION
  6881.  
  6882. The LOGNOT  function  returns the  logical  (bitwise)  INVERSION  of the
  6883. expression.
  6884.  
  6885. EXAMPLES
  6886.  
  6887.     (lognot 255)                ; returns -256
  6888.     (lognot #xffff0000)            ; returns 65535
  6889.     (lognot #x00000000)            ; returns -1
  6890.     (lognot 1)                ; returns -2
  6891.  
  6892.     (logand (lognot 256) 65535)        ; returns 65279
  6893.     (lognot #xFFFFFFFE)            ; returns 1
  6894.     (lognot #xFFFFFFFC)            ;/äê⇧Ç⇦ÇäOגp≡ÉÉ⇧ÿ@≡âæÆ⇦◆נëÇ✓⇦OÇÇ⇧נî⇨ê OÇ⇨êנäê    ij ⇦ÇOנê⇨çÄä⇩äOבüé✓Oכ⇨וÿÿאOÄ⇦êOÇ⇧נÇ✓≡îÇëä@ננÆ⇧נê⇩ê⇦OÇÇOê⇦äÇ⇦ננÇ✓⇦⇦✓✓OÄëנÇ⇩⇧üנÇÇ⇦⇧נüäÇî⇧êOüâêOÇÇ ê⇦נüÇpüâêOנüÇ@⇦ëê⇦ננîé⇧äOנüâÄ⇧נé⇧נîנëê⇧ננÇ⇩⇧âננבÇ⇦⇧üéOנגDנîé⇧äOÇ⇦נבנâê⇨≡ëé✓⇩⇧äB@≡≡±≡üÇ✓⇨Ç⇦≡Çp≡üé◆ê@נêÇî⇧éנבä äאO≡üÇ ⇧éijנîÇ⇩⇧üij⇩≡ä⇦î✓Oêé⇧ê@נâüÇ⇧âijîp£נæÆ⇦◆נî◆Ä⇧é üê@נé✓⇦'a 'b 'c)                ; returns (A B C)
  6895.     (list 'a 'b NIL)            ; returns (A B NIL)
  6896.     (list '(a b) '(c d) '( (e f) ))        ; returns ((A B) (C D) ((E F)))
  6897.     (list (+ 1 2) (+ 3 4))            ; returns (3 7)
  6898.  
  6899.  
  6900. listp
  6901. ________________________________________________________________________
  6902.  
  6903. type: predicate function (subr)
  6904. location: built-in
  6905. source file: xlbfun.c
  6906. Common LISP compatible: yes
  6907. supported on: all machines
  6908.  
  6909. SYNTAX
  6910.  
  6911. (listp <expr> )
  6912.     <expr>        -    the expression to check
  6913.  
  6914. DESCRIPTION
  6915.  
  6916. The LISTP  predicate  checks if the <expr> is a list.  T is returned  if
  6917. <expr>  is a list or an empty  list  (the NIL  value),  NIL is  returned
  6918. otherwise.
  6919.  
  6920. EXAMPLES
  6921.  
  6922.     (listp '(a b))                ; returns T - list
  6923.     (listp NIL)                ; returns T - NIL
  6924.     (listp '(a . b))            ; returns T - dotted pair list
  6925.  
  6926.     (listp (lambda (x) (print x)))        ; returns NIL - closure - lambda
  6927.     (listp #(1 2 3))            ; returns NIL - array
  6928.     (listp *standard-output*)        ; returns NIL - stream
  6929.     (listp 1.2)                ; returns NIL - float
  6930.     (listp #'quote)                ; returns NIL - fsubr
  6931.     (listp 1)                ; returns NIL - integer
  6932.     (listp object)                ; returns NIL - object
  6933.     (listp "str")                ; returns NIL - string
  6934.     (listp #'car)                ; returns NIL - subr
  6935.     (listp 'a)                ; returns NIL - symbol
  6936.  
  6937. NOTE:
  6938. NIL or '()  is  used  in  many  places  as a  list-class  or  atom-class
  6939. expression.  Both ATOM and LISTP, when applied to NIL, return T.  If you
  6940. wish to check for a non-empty list, use the CONSP predicate.
  6941.  
  6942.  
  6943. load
  6944. ________________________________________________________________________
  6945.  
  6946. type: function (subr) 
  6947. location: built-in
  6948. source file: xlsys.c  and  xlread.c
  6949. Common LISP compatible: similar
  6950. supported on: all machines
  6951.  
  6952. SYNTAX
  6953.  
  6954. (load  <file>  [ :verbose <v-flag> ] [ :print <p-flag> ] ))
  6955.     <file>        -    a string expression or symbol 
  6956.     <v-flag>    -    an optional key-word expression - default is T
  6957.     <p-flag>    -    an optional key-word expression - default is NIL
  6958.  
  6959. DESCRIPTION
  6960.  
  6961. The LOAD function  opens the <file>, reads and  evaluates  all the forms
  6962. within the <file>.  <file> may be a string expression or a symbol.  When
  6963. <file>  is a  string,  you may  specify  a  complete  file  location  or
  6964. extensions (like  "/usr/local/bin/myfile.lsp" or "A:\LISP\TIM.LSP").  If
  6965. <file>  is a string  and  includes  a file  type or an  extension  (like
  6966. ".lsp"),  then  LOAD  accesses  the  specified  file.  If  there  is  no
  6967. extension  on <file>, it will add  ".lsp".  If the  :VERBOSE  keyword is
  6968. present and  <v-flag>  is non-NIL, a load  message of the form ; loading
  6969. "xxxx.lsp" will be printed to  *STANDARD-OUTPUT*.  If the :PRINT keyword
  6970. is  present  and  <p-flag>  is  non-NIL,  the  resulting  value  of each
  6971. top-level  form in <file> will be printed to  *STANDARD-OUTPUT*.  If the
  6972. file load was successful, then T is returned as the result.  If the file
  6973. load was not successful, a NIL is returned.
  6974.  
  6975. EXAMPLES
  6976.  
  6977.     (load 'gloop)                ; prints  ; loading "GLOOP.lsp"
  6978.                         ; returns NIL   there is no file
  6979.  
  6980.     (defun foo (x) (print x))        ; create a function 
  6981.     (savefun foo)                ; create a file FOO.lsp
  6982.     (load 'foo)                ; prints  ; loading "FOO.lsp"
  6983.                         ; returns T
  6984.     (load 'foo :verbose NIL)        ; no printing    returns T
  6985.     (load 'foo :print T)            ; prints  FOO    returns T
  6986.     (load 'save :verbose T :print T)    ; prints  ; loading "FOO.lsp"
  6987.                         ; prints  FOO    returns T
  6988.     (load "foo")                ; prints  ; loading "foo.lsp"
  6989.                         ; returns NIL    didn't work
  6990.                         ; because the file is "FOO.lsp"
  6991.     (load "FOO")                ; prints  ; loading "FOO.lsp"
  6992.                         ; returns T    did work
  6993.     (load "FOO.lsp")            ; prints  ; loading "FOO.lsp"
  6994.                         ; returns T    did work
  6995.  
  6996. FILE NAMES:
  6997. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  6998. automatically made uppercase.  In using XLISP, this means you don't have
  6999. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  7000. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  7001. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  7002. if you do a (open 'foo-file :direction :output), this will create a file
  7003. named FOO-FILE  because XLISP uppercases its symbols.  If you do a (open
  7004. "foo-file" :direction :output), this will create a file named "foo-file"
  7005. because UNIX doesn't  uppercase  its file names.  Another case is if you
  7006. do (savefun  mydefun), this will create the file  "MYDEFUN.lsp".  So, if
  7007. you are having  trouble with opening and accessing  files, check to make
  7008. sure the file name is in the proper case.
  7009.  
  7010. COMMON LISP COMPATABILITY:
  7011. Common LISP has a LOAD  function  that is similar to XLISP's  LOAD.  The
  7012. only difference is that Common LISP uses an optional  keyword  parameter
  7013. :IF-DOES-NOT-EXIST which XLISP does not support.
  7014.  
  7015. NOTE:
  7016. In XLISP, the keyword  parameters are order sensitive.  If both :VERBOSE
  7017. and :PRINT keywords are used, :VERBOSE must come first.
  7018.  
  7019. KEYSTROKE EQUIVALENT:
  7020. In the  Macintosh  version of XLISP, a COMMAND-l  brings up a dialog box
  7021. for loading a file.  COMMAND-n operates  similarly, except that the load
  7022. is  done  with  :VERBOSE  and  :PRINT  flags  set.  These  can  also  be
  7023. accomplished by a pull-down menu selection.
  7024.  
  7025.  
  7026.  
  7027. logand
  7028. ________________________________________________________________________
  7029.  
  7030. type: function (subr) 
  7031. lnt  in  MACROEXPAND-1  for the
  7032. environment  of the  expansion.  XLISP does not  support  this  optional
  7033. argument.
  7034.  
  7035.  
  7036. macrolet
  7037. ________________________________________________________________________
  7038.  
  7039. type: special form (fsubr)
  7040. location: built-in
  7041. source file: xlcont.c
  7042. Common LISP compatible: yes
  7043. supported on: all machines
  7044.  
  7045. SYNTAX
  7046.  
  7047. (macrolet  ( [ <macro> ... ]  ) <expr> ... )
  7048.     <macro>        -    a macro definition binding which is of the 
  7049.                 form  ( <symbol> <arg-list> <body> )
  7050.     <symbol>    -    the symbol specifying the function name
  7051.     <arg-list>    -    the argument list for the function 
  7052.     <body>        -    the body of the function
  7053.     <expr>        -    an expression
  7054.  
  7055. DESCRIPTION
  7056.  
  7057. The  MACROLET  special  form is basically a local block  construct  that
  7058. allows  local  <macro>  definitions  followed  by a  block  of  code  to
  7059. evaluate.  The first form after the macrolet is the 'binding'  form.  It
  7060. contains  a series of  <macro>s.  The  MACROLET  form will  sequentially
  7061. execute the <expr>'s after defining the <macro>s.  The value of the last
  7062. <expr> evaluated is returned.  When the MACROLET is finished  execution,
  7063. the <symbol>'s that were defined will no longer exist.
  7064.  
  7065. EXAMPLES
  7066.  
  7067.                         ; a MACROLET form including
  7068.     (macrolet ((pls (n1 n2) `(+ ,n1 ,n2)))    ;  PLS macro
  7069.       (pls 4 5))                ;  returns 9
  7070.                         ; the PLS macro no longer exists
  7071.     (pls 4 5)                ; error: unbound function - PLS
  7072.  
  7073.                         ; an empty MACROLET
  7074.     (macrolet () (print 'a))        ; prints A
  7075.  
  7076.  
  7077. make-array
  7078. ________________________________________________________________________
  7079.  
  7080. type: function (subr) 
  7081. location: built-in
  7082. source file: xlbfun.c
  7083. Common LISP compatible: similar
  7084. supported on: all machines
  7085.  
  7086. SYNTAX
  7087.  
  7088. (make-array <size> )
  7089.     <size>        -    the size (integer) of the array to be created
  7090.  
  7091. DESCRIPTION
  7092.  
  7093. MAKE-ARRAY creates an array of the specified size and returns the array.
  7094. Array  elements  may be any valid  lisp data type -  including  lists or
  7095. arrays.  Arrays  made by  MAKE-ARRAY  and  accessed  by AREF are base 0.
  7096. This means the first  element is  accessed  by element  number 0 and the
  7097. last  element is  accessed  by element  number n-1 (where n is the array
  7098. size).  Array elements are initialized to NIL.
  7099.  
  7100. EXAMPLES
  7101.     (setq my-array (make-array 16))        ; make the array
  7102.     (aref my-array 0)            ; return 0th (first) element
  7103.     (aref my-array 15)            ; return 15th (last) element
  7104.     (aref my-array 16)            ; error: non existant element
  7105.     (dotimes (i 16)             ; set each element to its index
  7106.          (setf (aref my-array i) i))    ;     by the setf function
  7107.  
  7108.     (setq new (make-array 4))        ; make another array
  7109.     (setf (aref new 0) (make-array 4))    ; make new[0] an array of 4
  7110.     (setf (aref (aref new 0) 1) 'a)        ; set new[0,1] = 'a
  7111.     (setf (aref new 2) '(a b c))        ; set new[2] = '(a b c)
  7112.     my-array                ; look at array
  7113.  
  7114. READ MACRO:
  7115. There is a built-in  read-macro  for arrays - # (the hash symbol).  This
  7116. allows you to create  arbitrary arrays with initial values without going
  7117. through a  MAKE-ARRAY  function.  There is also the VECTOR  function  to
  7118. create initialized arrays.  For example:
  7119.  
  7120.     (aref #(0 1 2) 1)            ; returns 1
  7121.  
  7122. COMMON LISP COMPATABILITY:
  7123. XLISP  only  supports   one-dimensional  arrays.  Common  LISP  supports
  7124. multi-dimension  arrays.  Common  LISP  also  supports  various  keyword
  7125. parameters that are not supported in XLISP.
  7126.  
  7127.  
  7128. make-string-input-stream
  7129. ________________________________________________________________________
  7130.  
  7131. type: function (subr) 
  7132. location: built-in
  7133. source file: xlfio.c
  7134. Common LISP compatible: yes
  7135. supported on: all machines
  7136.  
  7137. SYNTAX
  7138.  
  7139. (make-string-input-stream <string> [ <start-pos> [ <end-pos> ] ] )
  7140.     <string>    -    a string expression
  7141.     <start-pos>    -    an optional numeric expression, default value
  7142.                 is 0 (giving the first character of the string)
  7143.     <end-pos>    -    an optional numeric expression, default value
  7144.                 is the length of the string
  7145.  
  7146. DESCRIPTION
  7147.  
  7148. The MAKE-STRING-INPUT-STREAM function creates an unnamed stream from the
  7149. <string>  expression.  The stream  can then be used as any other  stream
  7150. object.  The optional  <start-pos>  expression  specifies  the  starting
  7151. offset of the <string>  expression.  A <start-pos>  of 0 will start with
  7152. the  beginning  of  the  <string>.  The  optional  <end-pos>  expression
  7153. specifies the ending offset of the <string>  expression.  A <end-pos> of
  7154. 4 will  make  the  fourth  character  the  last  in the  stream.  If the
  7155. function is  successful,  it returns the unnamed stream  object.  If the
  7156. string is empty, an unnamed stream is still returned.  Error  conditions
  7157. include <start-pos> and <end-pos> being out of bounds.
  7158.  
  7159. EXAMPLES
  7160.  
  7161.     (make-string-input-stream "abcdefgh")    ; returns #<Unnamed-Stream: #277e2>
  7162.     (read (make-string-input-stream     ;
  7163.              "123456"))            ; returns 123456
  7164.     (read (make-string-input-stream     ;
  7165.              "123456" 1))            ; returns 23456
  7166.     (read (make-string-input-stream     ;
  7167.              "123456" 1 3))            ; returns 23
  7168.  
  7169.     (read (make-string-input-stream     ;
  7170.              "123" 0))            ; returns 123
  7171.     (read (make-string-input-stream     ;
  7172.              "123" 0 3))            ; returns 123
  7173.     (read (make-string-input-stream     ;
  7174.              "123" 2 1))            ; returns NIL
  7175.     (read (make-string-input-stream     ;
  7176.              "123" 0 4))            ; error: string index out of 
  7177.                          ;        bounds - 4
  7178.  
  7179.  
  7180. make-string-output-stream
  7181. ________________________________________________________________________
  7182.  
  7183. type: function (subr) 
  7184. location: built-in
  7185. source file: xlfio.c
  7186. Common LISP compatible: yes
  7187. supported on: all machines
  7188.  
  7189. SYNTAX
  7190.  
  7191. (make-string-output-stream)
  7192.  
  7193.  
  7194. DESCRIPTION
  7195.  
  7196. The  MAKE-STRING-OUTPUT-STREAM  function  creates and returns an unnamed
  7197. output stream.  The stream can then be used as any other stream  object.
  7198.  
  7199.  
  7200. EXAMPLES
  7201.  
  7202.     (make-string-output-stream)        ; returns #<Unnamed-Stream: #2d9c0>
  7203.     (setq out (make-string-output-stream))    ; returns #<Unnamed-Stream: #2d95c>
  7204.     (format out "fee fi fo fum ")        ; \
  7205.     (format out "I smell the blood of ")    ;  fill up output stream
  7206.     (format out "Elmer Fudd")        ; /
  7207.     (get-output-stream-string out)        ; returns 
  7208.                         ;    "fee fi fo fum I smell
  7209.                         ;       the blood of Elmer Fudd"
  7210.     (format out "~%now what")        ; add more to output stream
  7211.     (get-output-stream-string out)        ; returns "\nnow what"
  7212.     (format out "hello")            ; add more to output stream
  7213.     (read out)                ; returns HELLO
  7214.  
  7215.  
  7216. make-symbol
  7217. ________________________________________________________________________
  7218.  
  7219. type: function (subr) 
  7220. location: built-in
  7221. source file: xlbfun.c
  7222. Common LISP compatible: yes
  7223. supported on: all machines
  7224.  
  7225. SYNTAX
  7226.  
  7227. (make-symbol <symbol-str> )
  7228.     <symbol-str>    -    a string expression
  7229.  
  7230. DESCRIPTION
  7231.  
  7232. The MAKE-SYMBOL  function takes a string name - <symbol-str> and creates
  7233. a new symbol.  This symbol is  temporary  and is not  interned  (placed)
  7234. into the symbol hash table  *OBARRAY*.  If the symbol already exists, no
  7235. error or action is taken and the old values and  property  lists  remain
  7236. intact.  The MAKE-SYMBOL function returns the symbol as its result.
  7237.  
  7238. EXAMPLES
  7239.  
  7240.     (defun lookin (sym)             ; create a function to 
  7241.        (aref *obarray*             ;   look inside *OBARRAY*
  7242.              (hash sym (length *obarray*))));   and look for a specific
  7243.                         ;   symbol - returns a list
  7244.  
  7245.     (lookin "FEE")                ; returns (CHAR-INT NTH ++) 
  7246.                         ;   FEE symbol doesn't exist
  7247.     (MAKE-SYMBOL "FEE")            ; returns FEE symbol
  7248.     (lookin "FEE")                ; returns (CHAR-INT NTH ++) 
  7249.                         ;   FEE still doesn't exist
  7250.     (intern "FEE")                ; intern FEE symbol
  7251.     (lookin "FEE")                ; returns (FEE CHAR-INT NTH ++) 
  7252.                         ;   FEE does now exist
  7253.  
  7254. NOTE:
  7255. When you  MAKE-SYMBOL  a symbol  like  "fingers",  this is a lower  case
  7256. symbol.  Note  that  this  is  different  from  doing a  MAKE-SYMBOL  on
  7257. "FINGERS".  "fingers" and "FINGERS" are two different symbols.  Remember
  7258. also that normal symbols created by XLISP are upper case names.
  7259.  
  7260.  
  7261. makunbound
  7262. ________________________________________________________________________
  7263.  
  7264. type: defined function (closure)
  7265. location: extension
  7266. source file: init.lsp
  7267. Common LISP compatible: yes
  7268. supported on: all machines
  7269.  
  7270. SYNTAX
  7271.  
  7272. (makunbound  <symbol> )
  7273.     <symbol>    -    an expression evaluating to a symbol
  7274.  
  7275. DESCRIPTION
  7276.  
  7277. The  MAKUNBOUND  function makes a symbol's value  unbound.  The <symbol>
  7278. must be a valid  symbol,  but it does  not  need  to have a  value.  The
  7279. MAKUNBOUND function returns the symbol as its result.
  7280.  
  7281. EXAMPLES
  7282.  
  7283.     (makunbound 'florp)            ; returns FLORP
  7284.     (setq myvar "hi")            ; setup MYVAR "hi"
  7285.     myvar                    ; returns "hi"
  7286.     (makunbound 'myvar)            ; returns MYVAR
  7287.     myvar                    ; error: unbound variable
  7288.  
  7289. NOTE:
  7290. MAKUNBOUND is not misspelled - there is no 'e' in it.
  7291.  
  7292. NOTE:
  7293. The  FMAKUNBOUND  works on  functions  (closures)  in the same way  that
  7294. MAKUNBOUND  works on variables.  Be sure to use the correct one for what
  7295. you are unbinding.  These  functions do not generate an error if you try
  7296. to unbind the wrong  type.  This is because of the  definition  of these
  7297. functions  and the fact that the function and  variable  name spaces are
  7298. separate.  You can have both a function called FOO and a variable called
  7299. FOO.
  7300.  
  7301. NOTE:
  7302. The function MAKUNBOUND is created in the INIT.LSP file.  If it does not
  7303. exist in your XLISP system, you might be having a problem with INIT.LSP.
  7304. Before you start XLISP, look in the directory you are currently  in, and
  7305. check to see if there is an INIT.LSP.
  7306.  
  7307.  
  7308. mapc
  7309. ________________________________________________________________________
  7310.  
  7311. type: function (subr) 
  7312. location: built-in
  7313. source file: xllist.c
  7314. Common LISP compatible: yes
  7315. supported on: all machines
  7316.  
  7317. SYNTAX
  7318.  
  7319. (mapc <function> <list1> [ <list2> ... ] )
  7320.     <function>    -    a function definition (like a LAMBDA) 
  7321.                 or a function name
  7322.     <listN>        -    a list or list expression
  7323.  
  7324. DESCRIPTION
  7325.  
  7326. MAPC applies the  <function> to the succesive  CARs of each of the lists
  7327. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7328. The MAPC  function  returns a list that is  equivalent to the first list
  7329. <list1>.  It's purpose is to perform operations that have  side-effects.
  7330. If the lists are of different  lengths, the shortest list will determine
  7331. the number of applications of <function>.
  7332.  
  7333. EXAMPLES
  7334.  
  7335.     (mapc 'princ '(hi there bob))        ; prints HITHEREBOB
  7336.                         ;   returns (HI THERE BOB)
  7337.  
  7338.     (mapc '+ '(1 2 3) '(1 2 3))        ; returns (1 2 3)
  7339.                         ;   there were no side effects
  7340.  
  7341.     (mapc (lambda (x y) (print (+ x y)))    ; define fun. with side effects
  7342.           '(1 2 3) '(1 2 3))        ;   prints 2 4 6 
  7343.                         ;   returns (1 2 3)
  7344.  
  7345. NOTE:
  7346. The use of the <function>  will work properly when it is a quoted symbol
  7347. (which is the name of the function), an unquoted  symbol (whose value is
  7348. a function) or a closure object (like a LAMBDA).
  7349.  
  7350.  
  7351. mapcan
  7352. ________________________________________________________________________
  7353.  
  7354. type: defined macro (closure)
  7355. location: extension
  7356. source file: init.lsp
  7357. Common LISP compatible: yes
  7358. supported on: all machines
  7359.  
  7360. SYNTAX
  7361.  
  7362. (mapcan <function> <list1> [ <list2> ... ] )
  7363.     <function>    -    a function definition (like a LAMBDA) 
  7364.                 or a function name
  7365.     <listN>        -    a list or list expression
  7366.  
  7367. DESCRIPTION
  7368.  
  7369. MAPCAN applies the <function> to the succesive CARs of each of the lists
  7370. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7371. MAPCAN is similar to MAPCAR, except that the MAPCAN macro returns a list
  7372. that is constructed via the destructive  NCONC function from the results
  7373. of the <function>  applications.  If the lists are of different lengths,
  7374. the  shortest  list  will  determine  the  number  of  applications   of
  7375. <function>.
  7376.  
  7377. EXAMPLES
  7378.  
  7379.     (mapcar 'list '(1 2 3) '(a b c) )    ; returns ((1 A) (2 B) (3 C))
  7380.     (mapcan 'list '(1 2 3) '(a b c) )    ; returns (1 A 2 B 3 C)
  7381.     (mapcan 'list '(a b c)             ; different length lists
  7382.            '(1 2 3 4 5 6))        ;   returns (A 1 B 2 C 3)
  7383.  
  7384. NOTE:
  7385. Remember that MAPCAN uses NCONC and so it deals with its list  arguments
  7386. destructively.  It is often  used when you want to  remove  NIL  entries
  7387. from the resulting list - because NCONC will take out the NILs.
  7388.  
  7389. NOTE:
  7390. The use of the <function>  will work properly when it is a quoted symbol
  7391. (which is the name of the function), an unquoted  symbol (whose value is
  7392. a function) or a closure object (like a LAMBDA).
  7393.  
  7394. NOTE:
  7395. The macros MAPCAN and MAPCON are created in the INIT.LSP  file.  If they
  7396. do not exist in your XLISP  system,  you might be having a problem  with
  7397. INIT.LSP.  Before  you  start  XLISP,  look  in the  directory  you  are
  7398. currently in, and check to see if there is an INIT.LSP.
  7399.  
  7400.  
  7401. mapcar
  7402. ________________________________________________________________________
  7403.  
  7404. type: function (subr) 
  7405. location: built-in
  7406. source file: xllist.c
  7407. Common LISP compatible: yes
  7408. supported on: all machines
  7409.  
  7410. SYNTAX
  7411.  
  7412. (mapcar <function> <list1> [ <list2> ... ] )
  7413.     <function>    -    a function definition (like a LAMBDA) 
  7414.                 or a function name
  7415.     <listN>        -    a list or list expression
  7416.  
  7417. DESCRIPTION
  7418.  
  7419. MAPCAR applies the <function> to the succesive CARs of each of the lists
  7420. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7421. The MAPCAR function  returns a list that is constructed from the results
  7422. of the <function>  applications.  If the lists are of different lengths,
  7423. the  shortest  list  will  determine  the  number  of  applications   of
  7424. <function>.
  7425.  
  7426. EXAMPLES
  7427.  
  7428.     (mapcar '+ '(1 2 3) '(1 2 3))        ; returns (2 4 6)
  7429.     (mapcar 'princ '(1 2 3))        ; prints 123
  7430.                         ;   returns (1 2 3)
  7431.     (mapcar '+ '(1 2 3)             ; different length lists
  7432.            '(1 2 3 4 5 6))        ;   returns (2 4 6)
  7433.  
  7434. NOTE:
  7435. The use of the <function>  will work properly when it is a quoted symbol
  7436. (which is the name of the function), an unquoted  symbol (whose value is
  7437. a function) or a closure object (like a LAMBDA).
  7438.  
  7439.  
  7440. mapcon
  7441. ________________________________________________________________________
  7442.  
  7443. type: defined macro (closure)
  7444. location: extension
  7445. source file: init.lsp
  7446. Common LISP compatible: yes
  7447. supported on: all machines
  7448.  
  7449. SYNTAX
  7450.  
  7451. (mapcon <function> <list1> [ <list2> ... ] )
  7452.     <function>    -    a function definition (like a LAMBDA) 
  7453.                 or a function name
  7454.     <listN>        -    a list or list expression
  7455.  
  7456. DESCRIPTION
  7457.  
  7458. MAPCON  applies the  <function>  to the  successive  CDRs of each of the
  7459. lists  <listN>.  Each of the  lists  supplies  one of the  arguments  to
  7460. <function>.  The MAPCON macro is similar to the MAPLIST function, except
  7461. that MAPCON returns a list that is constructed via the destructive NCONC
  7462. function from the results of the <function>  applications.  If the lists
  7463. are of different lengths, the shortest list will determine the number of
  7464. applications of <function>.
  7465.  
  7466. EXAMPLES
  7467.  
  7468.     (maplist 'list '(a b))            ; returns (((A B)) ((B)))
  7469.     (mapcon  'list '(a b))            ; returns ((A B) (B))
  7470.  
  7471. NOTE:
  7472. Remember that MAPCON uses NCONC and so it  destructively  deals with its
  7473. list arguments.
  7474.  
  7475. NOTE:
  7476. The use of the <function>  will work properly when it is a quoted symbol
  7477. (which is the name of the function), an unquoted  symbol (whose value is
  7478. a function) or a closure object (like a LAMBDA).
  7479.  
  7480. NOTE:
  7481. The macros MAPCAN and MAPCON are created in the INIT.LSP  file.  If they
  7482. do not exist in your XLISP  system,  you might be having a problem  with
  7483. INIT.LSP.  Before  you  start  XLISP,  look  in the  directory  you  are
  7484. currently in, and check to see if there is an INIT.LSP.
  7485.  
  7486.  
  7487. mapl
  7488. ________________________________________________________________________
  7489.  
  7490. type: function (subr) 
  7491. location: built-in
  7492. source file: xllist.c
  7493. Common LISP compatible: yes
  7494. supported on: all machines
  7495.  
  7496. SYNTAX
  7497.  
  7498. (mapl <function> <list1> [ <list2> ... ] )
  7499.     <function>    -    a function definition (like a LAMBDA) 
  7500.                 or a function name
  7501.     <listN>        -    a list or list expression
  7502.  
  7503. DESCRIPTION
  7504.  
  7505. MAPL applies the <function> to the successive  CDRs of each of the lists
  7506. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7507. The MAPL  function  returns a list that is  equivalent to the first list
  7508. <list1>.  It's purpose is to perform operations that have  side-effects.
  7509. If the lists are of different  lengths, the shortest list will determine
  7510. the number of applications of <function>.
  7511.  
  7512. EXAMPLES
  7513.  
  7514.     (mapl 'print '(a b c))            ; prints (A B C)
  7515.                         ;        (B C)
  7516.                         ;        (C)
  7517.                         ; returns (A B C)
  7518.  
  7519.     (mapl (lambda (x y) (princ x) (princ y)    ; apply lambda fun. to list
  7520.                 (terpri))        ;
  7521.           '(a b c) '(1 2 3))        ; prints (A B C)(1 2 3)
  7522.                         ;        (B C)(2 3)
  7523.                         ;        (C)(3)
  7524.                         ; returns (A B C)
  7525.  
  7526. NOTE:
  7527. The use of the <function>  will work properly when it is a quoted symbol
  7528. (which is the name of the function), an unquoted  symbol (whose value is
  7529. a function) or a closure object (like a LAMBDA).
  7530.  
  7531.  
  7532. maplist
  7533. ________________________________________________________________________
  7534.  
  7535. type: function (subr) 
  7536. location: built-in
  7537. source file: xllist.c
  7538. Common LISP compatible: yes
  7539. supported on: all machines
  7540.  
  7541. SYNTAX
  7542.  
  7543. (maplist <function> <list1> [ <list2> ... ] )
  7544.     <function>    -    a function definition (like a LAMBDA) 
  7545.                 or a function name
  7546.     <listN>        -    a list or list expression
  7547.  
  7548. DESCRIPTION
  7549.  
  7550. MAPLIST  applies the  <function> to the  successive  CDRs of each of the
  7551. lists  <listN>.  Each of the  lists  supplies  one of the  arguments  to
  7552. <function>.  The  MAPLIST  function  returns a list that is  constructed
  7553. from the  results of the  <function>  applications.  If the lists are of
  7554. different  lengths,  the  shortest  list will  determine  the  number of
  7555. applications of <function>.
  7556.  
  7557. EXAMPLES
  7558.  
  7559.     (maplist 'print '(a b c))        ; prints (A B C)
  7560.                         ;        (B C)
  7561.                         ;        (C)
  7562.                         ; returns ((A B C) (B C) (C))
  7563.  
  7564.     (maplist (lambda (x y)             ; append the lists into one    
  7565.              (length (append x y)))    ;   list and find it's length
  7566.          '(a b c d) '(1 2 3 4))        ; returns (8 6 4 2)
  7567.  
  7568. NOTE:
  7569. The use of the <function>  will work properly when it is a quoted symbol
  7570. (which is the name of the function), an unquoted  symbol (whose value is
  7571. a function) or a closure object (like a LAMBDA).
  7572.  
  7573.  
  7574. max
  7575. ________________________________________________________________________
  7576.  
  7577. type: function (subr) 
  7578. location: built-in
  7579. source file: xlmath.c
  7580. Common LISP compatible: yes
  7581. supported on: all machines
  7582.  
  7583. SYNTAX
  7584.  
  7585. (max <expr1> ... )
  7586.     <exprN>        -    integer or floating point number/expression
  7587.  
  7588. DESCRIPTION
  7589.  
  7590. The MAX function returns the largest numeric expression from the list of
  7591. arguments.
  7592.  
  7593. EXAMPLES
  7594.  
  7595.     (max 1)                    ; returns 1
  7596.     (max 1 -5 9)                ; returns 9
  7597.  
  7598.     (setq a '( 9 3 5 2))            ; set up a list - (9 3 5 2)
  7599.     (apply 'max a)                ; returns 9
  7600.     (apply #'max a)                ; returns 9
  7601.     (apply 'min a)                ; returns 2
  7602.  
  7603.  
  7604. member
  7605. ________________________________________________________________________
  7606.  
  7607. type: function (subr) 
  7608. location: built-in
  7609. source file: xllist.c
  7610. Common LISP compatible: similar
  7611. supported on: all machines
  7612.  
  7613. SYNTAX
  7614.  
  7615. (member <expr> <list-expr> [ { :test | :test-not } <test> ] )
  7616.     <expr>        -    the expression to find - an atom or list
  7617.     <list-expr>    -    the list to search
  7618.     <test>        -    optional test function (default is EQL)
  7619.  
  7620. DESCRIPTION
  7621.  
  7622. MEMBER  searches  through  <list-expr>  for  <expr>.  If  found,  MEMBER
  7623. returns the  remainder  of the  <list-expr>  starting  with  <expr>.  If
  7624. <expr> is not found, a NIL is  returned.  You may specify  your own test
  7625. with the :TEST and :TEST-NOT  keywords followed by the test you which to
  7626. perform.
  7627.  
  7628. EXAMPLES
  7629.  
  7630.     (member 'a '(1 2 3 4))            ; returns NIL
  7631.     (member '2 '(1 2 3 4))            ; returns (2 3 4)
  7632.  
  7633.     (setq mylist '(2 4 8 16 32 64 128 256))    ; make a numeric list
  7634.     (member 6 mylist :test '<)        ; returns (8 16 32 64 128 256)
  7635.     (member 6 (reverse mylist) :test-not '<); returns (4 2)
  7636.     (member '20 '(60 40 20 10) :test '> )    ; returns (10)
  7637.  
  7638.     (member '(a) '((see) (a) (cat))     ; returns ((A) (CAT))
  7639.               :test 'equal)        ;   note EQUAL as test
  7640.     (member "hi" '("a" "hi" "c")         ; returns ("hi" "c")
  7641.         :test 'string= )        ;   note STRING= as test
  7642.  
  7643.  
  7644. NOTE:
  7645. The  MEMBER  function  can work  with a list or  string  as the  <expr>.
  7646. However, the default EQL test does not work with lists or strings,  only
  7647. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  7648. keyword along with EQUAL for <test>.
  7649.  
  7650. COMMON LISP COMPATABILITY:
  7651. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  7652. function  that is applied to each  element of  <list-expr>  before it is
  7653. tested.  XLISP does not support this.
  7654.  
  7655.  
  7656.  
  7657. :mescape
  7658. ________________________________________________________________________
  7659.  
  7660. type: keyword
  7661. location: built-in
  7662. source file: xlread.c
  7663. Common LISP compatible: no
  7664. supported on: all machines
  7665.  
  7666. SYNTAX
  7667.  
  7668. :mescape
  7669.  
  7670.  
  7671. DESCRIPTION
  7672.  
  7673. :MESCAPE is an entry that is used in the  *READTABLE*.  *READTABLE* is a
  7674. system  variable that contains  XLISP's data structures  relating to the
  7675. processing  of  characters  from  the  user (or  files)  and  read-macro
  7676. expansions.  The  existance  of the  :MESCAPE  keyword  means  that  the
  7677. specified  character is to be used as a multiple escape  character.  The
  7678. system  defines  that  the the  vertical  bar  character  | is the  only
  7679. :MESCAPE character.
  7680.  
  7681. EXAMPLES
  7682.  
  7683.     (defun look-at (table)            ; define a function to 
  7684.      (dotimes (ch 127)            ;   look in a table
  7685.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  7686.         (case entry             ;   entries with a function
  7687.           (:MESCAPE             ;
  7688.               (princ (int-char ch)))    ;
  7689.           (T        NIL))))        ;
  7690.      (terpri))                ;
  7691.     (look-at *readtable*)            ;  prints  | 
  7692.  
  7693. CAUTION:
  7694. If you experiment  with  *READTABLE*, it is useful to save the old value
  7695. in a variable, so that you can restore the system state.
  7696.  
  7697.  
  7698. min
  7699. ________________________________________________________________________
  7700.  
  7701. type: function (subr) 
  7702. location: built-in
  7703. source file: xlmath.c
  7704. Common LISP compatible: yes
  7705. supported on: all machines
  7706.  
  7707. SYNTAX
  7708.  
  7709. (min <expr1> ... )
  7710.     <exprN>        -    integer or floating point number/expression
  7711.  
  7712. DESCRIPTION
  7713.  
  7714. The MIN  function  returns the  minimum  (most  negative or most  nearly
  7715. negative) numeric expression from the list of arguments.
  7716.  
  7717. EXAMPLES
  7718.  
  7719.     (min 1)                    ; returns 1
  7720.     (min 8 7 4 2)                ; returns 2
  7721.     (min 2 3 -1 -99)            ; returns -99
  7722.     (setq a '( 9 3 5 2))            ; make a numeric list - (9 3 5 2)
  7723.     (apply 'min a)                ; returns 2
  7724.     (apply #'min a)                ; returns 2
  7725.     (apply 'max a)                ; returns 9
  7726.  
  7727.  
  7728. minusp
  7729. ________________________________________________________________________
  7730.  
  7731. type: predicate function (subr)
  7732. location: built-in
  7733. source file: xlmath.c
  7734. Common LISP compatible: yes
  7735. supported on: all machines
  7736.  
  7737. SYNTAX
  7738.  
  7739. (minusp <expr> )
  7740.     <expr>        -    the numeric expression to check
  7741.  
  7742. DESCRIPTION
  7743.  
  7744. The MINUSP predicate  checks to see if the number <expr> is negative.  T
  7745. is returned if the number is negative  (less than zero), NIL is returned
  7746. otherwise.  A bad argument  type error is generated if the <expr> is not
  7747. a numeric expression.
  7748.  
  7749. EXAMPLES
  7750.  
  7751.     (minusp 1)                ; returns NIL
  7752.     (minusp 0)                ; returns NIL
  7753.     (minusp -1)                ; returns T
  7754.     (minusp -.000000005)            ; returns T
  7755.     (minusp #xFFFFFFFF)            ; returns T
  7756.     (minusp #x01)                ; returns NIL
  7757.  
  7758.     (minusp 'a)                ; error: bad argument type
  7759.     (setq a -3.5)                ; set A to -3.5
  7760.     (minusp a)                ; returns T
  7761.  
  7762.  
  7763. nconc
  7764. ________________________________________________________________________
  7765.  
  7766. type: function (subr) 
  7767. location: built-in
  7768. source file: xllist.c
  7769. Common LISP compatible: yes
  7770. supported on: all machines
  7771.  
  7772. SYNTAX
  7773.  
  7774. (nconc [ <list1> ... ] )
  7775.     <listN>        -    a list to DESTRUCTIVELY concatenate
  7776.  
  7777. DESCRIPTION
  7778.  
  7779. NCONC  destructively  concatenates  a sequence of lists and returns  the
  7780. result of this concatentation.  The destructive aspect of this operation
  7781. means  that the  actual  symbol  values  are used in the  list-modifying
  7782. operations  - not  copies.  This  means, for  NCONC,  that the lists are
  7783. spliced  together.  <listN> must  evaluate to a valid list.  An atom for
  7784. <listN> will result in an error.  NIL is a valid <listN>.
  7785.  
  7786. EXAMPLES
  7787.  
  7788.     (setq a '(1 2 3))            ; set up A with (1 2 3)
  7789.     (setq b '(4 5 6))            ; set up B with (4 5 6)
  7790.     (setq c '(7 8 9))            ; set up C with (7 8 9)
  7791.     (NCONC a b c)                ; returns (1 2 3 4 5 6 7 8 9)
  7792.     (setf (nth 8 a) 'end)            ; change last element of A
  7793.     (print a)                ; prints (1 2 3 4 5 6 7 8 END)
  7794.     (print b)                ; prints (4 5 6 7 8 END)
  7795.     (print c)                ; prints (7 8 END)
  7796.  
  7797.  
  7798. :new
  7799. ________________________________________________________________________
  7800.  
  7801. type: message selector
  7802. location: built-in
  7803. source file: xlobj.c
  7804. Common LISP compatible: no
  7805. supported on: all machines
  7806.  
  7807. SYNTAX
  7808.  
  7809. (send <class> :new <args> )
  7810.     <class>        -    an existing XLISP class except for 'CLASS'
  7811.     <args>        -    the init. args for the new instance 
  7812. (send class :new <ivars> [ <cvars> [ <superclass> ] ] )
  7813.     <ivars>        -    list of instance variables for new class
  7814.     <cvars>        -    list of class variable symbols for new class
  7815.     <superclass>    -    superclass for new object 
  7816.                 (the default is 'OBJECT')
  7817.  
  7818. DESCRIPTION
  7819.  
  7820. The :NEW message selector exhibits 2 different  behaviors.  When you are
  7821. creating  an  instance  of a  class  you  only  need  the  :NEW  message
  7822. (consisting  of the  message  selector  and  any  data).  When  you  are
  7823. creating a new class with :NEW, you need to specify  instance  variables
  7824. and optionally the class variables and superclass.
  7825.  
  7826. EXAMPLES
  7827.     (setq new-class             ; create NEW-CLASS with STATE
  7828.         (send class :new '(state)))    ;
  7829.     (setq new-obj (send new-class :new))    ; create NEW-OBJ of NEW-CLASS
  7830.     (send new-obj :show)            ; shows the object
  7831.     (setq sub-class             ; create SUB-CLASS of NEW-CLASS
  7832.         (send class :new '(sub-state)     ;
  7833.                  '() new-class));
  7834.     (send sub-class :show)            ; show the SUB-CLASS
  7835.  
  7836. nil
  7837. ________________________________________________________________________
  7838.  
  7839. type: system constant
  7840. location: built-in
  7841. source file: xlsym.c
  7842. Common LISP compatible: yes
  7843. supported on: all machines
  7844.  
  7845. SYNTAX
  7846.  
  7847. nil
  7848.  
  7849. DESCRIPTION
  7850.  
  7851. The NIL  constant  represents  the empty  list or the  false  value - as
  7852. oppossed  to the true value (the  symbol T).  NIL can be writen as the 3
  7853. character symbol NIL or as the empty list ().
  7854.  
  7855. EXAMPLES
  7856.     (setq myvar NIL)            ; set MYVAR to False
  7857.     (setq myvar 'NIL)            ; NIL and 'NIL evaluate to NIL    
  7858.     (setq myvar ())                ; () is the empty list = NIL
  7859.     (setq myvar '())            ; () and '() evaluate to NIL
  7860.     (if nil (print "this won't print")    ; if/then/else
  7861.             (print "this will print"))
  7862.  
  7863. NOTE:
  7864. You can not change the value of NIL.
  7865.  
  7866.  
  7867. :nmacro
  7868. ________________________________________________________________________
  7869.  
  7870. type: keyword
  7871. location: built-in
  7872. source file: xlread.c
  7873. Common LISP compatible: no
  7874. supported on: all machines
  7875.  
  7876. SYNTAX
  7877.  
  7878. (:nmacro  .  <function> )
  7879.     <function>    -    a function
  7880.  
  7881. DESCRIPTION
  7882.  
  7883. :NMACRO is an entry that is used in the  *READTABLE*.  *READTABLE*  is a
  7884. system  variable that contains  XLISP's data structures  relating to the
  7885. processing  of  characters  from  the  user (or  files)  and  read-macro
  7886. expansions.  The  existance  of  the  :NMACRO  keyword  means  that  the
  7887. specified character is the start of a non-terminal  macro.  For :NMACRO,
  7888. the form of the  *READTABLE*  entry is a dotted  pair  like  (:NMACRO  .
  7889. <function> ).  The <function> can be a built-in read-macro function or a
  7890. user defined lambda expression.  The <function> takes two parameters, an
  7891. input stream  specification, and an integer that is the character value.
  7892. The <function>  should return NIL if the character is 'white-space' or a
  7893. value CONSed with NIL to return the value.  The <function> will probably
  7894. read additional characters from the input stream.
  7895.  
  7896. EXAMPLES
  7897.  
  7898.     (defun look-at (table)            ; define a function to 
  7899.      (dotimes (ch 127)            ;   look in a table
  7900.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  7901.             (if (and (consp entry)        ;   :NMACRO entries
  7902.                      (equal (car entry)     ;
  7903.                     ':NMACRO))    ;
  7904.               (princ (int-char ch)))))    ;
  7905.      (terpri))                ;
  7906.                          ;
  7907.     (look-at *readtable*)            ;  prints  #
  7908.  
  7909. NOTE:
  7910. The system defines that the hash (#) character is a  non-terminal.  This
  7911. is because  the hash is used for a variety  of 'read  macro  expansions'
  7912. including FUNCTION, an ASCII code, and hexadecimal numbers.
  7913.  
  7914. CAUTION:
  7915. If you experiment  with  *READTABLE*, it is useful to save the old value
  7916. in a variable, so that you can restore the system state.
  7917.  
  7918.  
  7919. nodebug
  7920. ________________________________________________________________________
  7921.  
  7922. type: defined function (closure) 
  7923. location: extension
  7924. source file: init.lsp
  7925. Common LISP compatible: no
  7926. supported on: all machines
  7927.  
  7928. SYNTAX
  7929.  
  7930. (nodebug)
  7931.  
  7932.  
  7933. DESCRIPTION
  7934.  
  7935. The NODEBUG function sets  *BREAKENABLE* to NIL.  This has the effect of
  7936. turning off the break loop for errors.  NODEBUG always returns NIL.  The
  7937. default is DEBUG enabled.
  7938.  
  7939. EXAMPLES
  7940.  
  7941.     (nodebug)                ; returns NIL
  7942.     (+ 1 "a")                ; error: bad argument type
  7943.                         ; but doesn't enter break-loop
  7944.     (debug)                    ; returns T
  7945.     (+ 1 "a")                ; error: bad argument type
  7946.                         ; enters break-loop
  7947.     (clean-up)                ; from within the break-loop
  7948.  
  7949. NOTE:
  7950. The  functions  DEBUG and NODEBUG are created in the INIT.LSP  file.  If
  7951. they do not exist in your  XLISP  system,  you might be having a problem
  7952. with  INIT.LSP.  Before you start XLISP, look in the  directory  you are
  7953. currently in, and check to see if there is an INIT.LSP.
  7954.  
  7955.  
  7956. not
  7957. ________________________________________________________________________
  7958.  
  7959. type: predicate function (subr)
  7960. location: built-in
  7961. source file: xlbfun.c
  7962. Common LISP compatible: yes
  7963. supported on: all machines
  7964.  
  7965. SYNTAX
  7966.  
  7967. (not <expr> )
  7968.     <expr>        -    the expression to check
  7969.  
  7970. DESCRIPTION
  7971.  
  7972. The NOT  predicate  checks to see if the <expr> is false.  T is returned
  7973. if the expression is NIL, NIL is returned otherwise.
  7974.  
  7975. EXAMPLES
  7976.  
  7977.     (not '())                ; returns T - empty list
  7978.     (not ())                ; returns T - still empty
  7979.     (setq a NIL)                ; set up a variable
  7980.     (not a)                    ; returns T - value = empty list
  7981.  
  7982.     (not "a")                ; returns NIL - not a list
  7983.     (not 'a)                ; returns NIL - not a list
  7984.  
  7985. NOTE:
  7986. The NOT predicate is the same function as the NULL predicate.  
  7987.  
  7988.  
  7989. nstring-downcase
  7990. ________________________________________________________________________
  7991.  
  7992. type: function (subr) 
  7993. location: built-in
  7994. source file: xlstr.c
  7995. Common LISP compatible: yes
  7996. supported on: all machines
  7997.  
  7998. SYNTAX
  7999.  
  8000. (nstring-downcase <string> [ { :start | :end } <offset> ] ... )
  8001.     <string>    -    a string expression
  8002.     <offset>    -    an optional integer expression (for a keyword)
  8003.  
  8004. DESCRIPTION
  8005.  
  8006. The NSTRING-DOWNCASE function takes a string argument and makes it lower
  8007. case.  This function  modifies the string (or string variable  itself) -
  8008. it does not just make a copy.  The lower case string is returned.
  8009.  
  8010. The keyword  arguments allow for accessing  substrings  within <string>.
  8011. The  keyword  arguments  require a keyword  (:START or :END) first and a
  8012. single  integer  expression  second.  The :START  keyword  specifies the
  8013. starting offset for the NSTRING-DOWNCASE operation on <string>.  A value
  8014. of 0 starts the string at the  beginning  (no offset).  The :END keyword
  8015. specifies the end offset for the operation on <string>.
  8016.  
  8017. EXAMPLES
  8018.  
  8019.     (nstring-downcase "ABcd+-12&[")        ; returns "abcd+-&["
  8020.     (nstring-downcase "ABCDEFGH"         ;
  8021.              :start 2 :end 4)    ; returns "ABcdEFGH"
  8022.  
  8023.     (setq mystr "ABcdEFgh")            ; set up variable
  8024.     (nstring-downcase mystr)        ; returns "abcdefgh"
  8025.     (print mystr)                ; prints  "abcdefgh"
  8026.                         ; note that MYSTR is modified
  8027.  
  8028.  
  8029. nstring-upcase
  8030. ________________________________________________________________________
  8031.  
  8032. type: function (subr) 
  8033. location: built-in
  8034. source file: xlstr.c
  8035. Common LISP compatible: yes
  8036. supported on: all machines
  8037.  
  8038. SYNTAX
  8039.  
  8040. (nstring-upcase <string> [ { :start | :end } <offset> ] ... )
  8041.     <string>    -    a string expression
  8042.     <offset>    -    an optional integer expression (for a keyword)
  8043.  
  8044. DESCRIPTION
  8045.  
  8046. The  NSTRING-UPCASE  function takes a string argument and makes it upper
  8047. case.  This function  modifies the string (or string variable  itself) -
  8048. it does not just make a copy.  The upper case string is returned.
  8049.  
  8050. The keyword  arguments allow for accessing  substrings  within <string>.
  8051. The  keyword  arguments  require a keyword  (:START or :END) first and a
  8052. single  integer  expression  second.  The :START  keyword  specifies the
  8053. starting offset for the  NSTRING-UPCASE  operation on <string>.  A value
  8054. of 0 starts the string at the  beginning  (no offset).  The :END keyword
  8055. specifies the end offset for the operation on <string>.
  8056.  
  8057. EXAMPLES
  8058.  
  8059.     (nstring-upcase "ABcd+-12&[")        ; returns "ABCD+-&["
  8060.     (nstring-upcase "abcdefgh"         ;
  8061.              :start 2 :end 4)    ; returns "abCDefgh"
  8062.  
  8063.     (setq mystr "ABcdEFgh")            ; set up variable
  8064.     (nstring-upcase mystr)            ; returns "ABCDEFGH"
  8065.     (print mystr)                ; prints  "ABCDEFGH"
  8066.                         ; note that MYSTR is modified
  8067.  
  8068.  
  8069. nth
  8070. ________________________________________________________________________
  8071.  
  8072. type: function (subr) 
  8073. location: built-in
  8074. source file: xllist.c
  8075. Common LISP compatible: yes
  8076. supported on: all machines
  8077.  
  8078. SYNTAX
  8079.  
  8080. (nth <expr> <list-expr> )
  8081.     <expr>        -    an integer expression
  8082.     <list-expr>    -    a list or list expression
  8083.  
  8084. DESCRIPTION
  8085.  
  8086. NTH returns the <expr>'th element of <list-expr>.  If the <list-expr> is
  8087. shorter than <expr>, a NIL is  returned.  The counting  sequence is base
  8088. zero - the first element is the 0th element.
  8089.  
  8090. EXAMPLES
  8091.  
  8092.     (nth 4 '(0 1 2 3 4 5 6))        ; returns 4
  8093.     (nth 3 '(a b))                ; returns NIL
  8094.  
  8095.     (nth 4 'a)                ; error: bad argument type 
  8096.     (nth 3 "abcdefg")            ; error: bad argument type 
  8097.  
  8098.  
  8099. nthcdr
  8100. ________________________________________________________________________
  8101.  
  8102. type: function (subr) 
  8103. location: built-in
  8104. source file: xllist.c
  8105. Common LISP compatible: yes
  8106. supported on: all machines
  8107.  
  8108. SYNTAX
  8109.  
  8110. (nthcdr <expr> <list-expr> )
  8111.     <expr>        -    an integer expression
  8112.     <list-expr>    -    a list or list expression
  8113.  
  8114. DESCRIPTION
  8115.  
  8116. NTHCDR returns the <expr>'th CDR of  <list-expr>.  If the <list-expr> is
  8117. shorter than <expr>, a NIL is  returned.  The counting  sequence is base
  8118. zero - the first element is the 0th element.
  8119.  
  8120. EXAMPLES
  8121.  
  8122.     (nthcdr 4 '(0 1 2 3 4 5 6))        ; returns (4 5 6)
  8123.     (nthcdr 3 '(a b))            ; returns NIL
  8124.  
  8125.     (nthcdr 4 'a)                ; error: bad argument type
  8126.  
  8127.  
  8128. null
  8129. ________________________________________________________________________
  8130.  
  8131. type: predicate function (subr)
  8132. location: built-in
  8133. source file: xlbfun.c
  8134. Common LISP compatible: yes
  8135. supported on: all machines
  8136.  
  8137. SYNTAX
  8138.  
  8139. (null <expr> )
  8140.     <expr>        -    the expression to check
  8141.  
  8142. DESCRIPTION
  8143.  
  8144. The NULL  predicate  checks  <expr> for an empty list.  T is returned if
  8145. the list is empty, NIL is returned  otherwise.  The <expr> does not have
  8146. to be a valid  list, but if it is not a list then NIL is returned as the
  8147. result.
  8148.  
  8149. EXAMPLES
  8150.  
  8151.     (null '())                ; returns T - empty list
  8152.     (null ())                ; returns T - still empty
  8153.     (setq a NIL)                ; set up a variable
  8154.     (null a)                ; returns T - value = empty list
  8155.  
  8156.     (null "a")                ; returns NIL - not a list
  8157.     (null 'a)                ; returns NIL - not a list
  8158.  
  8159. NOTE:
  8160. The NULL predicate is the same function as the NOT predicate.
  8161.  
  8162.  
  8163. numberp
  8164. ________________________________________________________________________
  8165.  
  8166. type: predicate function (subr)
  8167. location: built-in
  8168. source file: xlbfun.c
  8169. Common LISP compatible: yes
  8170. supported on: all machines
  8171.  
  8172. SYNTAX
  8173.  
  8174. (numberp <expr> )
  8175.     <expr>        -    the expression to check
  8176.  
  8177. DESCRIPTION
  8178.  
  8179. The NUMBERP predicate checks if an <expr> is a number.  T is returned if
  8180. <expr>  is  an  integer  or  floating  point  number,  NIL  is  returned
  8181. otherwise.
  8182.  
  8183. EXAMPLES
  8184.  
  8185.     (numberp 1)                ; returns T - integer
  8186.     (numberp 1.2)                ; returns T - float
  8187.     (numberp '1)                ; returns T - still an integer
  8188.     (numberp #x034)                ; returns T - readmacro produces
  8189.                         ;             an integer
  8190.  
  8191.     (numberp 'a)                ; returns NIL - symbol
  8192.     (numberp #\a)                ; returns NIL - character
  8193.     (numberp NIL)                ; returns NIL - NIL
  8194.     (numberp #(0 1 2))            ; returns NIL - array 
  8195.  
  8196.  
  8197. *obarray*
  8198. ________________________________________________________________________
  8199.  
  8200. type: system variable
  8201. location: built-in
  8202. source file: xlsym.c
  8203. Common LISP compatible: no
  8204. supported on: all machines
  8205.  
  8206. SYNTAX
  8207.  
  8208. *obarray*
  8209.  
  8210.  
  8211. DESCRIPTION
  8212.  
  8213. *OBARRAY* is the system  variable that contains the system symbol table.
  8214. This symbol table is an XLISP array that is constructed out of lists.
  8215.  
  8216. EXAMPLES
  8217.  
  8218.     (defun lookin (sym)             ; create a function to 
  8219.        (aref *obarray*             ;   look inside *OBARRAY*
  8220.              (hash sym (length *obarray*))));   and look for a specific
  8221.                            ;   symbol - returns a list
  8222.                         ;
  8223.     (lookin "CAR")                ; returns (TEST PEEK CAR)
  8224.     (lookin "car")                ; returns NIL
  8225.  
  8226. NOTE:
  8227. When looking into  *OBARRAY* or INTERNing  symbols,  remember that "car"
  8228. and "CAR" are two  different  symbols in *OBARRAY*.  Remember  also that
  8229. normal  symbols  created by XLISP are upper case names.  So, if you type
  8230. in "car" as a normal  symbol, it will be the  symbol  "CAR"  after  this
  8231. normal upper-casing operation.
  8232.  
  8233.  
  8234. object
  8235. ________________________________________________________________________
  8236.  
  8237. type: object 
  8238. location: built-in
  8239. source file: xlobj.c
  8240. Common LISP compatible: no
  8241. supported on: all machines
  8242.  
  8243. SYNTAX
  8244.  
  8245. object
  8246.  
  8247.  
  8248. DESCRIPTION
  8249.  
  8250. OBJECT is an object  class.  An object  is a  composite  structure  that
  8251. contains   internal  state   information,   methods  (which  respond  to
  8252. messages), a pointer to the object's class and a pointer to the object's
  8253. super-class.  XLISP  contains  two built in  objects:  OBJECT and CLASS.
  8254. OBJECT is the superclass for the CLASS object.
  8255.  
  8256. EXAMPLES
  8257.     (send object :show)            ; look at the object definition
  8258.  
  8259.                         ; example use of objects
  8260.     (setq my-class                 ; new class MY-CLASS with STATE
  8261.         (send class :new '(state)))    ;
  8262.     (send my-class :answer :isnew '()    ; set up initialization
  8263.         '((setq state nil) self))    ;
  8264.     (send my-class :answer :set-it '(value)    ; create :SET-IT message
  8265.         '((setq state value)))        ;
  8266.     (setq my-obj (send my-class :new))    ; create MY-OBJ out of MY-CLASS
  8267.     (send my-obj :set-it 5)            ; STATE is set to 5
  8268.  
  8269. OBJECT DEFINITION:
  8270. The internal definition of the OBJECT object instance is:
  8271.  
  8272.     Object is #<Object: #23fd8>, Class is #<Object: #23fe2>
  8273.       MESSAGES = ((:SHOW . #<Subr-: #23db2>) 
  8274.                 (:CLASS . #<Subr-: #23dee>) 
  8275.               (:ISNEW . #<Subr-: #23e2a>))
  8276.       IVARS = NIL
  8277.       CVARS = NIL
  8278.       CVALS = NIL
  8279.       SUPERCLASS = NIL
  8280.       IVARCNT = 0
  8281.       IVARTOTAL = 0
  8282.     #<Object: #23fd8>
  8283.  
  8284. The  class of  OBJECT  is  CLASS.  There  is no  superclass  of  OBJECT.
  8285. Remember that the location  information (like #23fd8) varies from system
  8286. to system, yours will probably look different.
  8287.  
  8288. BUILT-IN METHODS:
  8289. The built in methods in XLISP include:
  8290.  
  8291.         <message>    operation
  8292.         -------------------------------------------------------
  8293.         :ANSWER        Add a method to an object.
  8294.         :CLASS        Return the object's class.
  8295.         :ISNEW        Run initialization code on object.
  8296.         :NEW        Create a new object (instance or class).
  8297.         :SHOW        Show the internal state of the object.
  8298.  
  8299. MESSAGE STRUCTURE:
  8300. The normal XLISP  convention  for a <message> is to have a valid  symbol
  8301. preceeded  by a  colon  like  :ISNEW  or  :MY-MESSAGE.  However,  it  is
  8302. possible  to define a  <message>  that is a symbol  without a colon, but
  8303. this makes the code less readable.
  8304.  
  8305.  
  8306. objectp
  8307. ________________________________________________________________________
  8308.  
  8309. type: predicate function (subr)
  8310. location: built-in
  8311. source file: xlbfun.c
  8312. Common LISP compatible: no
  8313. supported on: all machines
  8314.  
  8315. SYNTAX
  8316.  
  8317. (objectp  <expr> )
  8318.     <expr>        -    the expression to check
  8319.  
  8320. DESCRIPTION
  8321.  
  8322. The OBJECTP  predicate checks if the <expr> is an object.  T is returned
  8323. if <expr> is an object, NIL is returned otherwise.
  8324.  
  8325. EXAMPLES
  8326.  
  8327.     (objectp object)            ; returns T
  8328.     (objectp class)                ; returns T
  8329.     (objectp NIL)                ; returns NIL
  8330.     (objectp '(a b))            ; returns NIL
  8331.  
  8332.  
  8333. oddp
  8334. ________________________________________________________________________
  8335.  
  8336. type: predicate function (subr)
  8337. location: built-in
  8338. source file: xlmath.c
  8339. Common LISP compatible: yes
  8340. supported on: all machines
  8341.  
  8342. SYNTAX
  8343.  
  8344. (oddp <expr> )
  8345.     <expr>        -    the integer numeric expression to check
  8346.  
  8347. DESCRIPTION
  8348.  
  8349. The ODDP  predicate  checks  to see if the  number  <expr> is odd.  T is
  8350. returned  if the  number  is  odd,  NIL  is  returned  otherwise.  A bad
  8351. argument  type  error  is  generated  if the  <expr>  is  not a  numeric
  8352. expression.  A bad floating  point  operation is generated if the <expr>
  8353. is a floating point number.  Zero is an even number.
  8354.  
  8355. EXAMPLES
  8356.  
  8357.     (oddp 0)                ; returns NIL
  8358.     (oddp 1)                ; returns T
  8359.     (oddp 2)                ; returns NIL
  8360.     (oddp -1)                ; returns T
  8361.     (oddp -2)                ; returns NIL
  8362.  
  8363.     (oddp 13.0)                ; error: bad flt. pt. op.
  8364.     (oddp 'a)                ; error: bad argument type
  8365.     (setq a 3)                ; set value of A to 3
  8366.     (oddp a)                ; returns T
  8367.  
  8368.  
  8369. open
  8370. ________________________________________________________________________
  8371.  
  8372. type: function (subr) 
  8373. location: built-in
  8374. source file: xlfio.c
  8375. Common LISP compatible: yes
  8376. supported on: all machines
  8377.  
  8378. SYNTAX
  8379.  
  8380. (open  <file> [ :direction <in-out> ]  )
  8381.     <file>        -    a string expression or symbol 
  8382.     <in-out>    -    an optional keyword symbol that must either
  8383.                 :INPUT or :OUTPUT.  The default is :INPUT.
  8384.  
  8385. DESCRIPTION
  8386.  
  8387. The OPEN function  opens the <file> for input or output.  The <file> may
  8388. be a string  expression  or a symbol.  Following the <file>, there is an
  8389. optional  keyword,  :DIRECTION.  The argument  following  this is either
  8390. :INPUT or :OUTPUT  which  specifies  the  direction  of the file.  If no
  8391. :DIRECTION  is  specified,  the  default  is  :INPUT.  When  <file> is a
  8392. string, you may specify a complete  file  location or  extensions  (like
  8393. "/usr/local/bin/myfile.lsp" or "A:\LISP\TIM.BAT").  If the file open was
  8394. successful, then a file pointer of the form #<File:  #99999> is returned
  8395. as the result.  If the file open was not  successful, a NIL is returned.
  8396. For an input file, the file has to exist, or an error will be  signaled.
  8397.  
  8398. EXAMPLES
  8399.  
  8400.     (setq f (open 'mine :direction :output)); create file MINE
  8401.     (print "hi" f)                ; returns "hi"
  8402.     (close f)                ; file contains <hi>   <NL>
  8403.     (setq f (open 'mine :direction :input))    ; open MYFILE for input
  8404.     (read f)                ; returns "hi"    
  8405.     (close f)                ; close it
  8406.  
  8407. FILE NAMES:
  8408. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  8409. automatically made uppercase.  In using XLISP, this means you don't have
  8410. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  8411. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  8412. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  8413. if you do a (open 'foo-file :direction :output), this will create a file
  8414. named  "FOO-FILE"  because  XLISP  uppercases  its symbols.  If you do a
  8415. (open  "foo-file"  :direction  :output),  this will  create a file named
  8416. "foo-file"  because UNIX doesn't uppercase its file names.  Another case
  8417. is if you do (savefun mydefun), this will create the file "MYDEFUN.lsp".
  8418. So, if you are having trouble with opening and accessing files, check to
  8419. make sure the file name is in the proper case.
  8420.  
  8421. COMMON LISP COMPATABILITY:
  8422. Common LISP supports  bidirectional files.  So, porting Common LISP code
  8423. may be difficult to port if it uses these other file types.
  8424.  
  8425.  
  8426. &optional
  8427. ________________________________________________________________________
  8428.  
  8429. type: keyword
  8430. location: built-in
  8431. source file: xleval.c
  8432. Common LISP compatible: similar
  8433. supported on: all machines
  8434.  
  8435. SYNTAX
  8436.  
  8437. &optional [ <opt-arg> | ( <opt-arg> [ <opt-value> [ <opt-symbol> ] ] ) ] ...
  8438.     <opt-arg>    -    optional argument
  8439.     <opt-value>    -    optional argument initialization
  8440.     <exist-symbol>    -    optional argument existence symbol
  8441.  
  8442. DESCRIPTION
  8443.  
  8444. In XLISP, there are several times that you define a formal argument list
  8445. for a body of code (like DEFUN,  DEFMACRO,  :ANSWER and LAMBDA).  All of
  8446. the formal  arguments  that are  defined are  required  to appear in the
  8447. invocation  of the  defined  function  or  operation.  If there  are any
  8448. &OPTIONAL arguments defined, they will be filled in order.  If there are
  8449. insufficient  parameters for the &OPTIONAL  arguments, they will contain
  8450. NIL, unless the arguments have an <opt-value>  initial value  specified.
  8451. The  <exist-symbol>,  if  it  is  specified,  will  contain  a T if  the
  8452. <opt-arg>  was  supplied  by the  function  call and a NIL if it was not
  8453. supplied  by  the  function   call.  This   <exist-symbol>   allows  the
  8454. programmer  to  test  for an  arguments  existence.  At  the  end of the
  8455. function or operation  execution,  these local  symbols and their values
  8456. are are removed.
  8457.  
  8458. EXAMPLES
  8459.  
  8460.     (defun foo                 ; define function FOO
  8461.       (a &optional b (c 1) )        ;   with some optional args
  8462.       (print a) (print b) (print c))    ;
  8463.     (foo)                    ; error: too few arguments 
  8464.     (foo 1)                    ; prints 1 NIL 1
  8465.     (foo 1 2)                ; prints 1 2 1
  8466.     (foo 1 2 3)                ; prints 1 2 3 
  8467.  
  8468.     (defun fee                ; define function FEE
  8469.       (a &optional (b 9 b-passed) )        ;   with some optional args
  8470.       (print a) (print b)            ;
  8471.       (if b-passed (print "b was passed")    ;
  8472.                    (print "b not passed")))    ;
  8473.     (fee 1)                    ; prints 1 9 "b not passed"
  8474.     (fee 1 2)                ; prints 1 2 "b was passed"
  8475.  
  8476.  
  8477. or
  8478. ________________________________________________________________________
  8479.  
  8480. type: special form (fsubr)
  8481. location: built-in
  8482. source file: xlcont.c
  8483. Common LISP compatible: yes
  8484. supported on: all machines
  8485.  
  8486. SYNTAX
  8487.  
  8488. (or  [ <expr1> ... ] )
  8489.     <exprN>        -    an expression
  8490.  
  8491. DESCRIPTION
  8492.  
  8493. The OR special form evaluates a sequence of expressions  and returns the
  8494. effect of a logical  INCLUSIVE-OR  operation on the expressions.  If all
  8495. of the expressions  are NIL, NIL is returned as OR's result.  Evaluation
  8496. of the expressions  will stop when an expression  evaluates to something
  8497. other than NIL, none of the  subsequent  expressions  will be evaluated.
  8498. If there are no expressions, OR returns NIL as its result.
  8499.  
  8500. EXAMPLES
  8501.  
  8502.     (or NIL NIL NIL)            ; returns NIL
  8503.     (or NIL T NIL)                ; returns T
  8504.     (or NIL (princ "hi") (princ "ho"))    ; prints  hi  and returns "hi"
  8505.     (or T T T)                ; returns T
  8506.     (or)                    ; returns NIL
  8507.  
  8508.     (setq a 5)  (setq b 6)            ; set up A and B
  8509.     (if (or (< a b) (< b a))        ; if 
  8510.        (print "not equal")            ;  then
  8511.        (print "equal"))            ;  else
  8512.                         ; prints  "not equal"
  8513.  
  8514.  
  8515. peek
  8516. ________________________________________________________________________
  8517.  
  8518. type: function (subr) 
  8519. location: built-in
  8520. source file: xlsys.c
  8521. Common LISP compatible: no
  8522. supported on: all machines
  8523.  
  8524. SYNTAX
  8525.  
  8526. (peek <address> )
  8527.     <address>    -    an integer expression
  8528.  
  8529. DESCRIPTION
  8530.  
  8531. The PEEK function  returns the internal  memory value at the  <address>.
  8532. The returned value is an integer.
  8533.  
  8534. EXAMPLES
  8535.  
  8536.     (setq var 0)                ; set up VAR with 0
  8537.     (address-of var)            ; returns 123224
  8538.     (address-of 'var)            ; returns 161922
  8539.     (peek (address-of var))            ; returns 83951616
  8540.     (peek (1+ (address-of var)))        ; returns 16777216
  8541.     (peek (+ 2 (address-of var)))        ; returns 0  <-- value of VAR
  8542.     (setq var 14)                ; change the value to 14
  8543.     (peek (+ 2 (address-of var)))        ; returns 14
  8544.     (setq var 99)                ; change the value to 99
  8545.     (peek (+ 2 (address-of var)))        ; returns 99
  8546.  
  8547. CAUTION:
  8548. Be careful  when  modifying  the  internal  state of XLISP.  If you have
  8549. modified it, it would be a good idea to exit XLISP and  re-enter  before
  8550. doing any work you really want to retain.
  8551.  
  8552. ADDITIONAL CAUTION:
  8553. It is possible to PEEK and POKE not just XLISP's  memory put other parts
  8554. of your  computer's  memory.  Be very careful when doing this.  Also, in
  8555. some  computers,  just looking at a memory  location can cause things to
  8556. happen - I/O locations fall in this category.
  8557.  
  8558.  
  8559. peek-char
  8560. ________________________________________________________________________
  8561.  
  8562. type: function (subr) 
  8563. location: built-in
  8564. source file: xlfio.c  
  8565. Common LISP compatible: similar
  8566. supported on: all machines
  8567.  
  8568. SYNTAX
  8569.  
  8570. (peek-char  [ <skip-flag>  [ <source> ] ]  )
  8571.     <skip-flag>    -    an optional expression - default is NIL
  8572.     <source>    -    an optional source - must be a file pointer
  8573.                 or stream, the default is *standard-input*
  8574.  
  8575. DESCRIPTION
  8576.  
  8577. The PEEK-CHAR  function looks at a single  character  from the specified
  8578. <source>.  The character  looked-at is returned as an integer  value for
  8579. the  result.  If the  <skip-flag>  expression  is  NIL,  then  the  next
  8580. character will be looked-at,  without  advancing the position within the
  8581. file.  If  the   <skip-flag>   expression  is  non-NIL,  then  the  next
  8582. non-white-space character will be looked-at.  This skipping does advance
  8583. the position within the file.  White-space characters include blank, tab
  8584. and new-line  characters.  If <skip-flag>  is not used, no skipping will
  8585. occur.  The <source>  may be a file pointer or a stream.  If there is no
  8586. <source>,   *STANDARD-INPUT*  is  the  default.  If  an  end-of-file  is
  8587. encountered in the <source>, then NIL will be returned as the result.
  8588.  
  8589. EXAMPLES
  8590.  
  8591.     (setq fp (open "f" :direction :output))    ; create file "f"
  8592.     (print 12 fp)                ;
  8593.     (princ "  34" fp)  (terpri fp)        ;
  8594.     (close fp)                ;
  8595.                         ;
  8596.     (setq fp (open "f" :direction :input))    ; open "f" for reading
  8597.     (peek-char NIL fp)            ; returns #\1
  8598.     (peek-char NIL fp)            ; returns #\1 - didn't advance
  8599.     (read-char fp)                ; returns #\1 - force advance
  8600.     (peek-char NIL fp)            ; returns #\2
  8601.     (read-char fp)                ; returns #\2 - force advance
  8602.     (peek-char NIL fp)            ; returns #\Newline
  8603.     (peek-char T fp)            ; returns #\3 - skipped blanks
  8604.     (read-line fp)                ; returns "34"
  8605.     (close fp)                ;
  8606.  
  8607. COMMON LISP COMPATABILITY:
  8608. The XLISP and Common LISP PEEK-CHAR  functions are compatable for simple
  8609. cases.  They both  allow  for the  optional  <skip-flag>  and  <source>.
  8610. However, in Common LISP, there are addition parameters which occur right
  8611. after <source> that support various end-of-file operations and recursive
  8612. calls.  So, when porting from Common LISP to XLISP,  remember  there are
  8613. additional  arguments in Common LISP's  PEEK-CHAR that are not supported
  8614. in XLISP.
  8615.  
  8616.  
  8617. plusp
  8618. ________________________________________________________________________
  8619.  
  8620. type: predicate function (subr)
  8621. location: built-in
  8622. source file: xlmath.c
  8623. Common LISP compatible: yes
  8624. supported on: all machines
  8625.  
  8626. SYNTAX
  8627.  
  8628. (plusp <expr> )
  8629.     <expr>        -    the numeric expression to check
  8630.  
  8631. DESCRIPTION
  8632.  
  8633. The PLUSP  predicate  checks to see if the number <expr> is positive.  T
  8634. is returned if the number is positive  (greater than 0), NIL is returned
  8635. otherwise.  A bad argument  type error is generated if the <expr> is not
  8636. a numeric expression.
  8637.  
  8638. EXAMPLES
  8639.  
  8640.     (plusp 0)                ; returns NIL
  8641.     (plusp 1)                ; returns T
  8642.     (plusp -1)                ; returns NIL
  8643.     (plusp #xFFFFFFFF)            ; returns NIL
  8644.     (plusp #x0FFFFFFF)            ; returns T
  8645.  
  8646.     (plusp 'a)                ; error: bad argument type
  8647.     (setq a 4)                ; set value of A to 4
  8648.     (plusp a)                ; returns T
  8649.  
  8650.  
  8651. poke
  8652. ________________________________________________________________________
  8653.  
  8654. type: function (subr) 
  8655. location: built-in
  8656. source file: xlsys.c
  8657. Common LISP compatible: no
  8658. supported on: all machines
  8659.  
  8660. SYNTAX
  8661.  
  8662. (poke  <address>  <expr> )
  8663.     <address>    -    an integer expression
  8664.     <expr>        -    an integer expression
  8665.  
  8666. DESCRIPTION
  8667.  
  8668. The POKE function  writes the <expr> at the internal memory value at the
  8669. specified  <address>.  The  returned  value is <expr>.  Be very  careful
  8670. with this function.
  8671.  
  8672. EXAMPLES
  8673.  
  8674.     (setq var 0)                ; set up VAR with 0
  8675.     (address-of var)            ; returns 123224
  8676.     (address-of 'var)            ; returns 161922
  8677.     (peek (address-of var))            ; returns 83951616
  8678.     (peek (1+ (address-of var)))        ; returns 16777216
  8679.     (peek (+ 2 (address-of var)))        ; returns 0  <-- value of VAR
  8680.     (setq var 14)                ; change the value to 14
  8681.     (peek (+ 2 (address-of var)))        ; returns 14
  8682.     (poke (+ 2 (address-of var)) 1023)    ; POKE the value to 1023
  8683.     (print var)                ; prints  1023
  8684.  
  8685. CAUTION:
  8686. Be careful  when  modifying  the  internal  state of XLISP.  If you have
  8687. modified it, it would be a good idea to exit XLISP and  re-enter  before
  8688. doing any work you really want to retain.
  8689.  
  8690. ADDITIONAL CAUTION:
  8691. It is possible to PEEK and POKE not just XLISP's  memory but other parts
  8692. of your  computer's  memory.  Be very careful when doing this.  Also, in
  8693. some  computers,  just looking at a memory  location can cause things to
  8694. happen - I/O locations fall in this category.
  8695.  
  8696.  
  8697. pp
  8698. ________________________________________________________________________
  8699.  
  8700. type: function (subr)
  8701. location: extension 
  8702. source file: pp.lsp
  8703. Common LISP compatible: no
  8704. supported on: all machines
  8705.  
  8706. SYNTAX
  8707.  
  8708. (pp  <expr> [ <destination>  [ <break-size> ] ] )
  8709.     <expr>        -    an expression to be pretty printed
  8710.     <destination>    -    an optional destination - must be a file pointer
  8711.                 or stream, the default is *standard-output*
  8712.     <break-size>    -    an integer expression - default is 45
  8713.  
  8714. DESCRIPTION
  8715.  
  8716. The PP  function  produces a pretty  looking  version of the  <expr> and
  8717. prints it to the specified  <destination>.  If <expr> is an atom (like a
  8718. string, a  symbol,  a number,  etc.)  PP will  print it like  PRINT.  If
  8719. <expr> is a list, it will  perform  indenting.  T is always  returned as
  8720. the result of PP.  The  <destination> may be a file pointer or a stream.
  8721. If there is no <destination>  (or it is NIL),  *STANDARD-OUTPUT*  is the
  8722. default.  The  <break-size>  paramter  is  used  to  determine  when  an
  8723. expression   should  be  broken  into   multiple   lines.  The   default
  8724. <break-size> is 45.
  8725.  
  8726. EXAMPLES
  8727.  
  8728.     (pp 'a)                    ; prints  A        returns T
  8729.     (pp "abcd")                ; prints  "abcd"    returns T
  8730.     (pp '(a (b c)))                ; prints  (A (B C)) returns T
  8731.  
  8732. COMMON LISP COMPATABILITY:
  8733. In  Common  LISP,  the PP  functionality  is  provided  with the  PPRINT
  8734. function.  The PP function was available in previous  XLISP releases and
  8735. is still  accessible.  It does allow you to specify  the length  through
  8736. <break-size>, which is not available in PPRINT.
  8737.  
  8738. NOTE:
  8739. PP is an extension to the XLISP system provided in the PP.LSP file.  The
  8740. default  system and INIT.LSP  start-up  code do not  automatically  load
  8741. PP.LSP.  You need to  specifically  LOAD it  yourself  during your XLISP
  8742. session.  Another alternative is to put the code or a (LOAD "pp") in the
  8743. INIT.LSP  file.  The PP.LSP should have come with your XLISP system.  If
  8744. it doesn't, refer to the EXAMPLE PROGRAMS chapter.
  8745.  
  8746.  
  8747. pprint
  8748. ________________________________________________________________________
  8749.  
  8750. type: function (subr)
  8751. location: built-in
  8752. source file: xlpp.c
  8753. Common LISP compatible: yes
  8754. supported on: all machines
  8755.  
  8756. SYNTAX
  8757.  
  8758. (pp  <expr> [ <destination> ] )
  8759.     <expr>        -    an expression to be pretty printed
  8760.     <destination>    -    an optional destination - must be a file pointer
  8761.                 or stream, the default is *standard-output*
  8762.  
  8763. DESCRIPTION
  8764.  
  8765. The PPRINT function  produces a pretty looking version of the <expr> and
  8766. prints it to the specified  <destination>.  If <expr> is an atom (like a
  8767. string, a symbol, a number,  etc.)  PPRINT will print it like PRINT.  If
  8768. <expr>  is a list,  it will  perform  indenting,  as  necessary.  NIL is
  8769. always  returned  as the result of PPRINT.  The  <destination>  may be a
  8770. file pointer or a stream.  If there is no <destination>  (or it is NIL),
  8771. *STANDARD-OUTPUT* is the default.
  8772.  
  8773. EXAMPLES
  8774.  
  8775.     (pprint 'a)        ; prints  A        returns T
  8776.     (pprint "abcd")        ; prints  "abcd"    returns T
  8777.  
  8778.     (pprint '(a-very-long-name (first list) (second list)))
  8779.                 ;
  8780.                 ; prints (A-VERY-LONG-NAME (FIRST LIST)
  8781.                 ;                (SECOND LIST))
  8782.  
  8783. COMMON LISP COMPATABILITY:
  8784. Common LISP specifies that PPRINT with a  <destination>  of NIL, will go
  8785. to    *STANDARD-OUTPUT*.   XLISP   does   not   send   the   output   to
  8786. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8787. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8788. XLISP does not allow T as a valid argument for <destination>.
  8789.  
  8790.  
  8791. prin1
  8792. ________________________________________________________________________
  8793.  
  8794. type: function (subr) 
  8795. location: built-in
  8796. source file: xlfio.c  and  xlprin.c
  8797. Common LISP compatible: yes
  8798. supported on: all machines
  8799.  
  8800. SYNTAX
  8801.  
  8802. (prin1  <expr>  [ <destination> ] )
  8803.     <expr>        -    an expression
  8804.     <destination>    -    an optional destination - must be a file pointer
  8805.                 or stream, the default is *standard-output*
  8806.  
  8807. DESCRIPTION
  8808.  
  8809. The PRIN1  function  prints the <expr> to the  specified  <destination>.
  8810. The  <expr> is printed  without a  new-line.  If <expr> is a string,  it
  8811. will be printed  with quotes  around the string.  The <expr> is returned
  8812. as the result.  The <destination> may be a file pointer or a stream.  If
  8813. there is no <destination>, *STANDARD-OUTPUT* is the default.  The TERPRI
  8814. function is used to terminate the print lines produced.
  8815.  
  8816. EXAMPLES
  8817.  
  8818.     (prin1 'a)                ; prints  A    without <NL>
  8819.     (prin1 '(a b))                ; prints  (A B)    without <NL>
  8820.     (prin1 2.5)                ; prints  2.5    without <NL>
  8821.     (prin1 "hi")                ; prints  "hi"     without <NL>
  8822.  
  8823.     (setq f (open "f" :direction :output))    ; create file 
  8824.     (prin1 "hi" f)                ; returns "hi"
  8825.     (prin1 1234 f)                ; returns 1234
  8826.     (prin1 "he" f)                ; returns "he"
  8827.     (close f)                 ; file contains <"hi"1234"he"> 
  8828.  
  8829. COMMON LISP COMPATABILITY:
  8830. Common LISP specifies that print operations with a <destination> of NIL,
  8831. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  8832. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8833. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8834. XLISP does not allow T as a valid argument for <destination>.
  8835.  
  8836.  
  8837. princ
  8838. ________________________________________________________________________
  8839.  
  8840. type: function (subr) 
  8841. location: built-in
  8842. source file: xlfio.c  and  xlprin.c
  8843. Common LISP compatible: yes
  8844. supported on: all machines
  8845.  
  8846. SYNTAX
  8847.  
  8848. (princ  <expr>  [ <destination> ] )
  8849.     <expr>        -    an expression
  8850.     <destination>    -    an optional destination - must be a file pointer
  8851.                 or stream, the default is *standard-output*
  8852.  
  8853. DESCRIPTION
  8854.  
  8855. The PRINC  function  prints the <expr> to the  specified  <destination>.
  8856. The  <expr> is printed  without a  new-line.  If <expr> is a string,  it
  8857. will not be  printed  with  quotes  around  the  string.  The  <expr> is
  8858. returned as the result.  The  <destination>  may be a file  pointer or a
  8859. stream.  If there is no <destination>, *STANDARD-OUTPUT* is the default.
  8860. The TERPRI function is used to terminate the print lines produced.
  8861.  
  8862. EXAMPLES
  8863.  
  8864.     (princ 'a)                ; prints  A    without <NL>
  8865.     (princ '(a b))                ; prints  (A B)    without <NL>
  8866.     (princ 99)                ; prints  99    without <NL>
  8867.     (princ "hi")                ; prints  hi    without <NL>
  8868.  
  8869.     (setq f (open "f" :direction :output))    ; create file
  8870.     (princ "hi" f)                ; returns "hi"
  8871.     (princ 727 f)                ; returns 727
  8872.     (princ "ho" f)                ; returns "ho"
  8873.     (close f)                ; file contains <hi727ho>
  8874.  
  8875. COMMON LISP COMPATABILITY:
  8876. Common LISP specifies that print operations with a <destination> of NIL,
  8877. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  8878. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8879. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8880. XLISP does not allow T as a valid argument for <destination>.
  8881.  
  8882.  
  8883. print
  8884. ________________________________________________________________________
  8885.  
  8886. type: function (subr) 
  8887. location: built-in
  8888. source file: xlfio.c  and  xlprin.c
  8889. Common LISP compatible: yes
  8890. supported on: all machines
  8891.  
  8892. SYNTAX
  8893.  
  8894. (print  <expr>  [ <destination> ] )
  8895.     <expr>        -    an expression
  8896.     <destination>    -    an optional destination - must be a file pointer
  8897.                 or stream, the default is *standard-output*
  8898.  
  8899. DESCRIPTION
  8900.  
  8901. The PRINT  function  prints the <expr> to the  specified  <destination>.
  8902. The <expr> is printed followed by a new-line.  If <expr> is a string, it
  8903. will be printed  with quotes  around the string.  The <expr> is returned
  8904. as the result.  The <destination> may be a file pointer or a stream.  If
  8905. there is no <destination>, *STANDARD-OUTPUT* is the default.
  8906.  
  8907. EXAMPLES
  8908.  
  8909.     (print 'a)                ; prints  A    with <NL>
  8910.     (print '(a b))                ; prints  (A B)    with <NL>
  8911.     (print 99)                ; prints  99    with <NL>
  8912.     (print "hi")                ; prints  "hi"    with <NL>
  8913.  
  8914.     (setq f (open "f" :direction :output))    ; create file
  8915.     (print "hi" f)                ; returns "hi"
  8916.     (print 727 f)                ; returns 727
  8917.     (print "ho" f)                ; returns "ho"
  8918.     (close f)                ; file contains "hi"<NL>
  8919.                         ;               727<NL>
  8920.                         ;        "ho"<NL>
  8921.  
  8922. COMMON LISP COMPATABILITY:
  8923. Common LISP specifies that print operations with a <destination> of NIL,
  8924. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  8925. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8926. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8927. XLISP does not allow T as a valid argument for <destination>.
  8928.  
  8929.  
  8930. *print-case*
  8931. ________________________________________________________________________
  8932.  
  8933. type: system variable 
  8934. location: built-in
  8935. source file: xlprin.c
  8936. Common LISP compatible: similar
  8937. supported on: all machines
  8938.  
  8939. SYNTAX
  8940.  
  8941. *print-case*
  8942.  
  8943.  
  8944. DESCRIPTION
  8945.  
  8946. *PRINT-CASE*  is a system  variable  that  allows a user to specify  how
  8947. symbols  are  to  be  printed  by  XLISP.  If  *PRINT-CASE*  is  set  to
  8948. :DOWNCASE,  all  symbols  will be printed in lower case  characters.  If
  8949. *PRINT-CASE*  is set to :UPCASE,  all  symbols  will be printed in upper
  8950. case  characters.  If *PRINT-CASE* is set to anything other than :UPCASE
  8951. or :DOWNCASE, all symbols will be printed in upper case characters.  The
  8952. default value for *PRINT-CASE* is the keyword :UPCASE.
  8953.  
  8954. EXAMPLES
  8955.     (setq *print-case* :downcase)        ; returns :downcase
  8956.     (setq a 'b)                ; returns b
  8957.  
  8958.     (setq *print-case* 'foo)        ; returns FOO
  8959.     (setq a 'b)                ; returns B
  8960.  
  8961.     (setq *print-case* :upcase)        ; returns :UPCASE
  8962.     (setq a 'b)                ; returns B
  8963.  
  8964. COMMON LISP COMPATABILITY:
  8965. Common  LISP  supports  a third  keyword  :CAPITALIZE.  XLISP  does  not
  8966. support  this,  but  this  should  not be a  major  problem.  If  set to
  8967. :CAPITALIZE, XLISP will print all symbols in upper-case characters.
  8968.  
  8969.  
  8970. prog
  8971. ________________________________________________________________________
  8972.  
  8973. type: special form (fsubr)
  8974. location: built-in
  8975. source file: xlcont.c
  8976. Common LISP compatible: yes
  8977. supported on: all machines
  8978.  
  8979. SYNTAX
  8980.  
  8981. (prog  ( [ <binding> ... ]  )  [ <expr> ... ]  )
  8982.     <binding>    -    a variable binding which is can take one of 
  8983.                 <symbol>    or     ( <symbol> <init-expr> )
  8984.     <symbol>    -    a symbol
  8985.     <init-expr>    -    an initialization expression for <symbol>
  8986.     <expr>        -    expressions comprising the body of the loop
  8987.                 which may contain RETURNs, GOs or tags for GO  
  8988.  
  8989. DESCRIPTION
  8990.  
  8991. The PROG special  form is basically a 'block'  construct  (like a PASCAL
  8992. BEGIN / END) that contains symbols (with optional initializations) and a
  8993. block of code  (expressions)  to evaluate.  The PROG form  evaluates its
  8994. initializations in no specified order (as opposed to PROG* which does it
  8995. sequential order).  The first form after the PROG is the <binding> form.
  8996. It contains a series of <symbol>'s or  <binding>'s.  The  <binding> is a
  8997. <symbol> followed by an initialization expression <init-expr>.  If there
  8998. is no <init-expr>, the <symbol> will be initialized to NIL.  There is no
  8999. specification  as to the order of execution  of the bindings or the step
  9000. expressions - except that they happen all together.  If a RETURN form is
  9001. evaluated,  its value  will be  returned.  Otherwise,  NIL is  returned.
  9002. When the PROG is finished  execution,  the <symbol>'s  that were defined
  9003. will no longer exist or retain their values.
  9004.  
  9005. EXAMPLES
  9006.  
  9007.     (prog () (print "hello"))        ; prints  "hello"  returns NIL
  9008.     (prog (i j)                ; PROG with vars I and J
  9009.           (print i) (print j))        ; prints  NIL NIL  returns NIL
  9010.     (prog ((i 1) (j 2))             ; PROG with vars I and J
  9011.           (print i) (print j)         ;
  9012.           (return (+ i j)))            ; prints  1 2      returns 3
  9013.  
  9014.  
  9015. prog*
  9016. ________________________________________________________________________
  9017.  
  9018. type: special form (fsubr)
  9019. location: built-in
  9020. source file: xlcont.c
  9021. Common LISP compatible: yes
  9022. supported on: all machines
  9023.  
  9024. SYNTAX
  9025.  
  9026. (prog*  ( [ <binding> ... ]  )  [ <expr> ... ]  )
  9027.     <binding>    -    a variable binding which is can take one of 
  9028.                 <symbol>     or    ( <symbol> <init-expr> )
  9029.     <symbol>    -    a symbol
  9030.     <init-expr>    -    an initialization expression for <symbol>
  9031.     <expr>        -    expressions comprising the body of the loop
  9032.                 which may contain RETURNs, GOs or tags for GO  
  9033.  
  9034. DESCRIPTION
  9035.  
  9036. The PROG* special form is basically a 'block'  construct  (like a PASCAL
  9037. BEGIN / END) that contains symbols (with optional initializations) and a
  9038. block of code  (expressions)  to evaluate.  The PROG* form evaluates its
  9039. initializations in sequential order (as opposed to PROG which does it in
  9040. no  specified  order).  The first form after the PROG* is the  'binding'
  9041. form.  It contains a series of <symbol>'s or <binding>'s.  The <binding>
  9042. is a <symbol> followed by an initialization  expression <init-expr>.  If
  9043. there is no  <init-expr>,  the <symbol> will be initialized to NIL.  The
  9044. order of  execution of the bindings is  sequential.  If a RETURN form is
  9045. evaluated,  its value  will be  returned.  Otherwise,  NIL is  returned.
  9046. When the PROG* is finished  execution, the <symbol>'s  that were defined
  9047. will no longer exist or retain their values.
  9048.  
  9049. EXAMPLES
  9050.  
  9051.     (prog* (i j)                ; PROG* with vars I and J
  9052.           (print i) (print j))        ; prints  NIL NIL  returns NIL
  9053.     (prog* ((i 1) (j 2))             ; PROG* with vars I and J
  9054.           (print i) (print j)         ;
  9055.           (return (+ i j)))            ; prints  1 2      returns 3
  9056.     (prog* () (print "hello"))        ; prints  "hello"  returns NIL
  9057.  
  9058.     (prog ((i 1) (j (+ i 1)))        ; PROG won't work due to order
  9059.           (print (+ i j)) )            ; error: unbound variable - I
  9060.     (prog* ((i 1) (j (+ i 1)))        ; PROG* will work due to order
  9061.            (print (+ i j)) )        ; prints  3        returns NIL
  9062.  
  9063.  
  9064. prog1
  9065. ________________________________________________________________________
  9066.  
  9067. type: special form (fsubr)
  9068. location: built-in
  9069. source file: xlcont.c
  9070. Common LISP compatible: yes
  9071. supported on: all machines
  9072.  
  9073. SYNTAX
  9074.  
  9075. (prog1  [ <expr1>  <expr2> ... ]  )
  9076.     <exprN>        -    expressions comprising the body of the loop
  9077.  
  9078. DESCRIPTION
  9079.  
  9080. The PROG1 special form is basically a 'block'  construct  (like a PASCAL
  9081. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9082. <expr1>'s value will be returned as the result of PROG1.  If there is no
  9083. <expr1>, NIL is returned.
  9084.  
  9085. EXAMPLES
  9086.  
  9087.     (prog1 (print "hi") (print "ho"))    ; prints "hi" "ho" returns "hi"
  9088.     (prog1)                    ; returns NIL
  9089.     (prog1 'a)                ; returns A
  9090.     (prog1 "hey" (print "ho"))        ; prints "ho"      returns "hey"
  9091.  
  9092. NOTE:
  9093. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9094. tags for GO.
  9095.  
  9096.  
  9097. prog2
  9098. ________________________________________________________________________
  9099.  
  9100. type: special form (fsubr)
  9101. location: built-in
  9102. source file: xlcont.c
  9103. Common LISP compatible: yes
  9104. supported on: all machines
  9105.  
  9106. SYNTAX
  9107.  
  9108. (prog2  [ <expr1>  <expr2> ... ]  )
  9109.     <exprN>        -    expressions comprising the body of the loop
  9110.  
  9111. DESCRIPTION
  9112.  
  9113. The PROG2 special form is basically a 'block'  construct  (like a PASCAL
  9114. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9115. <expr2>'s value will be returned as the result of PROG2.  If there is no
  9116. <expr2>,  <expr1> is returned.  If there is no <expr1>, NIL is returned.
  9117.  
  9118. EXAMPLES
  9119.  
  9120.     (prog2 (print "hi") (print "ho"))    ; prints "hi" "ho" returns "ho"
  9121.     (prog2)                    ; returns NIL
  9122.     (prog2 (print "hi"))            ; prints "hi"      returns "hi"
  9123.     (prog2 (print "ho") "hey")        ; prints "ho"      returns "hey"
  9124.     (prog2 'a 'b 'c)            ; returns B
  9125.  
  9126. NOTE:
  9127. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9128. tags for GO.
  9129.  
  9130.  
  9131. progn
  9132. ________________________________________________________________________
  9133.  
  9134. type: special form (fsubr)
  9135. location: built-in
  9136. source file: xlcont.c
  9137. Common LISP compatible: yes
  9138. supported on: all machines
  9139.  
  9140. SYNTAX
  9141.  
  9142. (progn  [ <expr1>  <expr2> ... ]  )
  9143.     <exprN>        -    expressions comprising the body of the loop
  9144.  
  9145. DESCRIPTION
  9146.  
  9147. The PROGN special form is basically a 'block'  construct  (like a PASCAL
  9148. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9149. The last  <expr>'s  value will be  returned  as the result of PROGN.  If
  9150. there are no <expr>s, NIL is returned.
  9151.  
  9152. EXAMPLES
  9153.  
  9154.     (progn (print "hi") (print "ho"))    ; prints "hi" "ho" returns "ho"
  9155.     (progn)                    ; returns NIL
  9156.     (progn "hey" (print "ho"))        ; prints "ho"      returns "ho"
  9157.     (progn 'a)                ; returns A
  9158.     (progn 'a 'b 'c)            ; returns C
  9159.  
  9160. NOTE:
  9161. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9162. tags for GO.
  9163.  
  9164.  
  9165. progv
  9166. ________________________________________________________________________
  9167.  
  9168. type: special form (fsubr)
  9169. location: built-in
  9170. source file: xlcont.c
  9171. Common LISP compatible: yes
  9172. supported on: all machines
  9173.  
  9174. SYNTAX
  9175.  
  9176. (progv  <symbols> <values> [ <expr1>  <expr2> ... ]  )
  9177.     <symbols>    -    a list comprising symbols to be bound
  9178.     <values>    -    a list comprising values to be bound to symbols
  9179.     <exprN>        -    expressions comprising the body of the loop
  9180.  
  9181. DESCRIPTION
  9182.  
  9183. The PROGV special form is basically a 'block'  construct  (like a PASCAL
  9184. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9185. PROGV is  different  from PROG1,  PROG2 and PROGN in that it  contains a
  9186. pair of lists - <symbols> and <values>.  Before  evaluating  the <exprN>
  9187. expressions,   PROGV  will   dynamically   bind  the   <values>  to  the
  9188. corresponding  <symbols>.  If  there  are  too  many  <symbols>  for the
  9189. <values>, the <symbols> with no corresponding  <values> will be bound to
  9190. NIL.  The  variables  will be unbound after the execution of PROGV.  The
  9191. last  <expr>'s  value will be returned as the result of PROGV.  If there
  9192. are no <expr>s, NIL is returned.
  9193.  
  9194. EXAMPLES
  9195.  
  9196.     (progv '(var) '(2)             ; 
  9197.         (print var) (print "two"))    ; prints 2 "two" returns "two"
  9198.  
  9199.     (setq a "beginning")            ; initialize A
  9200.     (progv '(a) '(during) (print a))    ; prints DURING
  9201.     (print a)                ; prints "beginning"
  9202.  
  9203.     (progv '(no-way) '(no-how) )        ; returns NIL
  9204.     (progv)                    ; error: too few arguments
  9205.  
  9206. NOTE:
  9207. PROGV is different  from PROG (which allows  symbols and  initialization
  9208. forms) in that PROGV allows its <symbols>  and <values> to be evaluated.
  9209. This allows you to pass in forms that generate the  <symbols>  and their
  9210. <values>.
  9211.  
  9212. NOTE:
  9213. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9214. tags for GO.
  9215.  
  9216.  
  9217. psetq
  9218. ________________________________________________________________________
  9219.  
  9220. type: special form (fsubr)
  9221. location: built-in
  9222. source file: xlcont.c
  9223. Common LISP compatible: yes
  9224. supported on: all machines
  9225.  
  9226. SYNTAX
  9227.  
  9228. (psetq [ <symbol> <expr> ] ... )
  9229.     <symbol>    -    un-evaluated symbol
  9230.     <expr>        -    value for <symbol>
  9231.  
  9232. DESCRIPTION
  9233.  
  9234. PSETQ sets <expr> as the value of <symbol>.  There can be several  pairs
  9235. of  assignment.  PSETQ  performs  these  assignments  in  parallel - the
  9236. <symbol>'s  are not assigned new values until all the <expr>'s have been
  9237. evaluated.  PSETQ returns the value from the last <expr> as it's result.
  9238.  
  9239. EXAMPLES
  9240.  
  9241.     (psetq a 1)                ; symbol A gets value 1
  9242.     (psetq b '(a b c))            ; symbol B gets value (A B C)
  9243.     (psetq mynum (+ 3 4))            ; symbol MYNUM gets value 7
  9244.  
  9245.     (setq goo 'ber)                ; returns BER
  9246.     (setq num 1)                ; returns 1
  9247.     (psetq goo num num goo)            ; returns BER
  9248.     (print goo)                ; returns 1
  9249.     (print num)                ; returns BER
  9250.  
  9251.  
  9252. putprop
  9253. ________________________________________________________________________
  9254.  
  9255. type: function (subr) 
  9256. location: built-in
  9257. source file: xlbfun.c
  9258. Common LISP compatible: no
  9259. supported on: all machines
  9260.  
  9261. SYNTAX
  9262.  
  9263. (putprop <symbol> <value> <property> )
  9264.     <symbol>    -    the symbol with a property list
  9265.     <value>        -     the value to be assigned to the property
  9266.     <property>    -    the property name being changed/added
  9267.  
  9268. DESCRIPTION
  9269.  
  9270. PUTPROP  sets  the  value  of the  <property>  in the  <symbol>.  If the
  9271. <property> does not exist, the <property> is added to the property list.
  9272. The  <symbol>  must be an existing  symbol.  The <value> may be a single
  9273. value or a list.
  9274.  
  9275. Property  lists are lists  attached to any user defined  variables.  The
  9276. lists are in the form of (name1  val1 name2 val2  ....).  Any  number of
  9277. properties may be attached to a single variable.
  9278.  
  9279. EXAMPLES
  9280.  
  9281.     (setq person 'bobby)            ; create a var with a value
  9282.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  9283.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  9284.     (get person 'last-name)            ; retrieve LAST-NAME - boogie
  9285.     (get person 'job)            ; retrieve JOB - disc-jockey
  9286.     (get person 'height)            ; non-existant - returns NIL
  9287.     (putprop person '(10 20 30) 'stats)    ; add STATS - a list 
  9288.     (get person 'stats)            ;
  9289.  
  9290. NOTE:
  9291. You can set a  property  to the value  NIL.  However,  this NIL value is
  9292. indistinguishable  from the NIL returned when a property does not exist.
  9293.  
  9294. COMMON LISP COMPATIBILITY:
  9295. Common LISP does not have a PUTPROP function.  It uses a SETF to achieve
  9296. this  functionality.  Porting  from  Common LISP to XLISP will work fine
  9297. since XLISP supports the SETF  modifications  of property lists and GET.
  9298. Porting from XLISP to Common LISP will require translating  PUTPROP into
  9299. SETF forms.
  9300.  
  9301. LISP DIALECTS:
  9302. The order of PUTPROP arguments is <symbol>,  <value>,  <property>.  This
  9303. is  different  from  many  other  LISPs  which  normally  use  <symbol>,
  9304. <property>, <value>.  Be careful when porting existing LISP code.
  9305.  
  9306.  
  9307. quote
  9308. ________________________________________________________________________
  9309.  
  9310. type: special form (fsubr)
  9311. location: built-in
  9312. source file: xlcont.c
  9313. Common LISP compatible: yes
  9314. supported on: all machines
  9315.  
  9316. SYNTAX
  9317.  
  9318. (quote <expr> )
  9319.     <expr>        -    an expression
  9320.  
  9321. DESCRIPTION
  9322.  
  9323. QUOTE returns the the <expr> un-evaluated.  
  9324.  
  9325. EXAMPLES
  9326.  
  9327.     my-var                    ; error: unbound variable 
  9328.     (quote my-var)                ; returns MY-VAR
  9329.     my-var                    ; still error: unbound variable
  9330.     (set (quote my-var) 111)        ; give MY-VAR a value - 
  9331.                         ;   make it exist
  9332.     my-var                    ; returns 111
  9333.     (quote my-var)                ; returns MY-VAR
  9334.  
  9335.                         ; SAME AS ABOVE BUT USING THE 
  9336.                         ; READ MACRO FOR QUOTE - '
  9337.     new-var                    ; error: unbound variable
  9338.     'new-var                ; returns NEW-VAR
  9339.     new-var                    ; still error: unbound variable
  9340.     (setq new-var 222)            ; give NEW-VAR a value -
  9341.                         ;   make it exist
  9342.     new-var                    ; returns 222
  9343.     'new-var                ; returns NEW-VAR
  9344.  
  9345. READ MACRO:  
  9346. XLISP  supports  the normal read macro of a single quote as a short-hand
  9347. method of writing the QUOTE function.
  9348.  
  9349.  
  9350. random
  9351. ________________________________________________________________________
  9352.  
  9353. type: function (subr) 
  9354. location: built-in
  9355. source file: xlmath.c
  9356. Common LISP compatible: similar
  9357. supported on: all machines
  9358.  
  9359. SYNTAX
  9360.  
  9361. (random <expr> )
  9362.     <expr>        -    integer number/expression
  9363.  
  9364. DESCRIPTION
  9365.  
  9366. The RANDOM function  generates and returns a random number between 0 and
  9367. <expr> - 1.  If <expr> is  negative,  the  number  range is forced to be
  9368. positive.
  9369.  
  9370. EXAMPLES
  9371.  
  9372.     (random 100)                ; returns 7
  9373.     (random 100)                ; returns 49
  9374.     (random 100)                ; returns 73
  9375.     (random -100)                ; returns 58
  9376.     (random 100.01)                ; error: bad flt.pt. operation 
  9377.  
  9378. COMMON LISP COMPATABILITY:
  9379. Common LISP allows an optional state  parameter,  which is not supported
  9380. in XLISP.  Also, Common LISP allows  floating point numbers, which XLISP
  9381. does not support.
  9382.  
  9383. NOTE:
  9384. This  function is an  extension of the XLISP  system.  It is provided in
  9385. the  MSSTUFF.C  source code file.  If your XLISP  system is built for an
  9386. IBM PC and  compatibles,  this  function  will work.  If your  system is
  9387. built on UNIX or some other  operating  system, it will need the code in
  9388. the corresponding STUFF.C file.
  9389.  
  9390.  
  9391. read
  9392. ________________________________________________________________________
  9393.  
  9394. type: function (subr) 
  9395. location: built-in
  9396. source file: xlfio.c  and  xlread.c
  9397. Common LISP compatible: similar
  9398. supported on: all machines
  9399.  
  9400. SYNTAX
  9401.  
  9402. (read   [ <source>  [ <eof-result> [ <recursive-flag> ] ] ]  )
  9403.     <source>    -    an optional source - must be a file pointer
  9404.                 or stream, the default is *standard-input*
  9405.     <eof-result>    -    an optional expression (default is NIL)
  9406.     <recursive-flag>-    an optional expression ( NIL or non-NIL )
  9407.  
  9408. DESCRIPTION
  9409.  
  9410. The READ function reads an expression from the specified  <source>.  The
  9411. expression read is a 'normal' XLISP expression - not a line.  This means
  9412. that white space is removed - blanks,  empty  lines and  comment  lines.
  9413. Read-macro  expansions  will  occur  (like  QUOTE  instead  of  ').  The
  9414. expression  needs to be an atom  (numeric,  string or symbol) or a valid
  9415. list.  It can span several  lines.  The  expression  read is returned as
  9416. the result.  The  <source>  may be a file pointer or a stream.  If there
  9417. is no <source>,  *STANDARD-INPUT*  is the default.  If an end-of-file is
  9418. encountered  in the  <source>,  then  the  <eof-result>  value  will  be
  9419. returned as the result.
  9420.  
  9421. If you wish to read just  lines or  characters,  refer to  READ-LINE  or
  9422. READ-CHAR.
  9423.  
  9424. The  <recursive-flag>  is intended for use with embedded  calls to READ.
  9425. This is useful in read-macro and read-table  uses.  If  <recursive-flag>
  9426. is non-NIL, the READ does not expect itself to be at a 'top-level',  but
  9427. recursively executing within another READ that is in progress.
  9428.  
  9429. EXAMPLES
  9430.  
  9431.     (setq fp (open "f" :direction :output))    ; set up file
  9432.     (print "hello" fp)            ;
  9433.     (print 12.34 fp)            ;
  9434.     (princ "'(a b" fp)     (terpri fp)    ;    fill with stuff
  9435.     (princ "; comment" fp) (terpri fp)    ;
  9436.     (princ " c d)" fp )            ;
  9437.     (close fp)                ;
  9438.                         ;
  9439.     (setq fp (open "f" :direction :input))    ; now read the file
  9440.     (read fp "done")            ; returns "hello"
  9441.     (read fp "done")            ; returns 12.34
  9442.     (read fp "done")            ; returns (QUOTE (A B C D))
  9443.                         ; note macro expansion of QUOTE
  9444.                         ; note that comment is gone
  9445.     (read fp "done")            ; returns "done"
  9446.     (close fp)
  9447.  
  9448. COMMON LISP COMPATABILITY:
  9449. The XLISP and Common LISP READ  functions  are similar.  They both allow
  9450. for  <source>,  <eof-result>  and  <recursive-flag>.  However, in Common
  9451. LISP, there is an addition  end-of-file error parameter.  This parameter
  9452. occurs  right after  <source>  and  specifies  whether or not to flag an
  9453. error  on   end-of-file.  So,  when  porting,   remember  there  is  one
  9454. additional  argument in Common  LISP's  READ.  You need to be  concerned
  9455. about this if you use more than just a <source>  argument - going either
  9456. from XLISP to Common LISP or vice versa.
  9457.  
  9458. COMMON LISP COMPATABILITY:
  9459. Common LISP specifies that read  operations with a <source> of NIL, will
  9460. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9461. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9462. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9463. T as a valid argument for <source>.
  9464.  
  9465.  
  9466. read-byte
  9467. ________________________________________________________________________
  9468.  
  9469. type: function (subr) 
  9470. location: built-in
  9471. source file: xlfio.c  
  9472. Common LISP compatible: similar
  9473. supported on: all machines
  9474.  
  9475. SYNTAX
  9476.  
  9477. (read-byte  [ <source> ]  )
  9478.     <source>    -    an optional source - must be a file pointer
  9479.                 or stream, the default is *standard-input*
  9480.  
  9481. DESCRIPTION
  9482.  
  9483. The  READ-BYTE  function  reads a single  character  from the  specified
  9484. <source>.  The  character  read is returned as an integer  value for the
  9485. result.  The <source> may be a file pointer or a stream.  If there is no
  9486. <source>,   *STANDARD-INPUT*  is  the  default.  If  an  end-of-file  is
  9487. encountered in the <source>, then NIL will be returned as the result.
  9488.  
  9489. EXAMPLES
  9490.  
  9491.     (setq fp (open "f" :direction :output))    ; set up file
  9492.     (print 12.34 fp)            ;
  9493.     (close fp)                ;
  9494.                         ;
  9495.     (setq fp (open "f" :direction :input))    ; now read the file
  9496.     (read-byte fp)                ; returns 49        "1"
  9497.     (read-byte fp)                ; returns 50        "2"
  9498.     (read-byte fp)                ; returns 46        "."
  9499.     (read-byte fp)                ; returns 51        "3"
  9500.     (read-byte fp)                ; returns 52        "4"
  9501.     (read-byte fp)                ; returns 10        "\n"
  9502.     (read-byte fp)                ; returns NIL        empty
  9503.     (close fp)                ; 
  9504.  
  9505. COMMON LISP COMPATABILITY:
  9506. The XLISP and Common LISP READ-BYTE  functions are compatable for simple
  9507. cases.  They both allow for the  optional  <source>.  However, in Common
  9508. LISP, there are addition  parameters  which occur right after  <source>.
  9509. So,  when  porting  from  Common  LISP  to  XLISP,  remember  there  are
  9510. additional arguments in Common LISP's READ-BYTE.
  9511.  
  9512. COMMON LISP COMPATABILITY:
  9513. Common LISP specifies that read  operations with a <source> of NIL, will
  9514. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9515. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9516. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9517. T as a valid argument for <source>.
  9518.  
  9519.  
  9520. read-char
  9521. ________________________________________________________________________
  9522.  
  9523. type: function (subr) 
  9524. location: built-in
  9525. source file: xlfio.c  
  9526. Common LISP compatible: similar
  9527. supported on: all machines
  9528.  
  9529. SYNTAX
  9530.  
  9531. (read-char  [ <source> ]  )
  9532.     <source>    -    an optional source - must be a file pointer
  9533.                 or stream, the default is *standard-input*
  9534.  
  9535. DESCRIPTION
  9536.  
  9537. The  READ-CHAR  function  reads a single  character  from the  specified
  9538. <source>.  The character  read is returned as a single  character  value
  9539. for the  result.  The  <source>  may be a file  pointer or a stream.  If
  9540. there  is  no  <source>,   *STANDARD-INPUT*   is  the   default.  If  an
  9541. end-of-file is encountered in the <source>, then NIL will be returned as
  9542. the result.
  9543.  
  9544. EXAMPLES
  9545.  
  9546.     (setq fp (open "f" :direction :output))    ; set up file
  9547.     (print 12.34 fp)            ;
  9548.     (close fp)                ;
  9549.                         ;
  9550.     (setq fp (open "f" :direction :input))    ; now read the file
  9551.     (read-char fp)                ; returns #\1
  9552.     (read-char fp)                ; returns #\2
  9553.     (read-char fp)                ; returns #\.
  9554.     (read-char fp)                ; returns #\3
  9555.     (read-char fp)                ; returns #\4
  9556.     (read-char fp)                ; returns #\Newline
  9557.     (read-char fp)                ; returns NIL        empty
  9558.     (close fp)                ; 
  9559.  
  9560. COMMON LISP COMPATABILITY:
  9561. The XLISP and Common LISP READ-CHAR  functions are compatable for simple
  9562. cases.  They both allow for the  optional  <source>.  However, in Common
  9563. LISP, there are addition  parameters  which occur right after  <source>.
  9564. So,  when  porting  from  Common  LISP  to  XLISP,  remember  there  are
  9565. additional arguments in Common LISP's READ-CHAR.
  9566.  
  9567. COMMON LISP COMPATABILITY:
  9568. Common LISP specifies that read  operations with a <source> of NIL, will
  9569. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9570. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9571. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9572. T as a valid argument for <source>.
  9573.  
  9574.  
  9575. read-line
  9576. ________________________________________________________________________
  9577.  
  9578. type: function (subr) 
  9579. location: built-in
  9580. source file: xlfio.c  
  9581. Common LISP compatible: similar
  9582. supported on: all machines
  9583.  
  9584. SYNTAX
  9585.  
  9586. (read-line  [ <source> ]  )
  9587.     <source>    -    an optional source - must be a file pointer
  9588.                 or stream, the default is *standard-input*
  9589.  
  9590. DESCRIPTION
  9591.  
  9592. The READ-LINE function reads a single line from the specified  <source>.
  9593. The  line  read is  returned  as a  string  value  for the  result.  The
  9594. <source>  may be a file  pointer or a stream.  If there is no  <source>,
  9595. *STANDARD-INPUT*  is the default.  If an end-of-file  is encountered  in
  9596. the <source>, then NIL will be returned as the result.
  9597.  
  9598. EXAMPLES
  9599.  
  9600.     (setq fp (open "f" :direction :output))    ; set up file
  9601.     (print "fe fi" fp)            ;
  9602.     (print 12.34 fp)            ;
  9603.     (close fp)                ;
  9604.                         ;
  9605.     (setq fp (open "f" :direction :input))    ; now read the file
  9606.     (read-line fp)                ; returns ""fe fi""    
  9607.     (read-line fp)                ; returns "12.34"
  9608.     (read-line fp)                ; returns NIL
  9609.     (close fp)                ; 
  9610.  
  9611. COMMON LISP COMPATABILITY:
  9612. The XLISP and Common LISP READ-LINE  functions are compatable for simple
  9613. cases.  They both allow for the  optional  <source>.  However, in Common
  9614. LISP, there are addition  parameters  which occur right after  <source>.
  9615. So,  when  porting  from  Common  LISP  to  XLISP,  remember  there  are
  9616. additional arguments in Common LISP's READ-LINE.
  9617.  
  9618. COMMON LISP COMPATABILITY:
  9619. Common LISP specifies that read  operations with a <source> of NIL, will
  9620. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9621. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9622. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9623. T as a valid argument for <source>.
  9624.  
  9625.  
  9626. *readtable*
  9627. ________________________________________________________________________
  9628.  
  9629. type: system variable
  9630. location: built-in
  9631. source file: xlread.c
  9632. Common LISP compatible: related
  9633. supported on: all machines
  9634.  
  9635. SYNTAX
  9636.  
  9637. *readtable*
  9638.  
  9639.  
  9640. DESCRIPTION
  9641.  
  9642. The  *READTABLE*  is  a  system  variable  that  contains  XLISP's  data
  9643. structures  relating to the  processing of characters  from the user (or
  9644. files) and read-macro expansions.  The table is 128 entries (0..127) for
  9645. each of the 7-bit ASCII  characters  that XLISP can read.  Each entry in
  9646. the *READTABLE*  array must be one of NIL,  :CONSTITUENT,  :WHITE-SPACE,
  9647. :SESCAPE, :MESCAPE, a :TMACRO dotted pair or a :NMACRO dotted pair.
  9648.  
  9649.         Table entry        Meaning
  9650.         --------------------------------------------------------
  9651.         NIL            Invalid character
  9652.         :CONSTITUENT        The character is valid, as is.
  9653.         :WHITE-SPACE        The character may be skipped over.
  9654.         :SESCAPE        The single escape character ('\');
  9655.         :MESCAPE        The multiple escape character ('|');
  9656.         (:TMACRO . <f> )    A terminating read-macro
  9657.         (:NMACRO . <f> )    A non-terminating read-macro
  9658.  
  9659. In the case of :NMACRO and :TMACRO, the form of the *READTABLE* entry is
  9660. a list like  (:TMACRO .  <function> ) or (:NMACRO .  <function>  ).  The
  9661. <function>  can be a  built-in  read-macro  function  or a user  defined
  9662. lambda expression.  The <function> takes two parameters, an input stream
  9663. specification,   and  an  integer  that  is  the  character  value.  The
  9664. <function>  should  return NIL if the  character is  'white-space'  or a
  9665. value CONSed with NIL to return the value.
  9666.  
  9667. EXAMPLES
  9668.  
  9669.     *readtable*                ; returns the current table
  9670.  
  9671.     (defun look-at (table)            ; define a function to 
  9672.      (dotimes (ch 127)            ;   look in a table
  9673.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  9674.         (case entry             ;   entries with a function
  9675.           (NIL        NIL)        ;
  9676.           (:CONSTITUENT NIL)        ;
  9677.           (:WHITE-SPACE NIL)        ;
  9678.           (:SESCAPE     NIL)        ;
  9679.           (:MESCAPE     NIL)        ;
  9680.           (T      (princ (int-char ch)));
  9681.           )))                ;
  9682.      (terpri))                ;
  9683.                          ;
  9684.     (look-at *readtable*)            ;  prints  "#'(),;`
  9685.  
  9686. CAUTION:
  9687. If you experiment  with  *READTABLE*, it is useful to save the old value
  9688. in a variable, so that you can restore the system state.
  9689.  
  9690.  
  9691. rem
  9692. ________________________________________________________________________
  9693.  
  9694. type: function (subr) 
  9695. location: built-in
  9696. source file: xlmath.c
  9697. Common LISP compatible: similar
  9698. supported on: all machines
  9699.  
  9700. SYNTAX
  9701.  
  9702. (rem <expr1> ... )
  9703.     <exprN>        -    integer number/expression
  9704.  
  9705. DESCRIPTION
  9706.  
  9707. The REM function takes the first pair of expressions and determines what
  9708. is the remainder  from dividing the first by the second  expression.  If
  9709. there  are no other  arguments,  this  value is  returned.  If there are
  9710. additional  arguments, the remainder of the first pair is applied to the
  9711. next  and  then  the next and so on.  In other  words,  (REM A B C D) is
  9712. equivalent to (REM (REM (REM A B) C) D).
  9713.  
  9714. EXAMPLES
  9715.  
  9716.     (rem 1)                    ; returns 1
  9717.     (rem 1 2)                ; returns 1
  9718.     (rem 13 8)                ; returns 5
  9719.     (rem 13 8 3)                ; returns 2
  9720.     (rem 13.5 8)                ; error: bad flt.pt. operation
  9721.  
  9722. COMMON LISP COMPATABILITY:
  9723. Common  LISP only allows two  arguments.  XLISP  supports  an  arbitrary
  9724. number of  arguments.  Also,  Common  LISP  allows  for  floating  point
  9725. expressions where XLISP does not support this.
  9726.  
  9727.  
  9728. remove
  9729. ________________________________________________________________________
  9730.  
  9731. type: function (subr) 
  9732. location: built-in
  9733. source file: xllist.c
  9734. Common LISP compatible: similar
  9735. supported on: all machines
  9736.  
  9737. SYNTAX
  9738.  
  9739. (remove <expr> <list-expr> [ { :test | :test-not } <test> ] )
  9740.     <expr>        -    the expression to remove - an atom or list
  9741.     <list-expr>    -    the list to remove from 
  9742.     <test>        -    optional test function (default is EQL)
  9743.  
  9744. DESCRIPTION
  9745.  
  9746. REMOVE  searches  through  <list-expr>  for <expr>.  If <expr> is found,
  9747. REMOVE  returns  the list with the <expr>  deleted.  All  occurances  of
  9748. <expr> are  deleted.  If <expr> is not found,  then the  <list-expr>  is
  9749. returned  unaltered.  You may  specify  your own test with the :TEST and
  9750. :TEST-NOT keywords followed by the test you which to perform.  Note that
  9751. this  operation  is  non-destructive,  it  does  not  modify  or  affect
  9752. <list-expr> directly - it creates a modified copy.
  9753.  
  9754. EXAMPLES
  9755.  
  9756.     (setq mylist '(a b c d it e f))        ; set up a list
  9757.     (remove 'it mylist)            ; returns (A B C D E F)
  9758.     (print mylist)                ; prints (A B C D IT E F)
  9759.                         ;   note that MYLIST is not
  9760.                         ;   affected 
  9761.     (setq mylist '(a b c b d b))        ; change list to include
  9762.                         ;   duplicates
  9763.     (remove 'b mylist)            ; returns (A C D)
  9764.  
  9765.     (setq alist '( (a) (b) (it) (c)))    ; set up another list
  9766.     (remove '(it) alist)            ; returns ((A) (B) (IT) (C))
  9767.                         ;   the EQ test doesn't work
  9768.                         ;   for lists
  9769.     (remove '(it) alist :test 'equal)    ; returns ((A) (B) (C))
  9770.  
  9771.     (setq slist '( "a" "b" "it" "c"))    ; set up yet another list
  9772.     (remove "it" slist)            ; returns ("a" "b" "c")
  9773.     (remove "it" slist :test-not 'equal)    ; returns ("it") - REMOVE
  9774.                         ;   takes away everything but IT
  9775.  
  9776. NOTE:
  9777. The  REMOVE  function  can work  with a list or  string  as the  <expr>.
  9778. However, the default EQL test does not work with lists or strings,  only
  9779. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  9780. keyword along with EQUAL for <test>.
  9781.  
  9782. COMMON LISP COMPATABILITY:
  9783. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  9784. keywords which Common LISP does.
  9785.  
  9786.  
  9787. remove-if
  9788. ________________________________________________________________________
  9789.  
  9790. type: function (subr) 
  9791. location: built-in
  9792. source file: xllist.c
  9793. Common LISP compatible: similar
  9794. supported on: all machines
  9795.  
  9796. SYNTAX
  9797.  
  9798. (remove-if <test> <list-expr> )
  9799.     <test>        -    the test function to be performed
  9800.     <list-expr>    -    the list to remove from 
  9801.  
  9802. DESCRIPTION
  9803.  
  9804. REMOVE-IF  searches  through  <list-expr>  and removes any elements that
  9805. pass the <test>.  Note that this operation is  non-destructive,  it does
  9806. not modify or affect <list-expr>  directly - it creates a modified copy.
  9807.  
  9808. EXAMPLES
  9809.  
  9810.     (setq mylist '(1 2 3 4 5 6 7 8))    ; set up a list
  9811.     (remove-if 'oddp mylist)        ; returns (2 4 6 8)
  9812.     (remove-if 'evenp mylist)        ; returns (1 3 5 7)
  9813.     (print mylist)                ; prints (1 2 3 4 5 6 7 8)
  9814.                         ;   note that MYLIST is not
  9815.                         ;   affected 
  9816.  
  9817.     (setq mylist '(a nil b nil c))        ; set up a list
  9818.     (remove-if 'null mylist)        ; returns (A B C)
  9819.  
  9820. COMMON LISP COMPATABILITY:
  9821. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  9822. keywords which Common LISP does.
  9823.  
  9824.  
  9825. remove-if-not
  9826. ________________________________________________________________________
  9827.  
  9828. type: function (subr) 
  9829. location: built-in
  9830. source file: xllist.c
  9831. Common LISP compatible: similar
  9832. supported on: all machines
  9833.  
  9834. SYNTAX
  9835.  
  9836. (remove-if-not <test> <list-expr> )
  9837.     <test>        -    the test function to be performed
  9838.     <list-expr>    -    the list to remove from 
  9839.  
  9840. DESCRIPTION
  9841.  
  9842. REMOVE-IF-NOT searches through <list-expr> and removes any elements that
  9843. fail the <test>.  Note that this operation is  non-destructive,  it does
  9844. not modify or affect <list-expr>  directly - it creates a modified copy.
  9845.  
  9846. EXAMPLES
  9847.  
  9848.     (setq mylist '(1 2 3 4 5 6 7 8))    ; set up a list
  9849.     (remove-if-not 'oddp mylist)        ; returns (1 3 5 7)
  9850.     (remove-if-not 'evenp mylist)        ; returns (2 4 6 8)
  9851.     (print mylist)                ; prints (1 2 3 4 5 6 7 8)
  9852.                         ;   note that MYLIST is not
  9853.                         ;   affected 
  9854.  
  9855.     (setq mylist '(a nil b nil c))        ; set up a list
  9856.     (remove-if-not 'null mylist)        ; returns (NIL NIL)
  9857.  
  9858. COMMON LISP COMPATABILITY:
  9859. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  9860. keywords which Common LISP does.
  9861.  
  9862.  
  9863. remprop
  9864. ________________________________________________________________________
  9865.  
  9866. type: function (subr) 
  9867. location: built-in
  9868. source file: xlbfun.c
  9869. Common LISP compatible: no
  9870. supported on: all machines
  9871.  
  9872. SYNTAX
  9873.  
  9874. (remprop <symbol> <property> )
  9875.     <symbol>    -    the symbol with a property list
  9876.     <property>    -    the property name being removed
  9877.  
  9878. DESCRIPTION
  9879.  
  9880. REMPROP removes the <property> from the <symbol>.  The function  returns
  9881. a NIL.  If the <property>  does not exist, there is no error  generated.
  9882. The  <symbol>  must be an  existing  symbol.  Property  lists are  lists
  9883. attached  to any user  defined  variables.  The lists are in the form of
  9884. (name1 val1 name2 val2 ....).  Any number of properties  may be attached
  9885. to a single variable.
  9886.  
  9887. EXAMPLES
  9888.  
  9889.     (setq person 'bobby)            ; create a var with a value
  9890.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  9891.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  9892.     (get person 'last-name)            ; retrieve LAST-NAME - boogie
  9893.     (get person 'job)            ; retrieve JOB - disc-jockey
  9894.     (get person 'height)            ; non-existant - returns NIL
  9895.     (remprop person 'job)            ; remove JOB
  9896.     (remprop person 'height)        ; remove non-existant
  9897.  
  9898. COMMON LISP COMPATIBILITY:
  9899. Common LISP does not have a REMPROP function.  It uses a SETF to achieve
  9900. this  functionality.  Porting  from  Common LISP to XLISP will work fine
  9901. since XLISP supports the SETF  modifications  of property lists and GET.
  9902. Porting from XLISP to Common LISP will require translating  REMPROP into
  9903. SETF forms.
  9904.  
  9905.  
  9906. rest
  9907. ________________________________________________________________________
  9908.  
  9909. type: function (subr) 
  9910. location: built-in
  9911. source file: xlinit.lsp
  9912. Common LISP compatible: yes
  9913. supported on: all machines
  9914.  
  9915. SYNTAX
  9916.  
  9917. (rest <expr> )
  9918.     <expr>        -    a list or list expression
  9919.  
  9920. DESCRIPTION
  9921.  
  9922. REST  returns the  remainder  of a list or list  expression  after first
  9923. element of the list is removed.  If the list is NIL, NIL is returned.
  9924.  
  9925. EXAMPLES
  9926.     (rest '(a b c))                ; returns (B C)
  9927.     (rest '((a b) c d))            ; returns (C D)
  9928.     (rest NIL)                ; returns NIL
  9929.     (rest 'a)                ; error: bad argument type
  9930.     (rest '(a))                ; returns NIL
  9931.  
  9932.     (setq sisters '(virginia vicki cindy))    ; set up variable SISTERS
  9933.     (first sisters)                ; returns VIRGINIA
  9934.     (rest sisters)                ; returns (VICKI CINDY)
  9935.  
  9936. NOTE:
  9937. The REST function is set to the same  code as CDR.  
  9938.  
  9939.  
  9940. &rest
  9941. ________________________________________________________________________
  9942.  
  9943. type: keyword
  9944. location: built-in
  9945. source file: xleval.c
  9946. Common LISP compatible: yes
  9947. supported on: all machines
  9948.  
  9949. SYNTAX
  9950.  
  9951. &rest [ <rest-arg> ]
  9952.     <rest-arg>    -    rest argument symbol
  9953.  
  9954. DESCRIPTION
  9955.  
  9956. In XLISP, there are several times that you define a formal argument list
  9957. for a body of code (like DEFUN,  DEFMACRO,  :ANSWER and LAMBDA).  All of
  9958. the formal  arguments  that are  defined are  required  to appear in the
  9959. invocation  of the  defined  function  or  operation.  If there  are any
  9960. &OPTIONAL  arguments defined, they will be filled in order.  If there is
  9961. a &REST  argument  defined, and all the required  formal  arguments  and
  9962. &OPTIONAL  arguments are filled, any and all further  parameters will be
  9963. passed into the function via the <rarg> argument.  There can be only one
  9964. <rest-arg> argument for &REST.  If there are insufficient parameters for
  9965. any of the &OPTIONAL or &REST  arguments, they will contain NIL.  At the
  9966. end of the  function or  operation  execution,  these local  symbols and
  9967. their values are are removed.
  9968.  
  9969. EXAMPLES
  9970.  
  9971.     (defun foo                 ; define function FOO
  9972.       (a b &optional c d &rest e)        ;   with some of each argument
  9973.       (print a) (print b)             ;
  9974.       (print c) (print d)             ;   print out each
  9975.       (print e))                ;
  9976.     (foo)                    ; error: too few arguments 
  9977.     (foo 1)                    ; error: too few arguments 
  9978.     (foo 1 2)                ; prints 1 2 NIL NIL NIL
  9979.     (foo 1 2 3)                ; prints 1 2 3 NIL NIL
  9980.     (foo 1 2 3 4)                ; prints 1 2 3 4 NIL
  9981.     (foo 1 2 3 4 5)                ; prints 1 2 3 4 (5)
  9982.     (foo 1 2 3 4 5 6 7 8 9)            ; prints 1 2 3 4 (5 6 7 8 9)
  9983.  
  9984.  
  9985.     (defun my-add                 ; define function MY-ADD
  9986.       (num1 &rest num-list &aux sum)    ;   with 1 arg, rest, 1 aux var
  9987.       (setq sum num1)            ;   clear SUM
  9988.       (dotimes (i (length num-list) )    ;   loop through rest list
  9989.          (setq sum (+ sum (car num-list)))  ;      add the number to sum
  9990.          (setq num-list (cdr num-list)))    ;      and remove num from list
  9991.       sum)                    ;   return sum when finished
  9992.     (my-add 1 2 3 4)            ; returns 10
  9993.     (my-add 5 5 5 5 5)            ; returns 25
  9994.  
  9995.  
  9996. restore
  9997. ________________________________________________________________________
  9998.  
  9999. type: function (subr)  
  10000. location: built-in
  10001. source file: xldmem.c  xlimage.c
  10002. Common LISP compatible: no
  10003. supported on: all machines
  10004.  
  10005. SYNTAX
  10006.  
  10007. (restore <file> )
  10008.     <file>        -    a string or symbol for the name of the file 
  10009.  
  10010. DESCRIPTION
  10011.  
  10012. The RESTORE  function  restores  the  previously  saved XLISP  workspace
  10013. (system state) from the specified file.  The <file> may be a string or a
  10014. symbol.  If the  <file>  does not  include a '.wks'  suffix,  it will be
  10015. extended to be called  <file>.wks.  If successful,  RESTORE will print a
  10016. message saying
  10017.  
  10018.     [ returning to the top level ]
  10019.  
  10020. and will not return any value.  If RESTORE  fails, it will  return  NIL.
  10021. There can be several saved workspaces.  These workspaces can be restored
  10022. as often as desired.
  10023.  
  10024. EXAMPLES
  10025.     (defun myfoo (fee fi)             ; create a function
  10026.         (+ fee fi))
  10027.     (setq myvar 5)                ; set MYVAR to value 5
  10028.     myvar                    ; returns 5
  10029.     (save 'farp)                ; save workspace in FARP.wks
  10030.  
  10031.     (setq myvar "garp")            ; change MYVAR to "garp"
  10032.     myvar                    ; returns "garp"
  10033.  
  10034.     (restore 'farp)                ; restore workspace
  10035.     myvar                    ; returns 5
  10036.  
  10037. FILE NAMES:
  10038. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  10039. automatically made uppercase.  In using XLISP, this means you don't have
  10040. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  10041. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  10042. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  10043. if you do a (open 'foo-file :direction :output), this will create a file
  10044. named  "FOO-FILE"  because  XLISP  uppercases  its symbols.  If you do a
  10045. (open  "foo-file"  :direction  :output),  this will  create a file named
  10046. "foo-file"  because UNIX doesn't uppercase its file names.  Another case
  10047. is if you do (save 'world), this will create the file  "WORLD.wks".  So,
  10048. if you are having  trouble  with opening and  accessing  files, check to
  10049. make sure the file name is in the proper case.
  10050.  
  10051.  
  10052. return
  10053. ________________________________________________________________________
  10054.  
  10055. type: special form (fsubr)
  10056. location: built-in
  10057. source file: xlcont.c
  10058. Common LISP compatible: yes
  10059. supported on: all machines
  10060.  
  10061. SYNTAX
  10062.  
  10063. (return  [ <expr> ] )
  10064.     <expr>        -    an expression
  10065.  
  10066. DESCRIPTION
  10067.  
  10068. The RETURN  special  form  allows the  return of an  arbitrary  value at
  10069. arbitrary  times within 'block'  constructs  (DO, DO*, DOLIST,  DOTIMES,
  10070. LOOP, PROG and PROG*).  The <expr> will be returned by the outer 'block'
  10071. construct.  A NIL will be returned  by the outer  'block'  construct  if
  10072. there is no <expr>  specified.  If RETURN is used without being within a
  10073. valid 'block'  construct, an error is generated:  "error:  no target for
  10074. RETURN".
  10075.  
  10076. EXAMPLES
  10077.  
  10078.     (prog (i)                 ; PROG form
  10079.       (print i) (RETURN "foo") (print j))    ; prints  NIL     returns "foo"
  10080.  
  10081.     (dotimes (i 10)             ;
  10082.       (if (eql i 5) (RETURN 20)         ;
  10083.               (princ i)))        ; prints  01234      returns 20
  10084.  
  10085.     (prog1 (print "hi") (RETURN "foo"))    ; prints  "hi"
  10086.                         ; error: no target for RETURN
  10087.  
  10088.     (return 9)                ; error: no target for RETURN 
  10089.  
  10090.  
  10091. return-from
  10092. ________________________________________________________________________
  10093.  
  10094. type: special form (fsubr)
  10095. location: built-in
  10096. source file: xlcont.c
  10097. Common LISP compatible: yes
  10098. supported on: all machines
  10099.  
  10100. SYNTAX
  10101.  
  10102. (return-from  <name> [ <expr> ] )
  10103.     <name>        -    an unevaluated symbol for the block name
  10104.     <expr>        -    an expression
  10105.  
  10106. DESCRIPTION
  10107.  
  10108. The RETURN-FROM  special form allows the return of an arbitrary value at
  10109. arbitrary  times  within  a  'named-block'   construct  (BLOCK)  of  the
  10110. specified  <name>.  The <expr> will be returned by the BLOCK  construct.
  10111. A NIL will be  returned  by the  BLOCK  construct  if there is no <expr>
  10112. specified.  If  RETURN-FROM  is used without  being within a valid BLOCK
  10113. construct, an error is generated:  "error:  no target for RETURN".
  10114.  
  10115. EXAMPLES
  10116.  
  10117.     (block out                 ; outer BLOCK
  10118.        (print "outer")            ; 
  10119.        (block in                 ; inner BLOCK
  10120.         (print "inner")            ;
  10121.         (return-from out "all done")    ;
  10122.         (print "won't get here")    ;
  10123.        )                    ;
  10124.     )                    ; prints "outer"
  10125.                         ; prints "inner"
  10126.                         ; returns "all done"
  10127.  
  10128.     (return-from nobody 9)            ; error: no target for RETURN 
  10129.  
  10130.  
  10131. reverse
  10132. ________________________________________________________________________
  10133.  
  10134. type: function (subr) 
  10135. location: built-in
  10136. source file: xllist.c
  10137. Common LISP compatible: yes
  10138. supported on: all machines
  10139.  
  10140. SYNTAX
  10141.  
  10142. (reverse <list-expr> )
  10143.     <list-expr>    -    a list or list expression
  10144.  
  10145. DESCRIPTION
  10146.  
  10147. The REVERSE function reverses the <list-expr>.  The reversed list is the
  10148. returned value.  The reversal  process only occurs on the 'top-level' of
  10149. the <list-expr>.  If there are nested  sub-lists, these are left intact.
  10150.  
  10151. EXAMPLES
  10152.  
  10153.     (reverse NIL)                ; returns NIL
  10154.     (reverse 'a)                ; error: bad argument type 
  10155.     (reverse '(a))                ; returns (A)
  10156.     (reverse '(a b c))            ; returns (C B A)
  10157.     (reverse '((a b) (c d) (e f)))        ; returns ((E F) (C D) (A B))
  10158.     (reverse (list (+ 1 2) (+ 3 4)))    ; returns (7 3)
  10159.  
  10160.  
  10161. room
  10162. ________________________________________________________________________
  10163.  
  10164. type: function (subr) 
  10165. location: built-in
  10166. source file: xldmem.c
  10167. Common LISP compatible: yes
  10168. supported on: all machines
  10169.  
  10170. SYNTAX
  10171.  
  10172. (room [ <info> ] )
  10173.     <info>        -    an optional, unused expression 
  10174.  
  10175. DESCRIPTION
  10176.  
  10177. The  ROOM   function   prints   the   current   memory   statistics   to
  10178. *STANDARD-OUTPUT*.  NIL  is  always  returned.  The  message  shows  the
  10179. statistics  for total  NODES,  current  FREE  NODES,  current  number of
  10180. allocated memory  SEGMENTS, node size of the ALLOCATEd  memory segments,
  10181. TOTAL memory in bytes and total number of garbage  COLLECTIONS that have
  10182. occured since this session of XLISP started.
  10183.  
  10184. EXAMPLES
  10185.  
  10186.     (room)                    ; prints  Nodes:       4000
  10187.                         ;      Free nodes:  1723
  10188.                         ;      Segments:    4
  10189.                         ;         Allocate:    1000
  10190.                         ;      Total:       52566
  10191.                         ;      Collections: 8
  10192.                         ; returns NIL
  10193.  
  10194. COMMON LISP COMPATABILITY:
  10195. In Common LISP, the <info>  argument  controls the amount of information
  10196. that is printed.
  10197.  
  10198. COMMON LISP COMPATABILITY:
  10199. The  form  of  and   information   provided   by  the  ROOM   output  is
  10200. implementation dependent.  For portability, you should not count on this
  10201. information or form.
  10202.  
  10203.  
  10204. rplaca
  10205. ________________________________________________________________________
  10206.  
  10207. type: function (subr) 
  10208. location: built-in
  10209. source file: xllist.c
  10210. Common LISP compatible: yes
  10211. supported on: all machines
  10212.  
  10213. SYNTAX
  10214.  
  10215. (rplaca <list> <expr> )
  10216.     <list>        -    the list to DESTRUCTIVELY modify
  10217.     <expr>        -    the expression to replace CAR of <list>
  10218.  
  10219. DESCRIPTION
  10220.  
  10221. RPLACA destructively modifies the CAR of <list> and replaces it with the
  10222. <expr>.  The destructive  aspect of this operation means that the actual
  10223. symbol  value  is used in the  list-modifying  operations  - not a copy.
  10224. <list>  must  evaluate to a valid list.  An atom or NIL for <list>  will
  10225. result in an error.
  10226.  
  10227. EXAMPLES
  10228.  
  10229.     (setq a '(1 2 3))            ; make A with value (1 2 3)
  10230.     (setq b '(1 2 3))            ; make B with value (1 2 3)
  10231.     (setq c a)                ; make C point to A's value 
  10232.     (rplaca a 'new)                ; returns (NEW 2 3)
  10233.     (print a)                ; prints (NEW 2 3)
  10234.                         ; NOTE THAT A IS MODIFIED!
  10235.     (print b)                ; prints (1 2 3)
  10236.                         ; note that B is not modified
  10237.     (print c)                ; prints (NEW 2 3)
  10238.                         ; NOTE THAT C IS MODIFIED TOO!
  10239.  
  10240.     (setq a '(1 2 3))            ; reset A to value (1 2 3)
  10241.     (rplaca a '(the sub list))        ; returns ((THE SUB LIST) 2 3)
  10242.     (rplaca '(1 2 3) 'more)            ; returns (MORE 2 3)
  10243.  
  10244.     (rplaca 'a 'b)                ; error: bad argument type 
  10245.      (rplaca NIL 'b)                ; error: bad argument type
  10246.  
  10247.  
  10248. rplacd
  10249. ________________________________________________________________________
  10250.  
  10251. type: function (subr) 
  10252. location: built-in
  10253. source file: xllist.c
  10254. Common LISP compatible: yes
  10255. supported on: all machines
  10256.  
  10257. SYNTAX
  10258.  
  10259. (rplacd <list> <expr> )
  10260.     <list>        -    the list to DESTRUCTIVELY modify
  10261.     <expr>        -    the expression to replace the CDR of <list>
  10262.  
  10263. DESCRIPTION
  10264.  
  10265. RPLACD destructively modifies the CDR of <list> and replaces it with the
  10266. <expr>.  The destructive  aspect of this operation means that the actual
  10267. symbol  value  is used in the  list-modifying  operations  - not a copy.
  10268. <list>  must  evaluate to a valid list.  An atom or NIL for <list>  will
  10269. result in an error.
  10270.  
  10271. EXAMPLES
  10272.  
  10273.     (setq a '(1 2 3))            ; set up A with (1 2 3)
  10274.     (rplacd a 'new)                ; returns (1 . NEW)
  10275.     (print a)                ; prints (1 . NEW)
  10276.                         ; NOTE THAT A IS MODIFIED!
  10277.                         ; 
  10278.     (rplacd a '(a new list))        ; returns (1 A NEW LIST)
  10279.     (rplacd '(1 2 3) '(more))        ; returns (1 MORE)
  10280.     (rplacd 'a 'b)                ; error: bad argument type
  10281.     (rplacd NIL 'b)                ; error: bad argument type
  10282.  
  10283.  
  10284. save
  10285. ________________________________________________________________________
  10286.  
  10287. type: function (subr)  
  10288. location: built-in
  10289. source file: xldmem.c  xlimage.c
  10290. Common LISP compatible: no
  10291. supported on: all machines
  10292.  
  10293. SYNTAX
  10294.  
  10295. (save <file> )
  10296.     <file>        -    a string or symbol for the name of the file 
  10297.  
  10298. DESCRIPTION
  10299.  
  10300. The SAVE function saves the current XLISP  workspace  (system  state) to
  10301. the  specified  file.  The  <file>  may be a string or a symbol.  If the
  10302. <file>  does not  include a '.wks'  suffix,  it will be  extended  to be
  10303. called <file>.wks.  The function returns T if the workspace was properly
  10304. created  and  saved, NIL is  returned  otherwise.  There can be  several
  10305. saved workspaces.  These workspaces can be restored as often as desired.
  10306.  
  10307. EXAMPLES
  10308.     (defun myfoo (fee fi)             ; create a function
  10309.         (+ fee fi))
  10310.     (setq myvar 5)                ; set MYVAR to value 5
  10311.     myvar                    ; returns 5
  10312.     (save 'farp)                ; save workspace in FARP.wks
  10313.  
  10314.     (setq myvar "garp")            ; change MYVAR to "garp"
  10315.     myvar                    ; returns "garp"
  10316.  
  10317.     (restore 'farp)                ; restore workspace
  10318.     myvar                    ; returns 5
  10319.  
  10320. BUG:
  10321. The SAVE  function  generates a system error if the <file> being created
  10322. already exists.  This <file> will be modified and will not be restorable
  10323. after restarting XLISP.
  10324.  
  10325. NOTE:
  10326. The saved workspace size is implementation  dependent, but can be fairly
  10327. large.
  10328.  
  10329. FILE NAMES:
  10330. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  10331. automatically made uppercase.  In using XLISP, this means you don't have
  10332. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  10333. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  10334. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  10335. if you do a (open 'foo-file :direction :output), this will create a file
  10336. named  "FOO-FILE"  because  XLISP  uppercases  its symbols.  If you do a
  10337. (open  "foo-file"  :direction  :output),  this will  create a file named
  10338. "foo-file"  because UNIX doesn't uppercase its file names.  Another case
  10339. is if you do (save 'world), this will create the file  "WORLD.wks".  So,
  10340. if you are having  trouble  with opening and  accessing  files, check to
  10341. make sure the file name is in the proper case.
  10342.  
  10343. COMMON LISP COMPATABILITY:
  10344. The SAVE function is similar in use to the SAVE-WORLD function in Common
  10345. LISP.  The primarily difference is that SAVE-WORLD allows you to restart
  10346. everything  since it  creates  an  executable  file.  The SAVE  function
  10347. requires  you to start  XLISP up first and then do a RESTORE.  Depending
  10348. on the  operating  system that you are using, it is possible  to write a
  10349. SAVE-WORLD equivalent using SAVE, RESTORE and SYSTEM functions.
  10350.  
  10351.  
  10352. savefun
  10353. ________________________________________________________________________
  10354.  
  10355. type: defined macro (closure)  
  10356. location: extension
  10357. source file: init.lsp
  10358. Common LISP compatible: no
  10359. supported on: all machines
  10360.  
  10361. SYNTAX
  10362.  
  10363. (savefun <function> )
  10364.     <function>    -    the name of the function or macro to be saved
  10365.  
  10366. DESCRIPTION
  10367.  
  10368. The SAVEFUN macro saves the specified  function or macro to a file.  The
  10369. file will be called  <function>.lsp.  The macro  returns  the file  name
  10370. that was created.  An error will occur if the  <function>  parameter  is
  10371. not a function or macro.
  10372.  
  10373. EXAMPLES
  10374.     (defun myfoo (fee fi)             ; create a function
  10375.         (+ fee fi))
  10376.     (savefun myfoo)                ; saves MYFOO to "MYFOO.lsp"
  10377.     (savefun savefun)            ; saves SAVEFUN to "SAVEFUN.lsp"
  10378.     (savefun 'a)                ; error: bad argument type
  10379.  
  10380. NOTE:
  10381. The SAVEFUN macro is defined in the INIT.LSP  file.  If SAVEFUN does not
  10382. exist in your XLISP system, you might be having a problem with INIT.LSP.
  10383. Before you start XLISP, look in the directory you are currently  in, and
  10384. check to see if there is an INIT.LSP.  Another  thing to try is to put a
  10385. PRINT message in the INIT.LSP  file and make sure that it is printed out
  10386. when XLISP starts running.
  10387.  
  10388.  
  10389. second
  10390. ________________________________________________________________________
  10391.  
  10392. type: function (subr) 
  10393. location: built-in
  10394. source file: xlinit.c
  10395. Common LISP compatible: yes
  10396. supported on: all machines
  10397.  
  10398. SYNTAX
  10399.  
  10400. (second <expr> )
  10401.     <expr>        -    a list or list expression
  10402.  
  10403. DESCRIPTION
  10404.  
  10405. SECOND returns the second element of a list or list  expression.  If the
  10406. list is NIL, NIL is returned.
  10407.  
  10408. EXAMPLES
  10409.     (second '(1 2 3))            ; returns 2
  10410.     (second NIL)                ; returns NIL
  10411.  
  10412.     (setq carol '(a b c))            ; set up variable CAROL
  10413.     (first carol)                ; returns A
  10414.     (second carol)                ; returns B
  10415.     (rest carol)                ; returns (B C)
  10416.  
  10417.     (setq children '(amanda ben))        ; set up variable CHILDREN
  10418.     (second children)            ; returns BEN
  10419.  
  10420. NOTE:
  10421. This  function is set to the same  code as CADR.  
  10422.  
  10423.  
  10424. self
  10425. ________________________________________________________________________
  10426.  
  10427. type: symbol
  10428. location: built-in
  10429. source file: xlobj.c
  10430. Common LISP compatible: no
  10431. supported on: all machines
  10432.  
  10433. SYNTAX
  10434.  
  10435. self
  10436.  
  10437. DESCRIPTION
  10438.  
  10439. SELF evaluates to the current object when used within a message context.
  10440.  
  10441. EXAMPLES
  10442.     (setq my-class                 ; create MY-CLASS with STATE
  10443.         (send class :new '(state)))    ;
  10444.     (send my-class :answer :isnew '()    ; set up initialization
  10445.         '((setq state nil) SELF))    ;     returning SELF 
  10446.     (send my-class :answer :set-it '(value)    ; create :SET-IT message
  10447.         '((setq state value)))        ;
  10448.     (setq my-obj (send my-class :new))    ; create MY-OBJ of MY-CLASS
  10449.     (send my-obj :set-it 5)            ; STATE is set to 5
  10450.  
  10451. CONTEXT: 
  10452. SELF does not exist  except  within  the  context  of a method  and it's
  10453. execution.
  10454.  
  10455. NOTE:
  10456. In the previous  example,  there is a SELF in the line that  creates the
  10457. :SET-IT  message.  What this does is to return  the  object  as the last
  10458. operation when you do an :ISNEW.
  10459.  
  10460.  
  10461. send
  10462. ________________________________________________________________________
  10463.  
  10464. type: function (subr)
  10465. location: built-in
  10466. source file: xlobj.c
  10467. Common LISP compatible: no
  10468. supported on: all machines
  10469.  
  10470. SYNTAX
  10471.  
  10472. (send <object> <message> [<args>] )
  10473.     <object>    -    an object 
  10474.     <message>    -    message selector for object
  10475.     <arg>        -    parameter sent to object method
  10476.  
  10477. DESCRIPTION
  10478.  
  10479. The  SEND  function  is the  mechanism  used to send a  <message>  to an
  10480. <object>.  The <message> is the message  selector symbol that is used to
  10481. select a particular action (method) from the object.
  10482.  
  10483. EXAMPLES
  10484.     (setq myclass (send class :new '(var)))    ; create MYCLASS with VAR
  10485.     (send myclass :answer :isnew '()    ; set up initialization
  10486.         '((setq var nil) self))
  10487.     (send myclass :answer :set-it '(value)    ; create :SET-IT message
  10488.         '((setq var value)))    
  10489.     (setq my-obj (send myclass :new))    ; create MY-OBJ of MYCLASS
  10490.     (send my-obj :set-it 5)            ; VAR is set to 5
  10491.  
  10492. BUILT-IN METHODS:
  10493. The built in methods in XLISP include:
  10494.  
  10495.         <message>    operation
  10496.         -------------------------------------------------------
  10497.         :ANSWER        Add a method to an object.
  10498.         :CLASS        Return the object's class.
  10499.         :ISNEW        Run initialization code on object.
  10500.         :NEW        Create a new object (instance or class).
  10501.         :SHOW        Show the internal state of the object.
  10502.  
  10503. MESSAGE STRUCTURE:
  10504. The normal XLISP  convention  for a <message> is to have a valid  symbol
  10505. preceeded  by a  colon  like  :ISNEW  or  :MY-MESSAGE.  However,  it  is
  10506. possible  to define a  <message>  that is a symbol  without a colon, but
  10507. this makes the code less readable.
  10508.  
  10509.  
  10510. send-super
  10511. ________________________________________________________________________
  10512.  
  10513. type: function (subr)
  10514. location: built-in
  10515. source file: xlobj.c
  10516. Common LISP compatible: no
  10517. supported on: all machines
  10518.  
  10519. SYNTAX
  10520.  
  10521. (send-super <message> [<args>])
  10522.     <message>    -    the message selector
  10523.     <args>        -    the optional message arguments
  10524.  
  10525. DESCRIPTION
  10526.  
  10527. The  SEND-SUPER  function  sends the specified  arguments  <args> to the
  10528. <message>  specified  method  of the  superclass.  It is  necessary  for
  10529. SEND-SUPER  to be executed  from within a method  being  performed on an
  10530. object.  It  will   return  the  result  of  sending  the   message.  If
  10531. SEND-SUPER is performed  outside of a method an error  "error:  not in a
  10532. method" will result.
  10533.  
  10534. EXAMPLES
  10535.     (setq a-class (send class :new '()))    ; create A-CLASS 
  10536.     (send a-class :answer :show '()        ; set up special SHOW method
  10537.         '((print "nobody here") self))    ;
  10538.     (setq an-obj (send a-class :new))    ; create AN-OBJ of A-CLASS
  10539.     (send an-obj :show)            ; prints "nobody here"
  10540.     (send a-class :answer :myshow '()    ; set up MYSHOW method which
  10541.         '((send-super :show )))        ;     calls :SHOW in superclass
  10542.     (send an-obj :myshow)            ; prints Object is ............
  10543.  
  10544.  
  10545. :sescape
  10546. ________________________________________________________________________
  10547.  
  10548. type: keyword
  10549. location: built-in
  10550. source file: xlread.c
  10551. Common LISP compatible: no
  10552. supported on: all machines
  10553.  
  10554. SYNTAX
  10555.  
  10556. :sescape
  10557.  
  10558.  
  10559. DESCRIPTION
  10560.  
  10561. :SESCAPE is an entry that is used in the  *READTABLE*.  *READTABLE* is a
  10562. system  variable that contains  XLISP's data structures  relating to the
  10563. processing  of  characters  from  the  user (or  files)  and  read-macro
  10564. expansions.  The  existance  of the  :SESCAPE  keyword  means  that  the
  10565. specified  character  is to be used as a single  escape  character.  The
  10566. system defines that the the vertical bar character \ is the only defined
  10567. :SESCAPE character.
  10568.  
  10569. EXAMPLES
  10570.  
  10571.     (defun look-at (table)            ; define a function to 
  10572.      (dotimes (ch 127)            ;   look in a table
  10573.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  10574.         (case entry             ;   entries with a function
  10575.           (:SESCAPE             ;
  10576.               (princ (int-char ch)))    ;
  10577.           (T        NIL))))        ;
  10578.      (terpri))                ;
  10579.     (look-at *readtable*)            ;  prints  \ 
  10580.  
  10581. CAUTION:
  10582. If you experiment  with  *READTABLE*, it is useful to save the old value
  10583. in a variable, so that you can restore the system state.
  10584.  
  10585.  
  10586. set
  10587. ________________________________________________________________________
  10588.  
  10589. type: function (subr) 
  10590. location: built-in
  10591. source file: xlbfun.c
  10592. Common LISP compatible: yes
  10593. supported on: all machines
  10594.  
  10595. SYNTAX
  10596.  
  10597. (set <symbol> <expr> )
  10598.     <symbol>    -    expression that evaluates to a symbol name
  10599.                 (if expression is quoted, no evaluation occurs)
  10600.     <expr>        -    an expression - which will be the new value
  10601.  
  10602. DESCRIPTION
  10603.  
  10604. SET  evaluates  <symbol> and sets <expr> as it's value.  If the <symbol>
  10605. value is quoted (via the QUOTE  special form or  read-macro  expansion),
  10606. the  <symbol>  is not  evaluated.  SET returns  the value from <expr> as
  10607. it's result.
  10608.  
  10609. EXAMPLES
  10610.  
  10611.     (set 'a 2)                ; sets symbol A to value 2
  10612.     (set 'value a)                ; sets symbol VALUE to value 2
  10613.     (print value)                ; show the value - prints 2
  10614.     (set 'name 'myvar)            ; set symbol NAME to value MYVAR
  10615.     (set name 12345)            ; set symbol which is the value
  10616.                         ;     of NAME (MYVAR) to 12345
  10617.     (print name)                ; prints MYVAR    
  10618.     (print myvar)                ; prints 12345
  10619.  
  10620.     (set notsymbol 1)            ; error: unbound variable
  10621.     (set name notvalue)            ; error: unbound variable
  10622.  
  10623.  
  10624. setf
  10625. ________________________________________________________________________
  10626.  
  10627. type: special form (fsubr)
  10628. location: built-in
  10629. source file: xlcont.c
  10630. Common LISP compatible: yes
  10631. supported on: all machines
  10632.  
  10633. SYNTAX
  10634.  
  10635. (setf [ <place1> <expr1> ... ] )
  10636.     <placeN>    -    a field specifier which may be one of:
  10637.                 <symbol>        (car <expr> )
  10638.                 +î✓9⓪2¶89⓪④ääòij@ə≤≡`03≡bββ03≡£<£        (aref <expr> <n> )    (get <symb> <property> )
  10639.                 (symbol-value <symb> )    (symbol-plist <symb> )
  10640.     <exprN>        -    an expression - which will be the new value
  10641.  
  10642. DESCRIPTION
  10643.  
  10644. SETF  evaluates the field <placeN> and sets <exprN> as it's value.  This
  10645. is a  generalized  tool that allows you to set the value of the  various
  10646. data types of the system.  SETF  returns the value from  <exprN> as it's
  10647. result.  The specific action of SETF depends on the <placeN> field.
  10648.  
  10649. EXAMPLES
  10650.  
  10651.                         ; SETF SYMBOL
  10652.     (setf a 123)                ; set a symbol A to value 123    
  10653.  
  10654.                         ; SETF SYMBOL-VALUE
  10655.     (setq/âנז⇩Brrrr@@6Ã⇩ךSβÇ⇨ sα≤αÇ`≤α#Ç`⇩③α£<Éβ⇩b3≡βÇ⇨ p#Ç`⇩③α≡ô≥0££É③β⇩sβÇ⇨ sα`πÇsα≤π cÇÇ!③≡αÉ£<£££££É③≤≤α`③α#Ç`⇩③α<<£<£££££É③β╱f3Σdüsµ⇦f⇦╱⇦ a<Éβ⇩aôαÇ`üs≥⓪πôπ3π③ΓpÉ££É③ΣädüsαÇ`≤α#Ç`⇩③≡τôτ3τ③µp£<Éβ⇩b3≡π⇨ü3αÇ`üpô≥≡£££É③ππÇ"⇩③τ◆ü3α⇩3Σädüsα`③αⁿ<£££££É③≤≤Σädüsα ③αü③≡α≤τ3τ③µp£<Éβ⇩b3≡π⇩a3αÇ`üpô≥⓪αôα3ΓcÉ⇩"pÉ£É③ππÇ"⇩③τ╱a3α⇩3Σädüsα`③ⁿ<£££££É③≤≤≡αôα3µgÉ╱⇦&pôβ③α`πÇsⁿ<£££££É③≤≤Σädüsα ③αü③≡α≤αôα3µgÉ╱⇦&p£<Éβ⇩b3≡α `≤±③αÇ`üpô≥Γ⇧"⓪Éam)    ; change 3rd of MYLIST to 
  10656.                         ;   HERE-I-AM so that MYLIST
  10657.                         ;   now is (X Y Z HERE-I-AM)
  10658.  
  10659.                         ; SETF AREF
  10660.     (setq myarray (make-array 5))        ; make MYARRAY
  10661.     (aref myarray 2)            ; get value of element 2 = NIL
  10662.     (setf (aref myarray 2) 'new-value)    ; set value of element 2 to 
  10663.                         ;   value NEW-VALUE
  10664.     (print myarray)                ; prints 
  10665.                         ;   #(NIL NIL NEW-VALUE NIL NIL)
  10666.  
  10667.                         ; SETF PROPERTIES
  10668.     (setq person 'joe-bob)            ; make PERSON with value JOE-BOB
  10669.     (putprop person 'critic 'profession)    ; set PROFESSION property to 
  10670.                         ;   value CRITIC
  10671.     (setf (get person 'profession)         ; change PROFESSION to value
  10672.            'texas-critic)            ;   TEXAS-CRITIC
  10673.     (setf (get person 'home) 'texas)    ; add property HOME with 
  10674.                         ;   value TEXAS
  10675.     (symbol-plist person)            ; returns property list:
  10676.                         ;   (HOME TEXAS 
  10677.                         ;    PROFESSION TEXAS-CRITIC)
  10678.     (setf (symbol-plist person)         ; change the property list 
  10679.          '(home on-the-range         ;
  10680.            profession movie-critic))    ;
  10681.     (get person 'profession)        ; now returns MOVIE-CRITIC
  10682.     (get person 'home)            ; now returns ON-THE-RANGE
  10683.  
  10684. OPERATIONS:
  10685.     <placeN>        SETF action
  10686.     -------------------------------------------------------------------
  10687.     <symbol>                Sets the value of  <symbol> to the value
  10688.                 of  <exprN>.  This  is  equivalent  to a
  10689.                 (SETQ <symbol> <exprN> ).
  10690.  
  10691.     (car <expr> )           Sets the  first  element  of the  <expr>
  10692.                 list to <exprN>.  <expr> must be a list.
  10693.                 This is equivalent  to a (RPLACA  <expr>
  10694.                 <exprN> ) except  that SETF will  return
  10695.                 <exprN>  as the  value.  (cdr  <expr>  )
  10696.                 Sets  the  tail of the  <expr>  list  to
  10697.                 <exprN>.  <expr>  must  be a list.  This
  10698.                 is  equivalent   to  a  (RPLACD   <expr>
  10699.                 <exprN> ) except  that SETF will  return
  10700.                 <exprN> as the value.
  10701.  
  10702.     (nth <n> <expr> )       Sets the  <n>th  element  of the  <expr>
  10703.                 list to <exprN>.  <expr> must be a list.
  10704.                 This  allows  you  to  set an  arbitrary
  10705.                 element of a list to an arbitrary value.
  10706.                 Note that the list is numbered  from the
  10707.                 0th element (0, 1, 2, 3, ...).
  10708.  
  10709.     (aref <expr> <n> )      Sets the  <n>th  element  of the  <expr>
  10710.                 array  to  <exprN>.  <expr>  must  be an
  10711.                 array.  This   allows   you  to  set  an
  10712.                 arbitrary  element  of an  array  to  an
  10713.                 arbitrary  value.  Note that the list is
  10714.                 numbered  from the 0th element (0, 1, 2,
  10715.                 3,  ...).  Note  also  that  this is the
  10716.                 intended  way to  set  the  value  of an
  10717.                 array element.
  10718.  
  10719.     (get <sym> <prop> )     Sets the  <prop>  of <sym> to the  value
  10720.                 <exprN>.  If <sym>  does  not  have  the
  10721.                 <prop>,  one  will be  created.  This is
  10722.                 equivalent  to  (PUTPROP  <sym>  <exprN>
  10723.                 <prop> ).
  10724.  
  10725.     (symbol-value <symbol>) Sets  the  symbol's   value  to  contain
  10726.                 <exprN>.  <symbol> is an expression that
  10727.                 must  evaluate  to a valid  symbol  - it
  10728.                 doesn't  have to exist  before the SETF,
  10729.                 it just has to be a valid  symbol.  This
  10730.                 is equivalent to (SET  <symbol>  <exprN>
  10731.                 ).
  10732.  
  10733.     (symbol-plist <symbol>) Sets the  property  list of  <symbol> to
  10734.                 <exprN>.  This  allows you to change (or
  10735.                 destroy) the entire  property  list of a
  10736.                 <symbol> at one time.
  10737.  
  10738.  
  10739. set-macro-character
  10740. ________________________________________________________________________
  10741.  
  10742. type: defined function (closure) 
  10743. location: extension
  10744. source file: init.lsp
  10745. Common LISP compatible: related
  10746. supported on: all machines
  10747.  
  10748. SYNTAX
  10749.  
  10750. (set-macro-character <char-num> <function>  [ <termflag> ] )
  10751.     <char-num>    -    an integer expression
  10752.     <function>    -    a function definition
  10753.     <termflag>    -    an expression - NIL or non-NIL
  10754.  
  10755. DESCRIPTION
  10756.  
  10757. The SET-MACRO-CHARACTER function installs the code that will be executed
  10758. when the specified  character  <char-num>  is  encountered  by the XLISP
  10759. reader.  The  <function> is placed in the  *READTABLE*  system  variable
  10760. which  contains  the  reader  table  array.  The  table  is 128  entries
  10761. (0..127)  for each of the 7-bit  ASCII  characters  that XLISP can read.
  10762. Each  entry in the  table  must be one of NIL,  :CONSTITUENT,  :SESCAPE,
  10763. :MESCAPE,  :WHITE-SPACE, a :TMACRO dotted pair or a :NMACRO dotted pair.
  10764. The SET-MACRO-CHARACTER function only allows you to put in a terminating
  10765. read-macro  function (:TMACRO) or a non-terminating  read-macro-function
  10766. (:NMACRO).  If  the   <termflag>  is  present  and  non-NIL,   then  the
  10767. <function> will be put in *READTABLE* as a :TMACRO entry.  If <termflag>
  10768. is not present or NIL, then  <function>  will be put in *READTABLE* as a
  10769. :NMACRO entry.  The <function> can be a built-in  read-macro function or
  10770. a user  defined  defun  symbol or a lambda  expression.  The  <function>
  10771. takes two parameters, an input stream specification, and an integer that
  10772. is  the  character  value.  The  <function>  should  return  NIL  if the
  10773. character  is  'white-space'  or a value  CONSed  with NIL to return the
  10774. value.  The function SET-MACRO-CHARACTER always returns T.
  10775.  
  10776. EXAMPLES
  10777.  
  10778.     (print "hi") % comment            ; prints  "hi"  and gives
  10779.                         ; error: unbound variable - %
  10780.                         ; because percent is viewed 
  10781.                         ; as a variable
  10782.                         ;
  10783.     (setq semi (get-macro-character #\;))    ; get semi-colon code
  10784.                         ;    
  10785.     (SET-MACRO-CHARACTER #\% semi T)    ; set % to work as a comment
  10786.                         ;
  10787.     (print "hi") % comment            ; prints  "hi" and no error
  10788.                         ; because % is now a comment
  10789.                         ; character in *READTABLE*
  10790.  
  10791. NOTE:
  10792. In the normal XLISP system the following characters have code associated
  10793. with them in the *READTABLE*:
  10794.  
  10795.         " # ' ( ) , ; `
  10796.  
  10797. NOTE:
  10798. The functions GET-MACRO-CHARACTER and SET-MACRO-CHARACTER are created in
  10799. the INIT.LSP file.  If they do not exist in your XLISP system, you might
  10800. be having a problem with  INIT.LSP.  Before you start XLISP, look in the
  10801. directory  you  are  currently  in,  and  check  to see if  there  is an
  10802. INIT.LSP.
  10803.  
  10804. COMMON LISP COMPATABILITY:
  10805. The SET-MACRO-CHARACTER  function is somewhat related to the Common LISP
  10806. SET-DISPATCH-MACRO-CHARACTER function.
  10807.  
  10808.  
  10809. setq
  10810. ________________________________________________________________________
  10811.  
  10812. type: special form (fsubr)
  10813. location: built-in
  10814. source file: xlcont.c
  10815. Common LISP compatible: yes
  10816. supported on: all machines
  10817.  
  10818. SYNTAX
  10819.  
  10820. (setq [ <symbol1> <expr1> ] ... )
  10821.     <symbolN>    -    un-evaluated symbol
  10822.     <exprN>        -    value for <symbolN>
  10823.  
  10824. DESCRIPTION
  10825.  
  10826. SETQ sets <expr> as the value of  <symbol>.  SETQ returns the value from
  10827. <expr> as it's result.
  10828.  
  10829. EXAMPLES
  10830.  
  10831.     (setq a 1)                ; symbol A gets value 1
  10832.     (setq b '(a b c))            ; symbol B gets value (A B C)
  10833.     (setq mynum (+ 3 4))            ; symbol MYNUM gets value 7
  10834.  
  10835.  
  10836. :show
  10837. ________________________________________________________________________
  10838.  
  10839. type: message selector
  10840. location: built-in
  10841. source file: xlobj.c
  10842. Common LISP compatible: no
  10843. supported on: all machines
  10844.  
  10845. SYNTAX
  10846.  
  10847. (send <object> :show)
  10848.     <object>    -    an existing object
  10849.  
  10850. DESCRIPTION
  10851.  
  10852. The :SHOW  message  selector  attempts to find the 'show'  method in the
  10853. specified   <object>'s  class.  Since  the  :SHOW  message  selector  is
  10854. built-in  in the root  class  (CLASS),  this is  always a valid  message
  10855. selector.  The object must already exist.
  10856.  
  10857. EXAMPLES
  10858.     (setq my-class                 ; create MY-CLASS with STATE
  10859.         (send class :new '(state)))    ;
  10860.     (send my-class :answer :isnew '()    ; set up initialization
  10861.         '((setq state nil) self))
  10862.     (send my-class :answer :set-it '(value)    ; create :SET-IT message
  10863.         '((setq state value)))    
  10864.     (setq my-obj (send my-class :new))    ; create MY-OBJ of MY-CLASS
  10865.     (send my-obj :show)            ; returns object state including
  10866.                         ;   STATE = NIL
  10867.     (send my-obj :set-it 5)            ; STATE is set to 5
  10868.     (send new-obj :show)            ; error: unbound variable
  10869.  
  10870.  
  10871. sin
  10872. ________________________________________________________________________
  10873.  
  10874. type: function (subr) 
  10875. location: built-in
  10876. source file: xlmath.c
  10877. Common LISP compatible: similar
  10878. supported on: all machines
  10879.  
  10880. SYNTAX
  10881.  
  10882. (sin <expr> )
  10883.     <expr>        -    floating point number/expression
  10884.  
  10885. DESCRIPTION
  10886.  
  10887. The SIN  function  returns  the sine of the  <expr>.  The  <expr>  is in
  10888. radians.
  10889.  
  10890. EXAMPLES
  10891.  
  10892.     (sin 0.0)                ; returns 0
  10893.     (sin .5)                ; returns 0.479426
  10894.     (sin 1.0)                ; returns 0.841471
  10895.     (sin (/ 3.14159 2))            ; returns 1
  10896.     (sin 3.14159)                ; returns 2.65359e-06
  10897.     (sin 0)                    ; error: bad integer operation
  10898.     (sin 1.)                ; error: bad integer operation
  10899.  
  10900. COMMON LISP COMPATABILITY:
  10901. Common LISP allows for integer numbers, which XLISP does not support for
  10902. SIN.
  10903.  
  10904.  
  10905. sort
  10906. ________________________________________________________________________
  10907.  
  10908. type: function (subr) 
  10909. location: built-in
  10910. source file: xllist.c
  10911. Common LISP compatible: similar
  10912. supported on: all machines
  10913.  
  10914. SYNTAX
  10915.  
  10916. (sort <list> <test> )
  10917.     <list>        -    a list containing elements to be sorted
  10918.     <test>        -    the test to use for the sort
  10919.  
  10920. DESCRIPTION
  10921.  
  10922. The SORT  function  sorts the <list> using the <test> to order the list.
  10923. The SORT function is destructive and modifies the <list>.
  10924.  
  10925. EXAMPLES
  10926.  
  10927.     (setq a '(3 1 4 1 5 9 6 7))        ; returns (3 1 4 1 5 9 6 7)
  10928.     (sort a '<)                ; returns (1 1 3 4 5 6 7 9)
  10929.     (print a)                ; returns (1 1 3 4 5 6 7 9)
  10930.                         ; notice that A is modified
  10931.     (sort a '> )                ; returns (9 7 6 5 4 3 1 1)
  10932.  
  10933.     (sort '("a" "bar" "foo") 'string> )    ; returns ("foo" "bar" "a")
  10934.  
  10935. BUG:
  10936. XLISP returns the proper  value, but  improperly  modifies the symbol or
  10937. actual <list>.
  10938.  
  10939. COMMON LISP COMPATABILITY:
  10940. Common LISP allows for a :KEY keyword (which allows a specified function
  10941. to be run  before  the  ordering  takes  place),  which  XLISP  does not
  10942. support.
  10943.  
  10944.  
  10945. sqrt
  10946. ________________________________________________________________________
  10947.  
  10948. type: function (subr) 
  10949. location: built-in
  10950. source file: xlmath.c
  10951. Common LISP compatible: similar
  10952. supported on: all machines
  10953.  
  10954. SYNTAX
  10955.  
  10956. (sqrt <expr> )
  10957.     <expr>        -    floating point number/expression
  10958.  
  10959. DESCRIPTION
  10960.  
  10961. The SQRT function  calculates the square root of <expr> and returns this
  10962. result.
  10963.  
  10964. EXAMPLES
  10965.  
  10966.     (sqrt 1.0)                ; returns 1
  10967.     (sqrt 2.0)                ; returns 1.41421
  10968.     (sqrt 3.0)                ; returns 1.73205
  10969.     (sqrt 4.0)                ; returns 2
  10970.     (sqrt 5.0)                ; returns 2.23607
  10971.     (sqrt -1.0)                ; error: sqrt of a neg. number 
  10972.     (sqrt 2)                ; error: bad integer operation
  10973.  
  10974. COMMON LISP COMPATABILITY:
  10975. Common LISP allows for integer numbers, which XLISP does not support for
  10976. SQRT.
  10977.  
  10978.  
  10979. *standard-input*
  10980. ________________________________________________________________________
  10981.  
  10982. type: system variable 
  10983. location: built-in
  10984. source file: xlinit.c 
  10985. Common LISP compatible: yes
  10986. supported on: all machines
  10987.  
  10988. SYNTAX
  10989.  
  10990. *standard-input*
  10991.  
  10992.  
  10993. DESCRIPTION
  10994.  
  10995. *STANDARD-INPUT*  is a system variable that contains a file pointer that
  10996. points to the file where all normal  input from the  programmer  or user
  10997. comes  from.  The  default  file  for  *STANDARD-INPUT*  is  the  system
  10998. standard input device - normally the system keyboard.
  10999.  
  11000. EXAMPLES
  11001.     *standard-input*            ; returns #<File-Stream: #2442e>
  11002.  
  11003. NOTE:
  11004. Be careful when modifying the  *STANDARD-INPUT*.  If you do not save the
  11005. old file pointer, you will not be able to return to normal operation and
  11006. will  need to exit  XLISP.  If the  file or  source  that you  have  set
  11007. *STANDARD-INPUT*  to does not  reset  *STANDARD-INPUT*  to its  previous
  11008. value, you will never get control back to the keyboard.
  11009.  
  11010.  
  11011. *standard-output*
  11012. ________________________________________________________________________
  11013.  
  11014. type: system variable 
  11015. location: built-in
  11016. source file: xlinit.c
  11017. Common LISP compatible: yes
  11018. supported on: all machines
  11019.  
  11020. SYNTAX
  11021.  
  11022. *standard-output*
  11023.  
  11024.  
  11025. DESCRIPTION
  11026.  
  11027. *STANDARD-OUTPUT* is a system variable that contains a file pointer that
  11028. points to the file where all normal  printing  and  messages  from XLISP
  11029. will go.  The default file for  *STANDARD-OUTPUT* is the system standard
  11030. output device - normally the screen display/crt.
  11031.  
  11032. EXAMPLES
  11033.     *standard-output*            ; returns #<File-Stream: #24406>
  11034.     (setq old-so *standard-output*)        ; save the file pointer
  11035.     (setq fp (open "f" :direction :output))    ; open a new output file
  11036.     (setq *standard-output* fp)        ; change where output goes
  11037.                         ;
  11038.     (+ 2 2)                    ; you won't see any messages
  11039.                         ; just the echo of input line
  11040.                         ;
  11041.     (setq *standard-output* old-so)        ; restore standard output
  11042.     (close fp)                ; close file
  11043.  
  11044. NOTE:
  11045. Be careful when modifying the *STANDARD-OUTPUT*, you will not be able to
  11046. see what you are  doing.  If you do not save the old file  pointer,  you
  11047. will not be able to return to  normal  operation  and will  need to exit
  11048. XLISP.
  11049.  
  11050.  
  11051. strcat
  11052. ________________________________________________________________________
  11053.  
  11054. type: function (subr) 
  11055. location: built-in
  11056. source file: xlstr.c
  11057. Common LISP compatible: no
  11058. supported on: all machines
  11059.  
  11060. SYNTAX
  11061.  
  11062. (strcat [ <string1> ... ] )
  11063.     <stringN>    -    a string expression
  11064.  
  11065. DESCRIPTION
  11066.  
  11067. The STRCAT function  returns the  concatenation  of a sequence of string
  11068. expressions.  If there are no strings, an empty string is returned.
  11069.  
  11070. EXAMPLES
  11071.  
  11072.     (strcat)                ; returns ""
  11073.     (strcat "a")                ; returns "a"
  11074.     (strcat "a" "b")            ; returns "ab"
  11075.     (strcat "ab" "cd" "ef")            ; returns "abcdef"
  11076.     (strcat "f" "ire tr" "uck")        ; returns "fire truck"
  11077.     (strcat 1 2)                ; error: bad argument type
  11078.  
  11079.  
  11080. streamp
  11081. ________________________________________________________________________
  11082.  
  11083. type: predicate function (subr)
  11084. location: built-in
  11085. source file: xlbfun.c
  11086. Common LISP compatible: yes
  11087. supported on: all machines
  11088.  
  11089. SYNTAX
  11090.  
  11091. (streamp <expr> )
  11092.     <expr>        -    the expression to check
  11093.  
  11094. DESCRIPTION
  11095.  
  11096. The STREAMP predicate checks if an <expr> is a stream.  T is returned if
  11097. <expr> is a stream, NIL is returned otherwise.
  11098.  
  11099. EXAMPLES
  11100.  
  11101.     (streamp *standard-input*)        ; returns T - stream
  11102.     (streamp *debug-io*)            ; returns T - stream
  11103.     (streamp (make-string-output-stream))    ; returns T - stream
  11104.     (setq a *standard-output*)        ;
  11105.     (streamp a)                ; returns T - evaluates to stream
  11106.  
  11107.     (streamp "a")                ; returns NIL - string
  11108.     (streamp #\a)                ; returns NIL - character
  11109.     (streamp '(a b c))            ; returns NIL - list
  11110.     (streamp 1)                ; returns NIL - integer
  11111.     (streamp 1.2)                ; returns NIL - float
  11112.     (streamp '*debug-io*)            ; returns NIL - symbol
  11113.     (streamp 'a)                ; returns NIL - symbol
  11114.     (streamp #(0 1 2))            ; returns NIL - array 
  11115.     (streamp NIL)                ; returns NIL - NIL
  11116.  
  11117.  
  11118. string
  11119. ________________________________________________________________________
  11120.  
  11121. type: function (subr) 
  11122. location: built-in
  11123. source file: xlstr.c
  11124. Common LISP compatible: yes
  11125. supported on: all machines
  11126.  
  11127. SYNTAX
  11128.  
  11129. (string <expr> )
  11130.     <expr>        -    a string, symbol or character expression
  11131.  
  11132. DESCRIPTION
  11133.  
  11134. The STRING function  forces the <expr> to be a string.  If the <expr> is
  11135. a  string,  it is  returned,  as is.  If the  <expr> is a  character,  a
  11136. one-character string is returned.  If the <expr> is a symbol, the symbol
  11137. is turned into a string.
  11138.  
  11139.  
  11140. EXAMPLES
  11141.  
  11142.     (string 'foo)                ; returns "FOO"
  11143.     (string 'x)                ; returns "X"
  11144.     (string "abcdef")            ; returns "abcdef"    
  11145.     (string #\a)                ; returns "a"
  11146.     (string #\A)                ; returns "A"
  11147.     (string #\Newline)            ; returns "\n"
  11148.  
  11149.  
  11150. string/=
  11151. ________________________________________________________________________
  11152.  
  11153. type: function (subr) 
  11154. location: built-in
  11155. source file: xlstr.c
  11156. Common LISP compatible: yes
  11157. supported on: all machines
  11158.  
  11159. SYNTAX
  11160.  
  11161. (string/= <string1> <string2> [ <key> <offset> ] ... )
  11162.     <string1>    -    a string expression
  11163.     <string2>    -    a string expression
  11164.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11165.     <offset>    -    an optional integer expression (for a keyword)
  11166.  
  11167. DESCRIPTION
  11168.  
  11169. The STRING/=  (string-NOT-EQUAL) function takes two string arguments.  A
  11170. non-NIL  value is  returned  if  <string1>  is not  equal to  <string2>,
  11171. otherwise  NIL is returned.  The non-NIL  value  returned is the integer
  11172. index  of  the  first   character  of  <string1>  which  is  CHAR/=  the
  11173. corresponding character of <string2>.  This test is case sensitive - the
  11174. character #\a is different (and of greater ASCII value) than #\A.
  11175.  
  11176. The keyword  arguments allow for accessing  substrings  within <string1>
  11177. and <string2>.  The keyword  arguments each require the keyword (:START1
  11178. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11179. keyword  first and the  integer  second.  The pairs may be in any order.
  11180. The start  keywords  specify the  starting  offset of the  substring.  A
  11181. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11182. keywords  specify the ending offset of the substring.  A value of 3 ends
  11183. the string after the 3rd character (an offset of 3 characters).
  11184.  
  11185. EXAMPLES
  11186.  
  11187.     (string/= "a" "b")            ; returns 0
  11188.     (string/= "a" "a")            ; returns NIL
  11189.     (string/= "a" "A")            ; returns 0
  11190.     (string/= "A" "a")            ; returns 0
  11191.     (string/= "abc" "abc ")            ; returns 3
  11192.  
  11193.     (string/= "J Smith" "K Smith"         ; strip off the first chars 
  11194.            :start1 1 :start2 1)        ; returns NIL
  11195.     (string/= "abc" "123456789"         ; leave just the first 3 chars 
  11196.            :end2 3 :end1 3)        ; returns 0
  11197.  
  11198. NOTE:
  11199. Be sure that the STRING/=  function is properly  typed in.  The '/' is a
  11200. forward  slash.  It is possible to  mistakenly  type a '\'  (backslash).
  11201. This is especially  easy because the  character  mechanism is '#\a'.  If
  11202. you do use the backslash, no error will be reported because backslash is
  11203. the single escape character and the LISP reader will evaluate 'STRING\='
  11204. as  'STRING='.  No error will be reported,  but the sense of the test is
  11205. reversed.
  11206.  
  11207.  
  11208. string<
  11209. ________________________________________________________________________
  11210.  
  11211. type: function (subr) 
  11212. location: built-in
  11213. source file: xlstr.c
  11214. Common LISP compatible: yes
  11215. supported on: all machines
  11216.  
  11217. SYNTAX
  11218.  
  11219. (string< <string1> <string2> [ <key> <offset> ] ... )
  11220.     <string1>    -    a string expression
  11221.     <string2>    -    a string expression
  11222.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11223.     <offset>    -    an optional integer expression (for a keyword)
  11224.  
  11225. DESCRIPTION
  11226.  
  11227. The STRING<  (string-LESS-THAN)  function takes two string arguments.  A
  11228. non-NIL  value is returned if  <string1>  is less than  <string2>  in an
  11229. ASCII  ordering,  otherwise NIL is returned.  The non-NIL value returned
  11230. is the integer index of the first  character of <string1> which is CHAR<
  11231. the corresponding character of <string2>.  This test is case sensitive -
  11232. the character #\a is different (and of greater ASCII value) than #\A.
  11233.  
  11234. The keyword  arguments allow for accessing  substrings  within <string1>
  11235. and <string2>.  The keyword  arguments each require the keyword (:START1
  11236. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11237. keyword  first and the  integer  second.  The pairs may be in any order.
  11238. The start  keywords  specify the  starting  offset of the  substring.  A
  11239. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11240. keywords  specify the ending offset of the substring.  A value of 3 ends
  11241. the string after the 3rd character (an offset of 3 characters).
  11242.  
  11243. EXAMPLES
  11244.  
  11245.     (string< "a" "b")            ; returns 0
  11246.     (string< "a" "a")            ; returns NIL
  11247.     (string< "a" "A")            ; returns NIL
  11248.     (string< "A" "a")            ; returns 0
  11249.     (string< "abc" "abc ")            ; returns 3
  11250.     (string< "1234567" "1234qrst")        ; returns 4
  11251.  
  11252.     (string< "J Smith" "K Smith"         ; strip off the first chars 
  11253.           :start1 1 :start2 1)        ; returns NIL
  11254.  
  11255.  
  11256. string<=
  11257. ________________________________________________________________________
  11258.  
  11259. type: function (subr) 
  11260. location: built-in
  11261. source file: xlstr.c
  11262. Common LISP compatible: yes
  11263. supported on: all machines
  11264.  
  11265. SYNTAX
  11266.  
  11267. (string<= <string1> <string2> [ <key> <offset> ] ... )
  11268.     <string1>    -    a string expression
  11269.     <string2>    -    a string expression
  11270.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11271.     <offset>    -    an optional integer expression (for a keyword)
  11272.  
  11273. DESCRIPTION
  11274.  
  11275. The  STRING<=  (string-LESS-THAN-OR-EQUAL)  function  takes  two  string
  11276. arguments.  A non-NIL  value is returned  if  <string1>  is less than or
  11277. equal to <string2> in an ASCII ordering, otherwise NIL is returned.  The
  11278. non-NIL  value  returned is the integer index of the first  character of
  11279. <string1>  which is CHAR<= the  corresponding  character  of  <string2>.
  11280. This test is case  sensitive - the  character  #\a is different  (and of
  11281. greater ASCII value) than #\A.
  11282.  
  11283. The keyword  arguments allow for accessing  substrings  within <string1>
  11284. and <string2>.  The keyword  arguments each require the keyword (:START1
  11285. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11286. keyword  first and the  integer  second.  The pairs may be in any order.
  11287. The start  keywords  specify the  starting  offset of the  substring.  A
  11288. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11289. keywords  specify the ending offset of the substring.  A value of 3 ends
  11290. the string after the 3rd character (an offset of 3 characters).
  11291.  
  11292. EXAMPLES
  11293.  
  11294.     (string<= "a" "b")            ; returns 0
  11295.     (string<= "a" "a")            ; returns 1
  11296.     (string<= "a" "A")            ; returns NIL
  11297.     (string<= "A" "a")            ; returns 0
  11298.     (string<= "abc" "abc ")            ; returns 3
  11299.     (string<= "1234567" "1234qrst")        ; returns 4
  11300.  
  11301.     (string<= "J Smith" "K Smith"         ; strip off the first chars 
  11302.           :start1 1 :start2 1)        ; returns 7
  11303.  
  11304.  
  11305. string=
  11306. ________________________________________________________________________
  11307.  
  11308. type: function (subr) 
  11309. location: built-in
  11310. source file: xlstr.c
  11311. Common LISP compatible: yes
  11312. supported on: all machines
  11313.  
  11314. SYNTAX
  11315.  
  11316. (string= <string1> <string2> [ <key> <offset> ] ... )
  11317.     <string1>    -    a string expression
  11318.     <string2>    -    a string expression
  11319.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11320.     <offset>    -    an optional integer expression (for a keyword)
  11321.  
  11322. DESCRIPTION
  11323.  
  11324. The STRING=  (string-EQUALITY)  function takes two string arguments.  It
  11325. checks  to see if the  string  arguments  have  the  same  values.  T is
  11326. returned  if  <string1>  is  equal  to  <string2>.  This  test  is  case
  11327. sensitive - the character #\a is different  (and of greater ASCII value)
  11328. than #\A.
  11329.  
  11330. The keyword  arguments allow for accessing  substrings  within <string1>
  11331. and <string2>.  The keyword  arguments each require the keyword (:START1
  11332. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11333. keyword  first and the  integer  second.  The pairs may be in any order.
  11334. The start  keywords  specify the  starting  offset of the  substring.  A
  11335. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11336. keywords  specify the ending offset of the substring.  A value of 3 ends
  11337. the string after the 3rd character (an offset of 3 characters).
  11338.  
  11339. EXAMPLES
  11340.  
  11341.     (string= "a" "b")            ; returns NIL
  11342.     (string= "a" "a")            ; returns T
  11343.     (string= "a" "A")            ; returns NIL
  11344.     (string= "A" "a")            ; returns NIL
  11345.     (string= "abc" "abc ")            ; returns NIL
  11346.  
  11347.     (string= "J Smith" "K Smith"         ; strip off the first chars 
  11348.            :start1 1 :start2 1)        ; returns T
  11349.     (string= "abc" "123456789"         ; leave just the first 3 chars 
  11350.            :end2 3 :end1 3)        ; returns NIL
  11351.  
  11352.  
  11353. string>
  11354. ________________________________________________________________________
  11355.  
  11356. type: function (subr) 
  11357. location: built-in
  11358. source file: xlstr.c
  11359. Common LISP compatible: yes
  11360. supported on: all machines
  11361.  
  11362. SYNTAX
  11363.  
  11364. (string> <string1> <string2> [ <key> <offset> ] ... )
  11365.     <string1>    -    a string expression
  11366.     <string2>    -    a string expression
  11367.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11368.     <offset>    -    an optional integer expression (for a keyword)
  11369.  
  11370. DESCRIPTION
  11371.  
  11372. The STRING>  (string-GREATER-THAN)  function takes two string arguments.
  11373. A non-NIL value is returned if <string1> is greater than <string2> in an
  11374. ASCII  ordering,  otherwise NIL is returned.  The non-NIL value returned
  11375. is the integer index of the first  character of <string1> which is CHAR>
  11376. the corresponding character of <string2>.  This test is case sensitive -
  11377. the character #\a is different (and of greater ASCII value) than #\A.
  11378.  
  11379. The keyword  arguments allow for accessing  substrings  within <string1>
  11380. and <string2>.  The keyword  arguments each require the keyword (:START1
  11381. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11382. keyword  first and the  integer  second.  The pairs may be in any order.
  11383. The start  keywords  specify the  starting  offset of the  substring.  A
  11384. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11385. keywords  specify the ending offset of the substring.  A value of 3 ends
  11386. the string after the 3rd character (an offset of 3 characters).
  11387.  
  11388. EXAMPLES
  11389.  
  11390.     (string> "a" "b")            ; returns NIL
  11391.     (string> "a" "a")            ; returns NIL
  11392.     (string> "a" "A")            ; returns 0
  11393.     (string> "A" "a")            ; returns NIL
  11394.     (string> "abc" "abc ")            ; returns NIL
  11395.     (string> "1234qrst" "12345678")        ; returns 4
  11396.  
  11397.     (string> "J Smith" "K Jones"         ; strip off the first chars 
  11398.           :start1 1 :start2 1)        ; returns 2
  11399.  
  11400.  
  11401. string>=
  11402. ________________________________________________________________________
  11403.  
  11404. type: function (subr) 
  11405. location: built-in
  11406. source file: xlstr.c
  11407. Common LISP compatible: yes
  11408. supported on: all machines
  11409.  
  11410. SYNTAX
  11411.  
  11412. (string>= <string1> <string2> [ <key> <offset> ] ... )
  11413.     <string1>    -    a string expression
  11414.     <string2>    -    a string expression
  11415.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11416.     <offset>    -    an optional integer expression (for a keyword)
  11417.  
  11418. DESCRIPTION
  11419.  
  11420. The STRING>=  (string-GREATER-THAN-OR-EQUAL)  function  takes two string
  11421. arguments.  A non-NIL  value is returned if <string1> is greater than or
  11422. equal to <string2> in an ASCII ordering, otherwise NIL is returned.  The
  11423. non-NIL  value  returned is the integer index of the first  character of
  11424. <string1>  which is CHAR>= the  corresponding  character  of  <string2>.
  11425. This test is case  sensitive - the  character  #\a is different  (and of
  11426. greater ASCII value) than #\A.
  11427.  
  11428. The keyword  arguments allow for accessing  substrings  within <string1>
  11429. and <string2>.  The keyword  arguments each require the keyword (:START1
  11430. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11431. keyword  first and the  integer  second.  The pairs may be in any order.
  11432. The start  keywords  specify the  starting  offset of the  substring.  A
  11433. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11434. keywords  specify the ending offset of the substring.  A value of 3 ends
  11435. the string after the 3rd character (an offset of 3 characters).
  11436.  
  11437. EXAMPLES
  11438.  
  11439.     (string>= "a" "b")            ; returns NIL
  11440.     (string>= "a" "a")            ; returns 1
  11441.     (string>= "a" "A")            ; returns 0
  11442.     (string>= "A" "a")            ; returns NIL
  11443.     (string>= "abc" "abc ")            ; returns NIL
  11444.     (string>= "1234qrst" "12345678")    ; returns 4
  11445.  
  11446.     (string>= "J Smith" "K Jones"         ; strip off the first chars 
  11447.           :start1 1 :start2 1)        ; returns 2
  11448.  
  11449.  
  11450. stringp
  11451. ________________________________________________________________________
  11452.  
  11453. type: predicate function (subr)
  11454. location: built-in
  11455. source file: xlbfun.c
  11456. Common LISP compatible: yes
  11457. supported on: all machines
  11458.  
  11459. SYNTAX
  11460.  
  11461. (stringp <expr> )
  11462.     <expr>        -    the expression to check
  11463.  
  11464. DESCRIPTION
  11465.  
  11466. The STRINGP predicate checks if an <expr> is a string.  T is returned if
  11467. <expr> is a string, NIL is returned otherwise.
  11468.  
  11469. EXAMPLES
  11470.  
  11471.     (stringp "a")                ; returns T - string
  11472.     (setq a "hi there"            ; 
  11473.     (stringp a)                ; returns T - evaluates to string
  11474.  
  11475.     (stringp #\a)                ; returns NIL - character
  11476.     (stringp '(a b c))            ; returns NIL - list
  11477.     (stringp 1)                ; returns NIL - integer
  11478.     (stringp 1.2)                ; returns NIL - float
  11479.     (stringp 'a)                ; returns NIL - symbol
  11480.     (stringp #(0 1 2))            ; returns NIL - array 
  11481.     (stringp NIL)                ; returns NIL - NIL
  11482.  
  11483.  
  11484. string-downcase
  11485. ________________________________________________________________________
  11486.  
  11487. type: function (subr) 
  11488. location: built-in
  11489. source file: xlstr.c
  11490. Common LISP compatible: yes
  11491. supported on: all machines
  11492.  
  11493. SYNTAX
  11494.  
  11495. (string-downcase <string> [ { :start | :end } <offset> ] ... )
  11496.     <string>    -    a string expression
  11497.     <offset>    -    an optional integer expression (for a keyword)
  11498.  
  11499. DESCRIPTION
  11500.  
  11501. The  STRING-DOWNCASE  function takes a string argument and returns a new
  11502. string that has been made lower case.
  11503.  
  11504. The keyword  arguments allow for accessing  substrings  within <string>.
  11505. The  keyword  arguments  require a keyword  (:START or :END) first and a
  11506. single  integer  expression  second.  The :START  keyword  specifies the
  11507. starting offset for the STRING-DOWNCASE  operation on <string>.  A value
  11508. of 0 starts the string at the  beginning  (no offset).  The :END keyword
  11509. specifies the end offset for the operation on <string>.
  11510.  
  11511. EXAMPLES
  11512.  
  11513.     (string-downcase "ABcd+-12&[")        ; returns "abcd+-&["
  11514.     (string-downcase "ABCDEFGH"         ;
  11515.              :start 2 :end 4)    ; returns "ABcdEFGH"
  11516.  
  11517.     (setq mystr "ABcdEFgh")            ; set up variable
  11518.     (string-downcase mystr)            ; returns "abcdefgh"
  11519.     (print mystr)                ; prints  "ABcdEFgh"
  11520.  
  11521.  
  11522. string-equal
  11523. ________________________________________________________________________
  11524.  
  11525. type: function (subr) 
  11526. location: built-in
  11527. source file: xlstr.c
  11528. Common LISP compatible: yes
  11529. supported on: all machines
  11530.  
  11531. SYNTAX
  11532.  
  11533. (string-equal <string1> <string2> [ <key> <offset> ] ... )
  11534.     <string1>    -    a string expression
  11535.     <string2>    -    a string expression
  11536.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11537.     <offset>    -    an optional integer expression (for a keyword)
  11538.  
  11539. DESCRIPTION
  11540.  
  11541. The STRING-EQUAL  function takes two string arguments.  It checks to see
  11542. if  the  string  arguments  have  the  same  values.  T is  returned  if
  11543. <string1> is equal to <string2>.  This test is not case  sensitive - the
  11544. character #\a is considered to be the same as #\A.
  11545.  
  11546. The keyword  arguments allow for accessing  substrings  within <string1>
  11547. and <string2>.  The keyword  arguments each require the keyword (:START1
  11548. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11549. keyword  first and the  integer  second.  The pairs may be in any order.
  11550. The start  keywords  specify the  starting  offset of the  substring.  A
  11551. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11552. keywords  specify the ending offset of the substring.  A value of 3 ends
  11553. the string after the 3rd character (an offset of 3 characters).
  11554.  
  11555. EXAMPLES
  11556.  
  11557.     (string-equal "a" "b")            ; returns NIL
  11558.     (string-equal "a" "a")            ; returns T
  11559.     (string-equal "a" "A")            ; returns T
  11560.     (string-equal "A" "a")            ; returns T
  11561.     (string-equal "abc" "abc ")        ; returns NIL
  11562.  
  11563.     (string-equal "J Smith" "K Smith"     ; strip off the first chars 
  11564.            :start1 1 :start2 1)        ; returns T
  11565.     (string-equal "abc" "123456789"     ; leave just the first 3 chars 
  11566.            :end2 3 :end1 3)        ; returns NIL
  11567.  
  11568. NOTE:
  11569. The STRING-EQUAL function is listed in the documentation that comes with
  11570. XLISP as  STRING-EQUALP.  It  functions  properly  in the XLISP  code as
  11571. STRING-EQUAL.
  11572.  
  11573.  
  11574. string-greaterp
  11575. ________________________________________________________________________
  11576.  
  11577. type: predicate function (subr) 
  11578. location: built-in
  11579. source file: xlstr.c
  11580. Common LISP compatible: yes
  11581. supported on: all machines
  11582.  
  11583. SYNTAX
  11584.  
  11585. (string-greaterp <string1> <string2> [ <key> <offset> ] ... )
  11586.     <string1>    -    a string expression
  11587.     <string2>    -    a string expression
  11588.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11589.     <offset>    -    an optional integer expression (for a keyword)
  11590.  
  11591. DESCRIPTION
  11592.  
  11593. The  STRING-GREATERP  function  takes two  string  arguments.  A non-NIL
  11594. value is returned if  <string1>  is greater than  <string2>  in an ASCII
  11595. ordering,  otherwise NIL is returned.  The non-NIL value returned is the
  11596. integer index of the first character of <string1> which is CHAR-GREATERP
  11597. the  corresponding  character  of  <string2>.  This  test  is  not  case
  11598. sensitive - the character #\a is considered to be the same as #\A.
  11599.  
  11600. The keyword  arguments allow for accessing  substrings  within <string1>
  11601. and <string2>.  The keyword  arguments each require the keyword (:START1
  11602. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11603. keyword  first and the  integer  second.  The pairs may be in any order.
  11604. The start  keywords  specify the  starting  offset of the  substring.  A
  11605. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11606. keywords  specify the ending offset of the substring.  A value of 3 ends
  11607. the string after the 3rd character (an offset of 3 characters).
  11608.  
  11609. EXAMPLES
  11610.  
  11611.     (string-greaterp "a" "b")        ; returns NIL
  11612.     (string-greaterp "a" "a")        ; returns NIL
  11613.     (string-greaterp "a" "A")        ; returns NIL
  11614.     (string-greaterp "A" "a")        ; returns NIL
  11615.     (string-greaterp "abc" "abc ")        ; returns NIL
  11616.     (string-greaterp "1234qrst" "12345678")    ; returns 4
  11617.  
  11618.     (string-greaterp "J Smith" "K Jones"     ; strip off the first chars 
  11619.           :start1 1 :start2 1)        ; returns 2
  11620.  
  11621.  
  11622. string-left-trim
  11623. ________________________________________________________________________
  11624.  
  11625. type: function (subr) 
  11626. location: built-in
  11627. source file: xlstr.c
  11628. Common LISP compatible: similar
  11629. supported on: all machines
  11630.  
  11631. SYNTAX
  11632.  
  11633. (string-left-trim <trim-stuff> <string> )
  11634.     <trim-stuff>    -    a string expression
  11635.     <string>    -    a string expression
  11636.  
  11637. DESCRIPTION
  11638.  
  11639. The  STRING-LEFT-TRIM  function  takes the  <trim-stuff>  characters and
  11640. removes  them  from  the  left  end of the  <string>.  The  <trim-stuff>
  11641. characters  are an  un-ordered  set of characters to be removed - so any
  11642. character that occurs in  <trim-stuff>  is removed if it appears in left
  11643. portion of <string>.  A new string is created and returned as the result
  11644. of this function.
  11645.  
  11646. EXAMPLES
  11647.  
  11648.     (string-left-trim "." "....foo....")    ; returns "foo...."
  11649.     (string-left-trim "<>" "<<<<bar>>>>")    ; returns "bar>>>>"
  11650.     (string-left-trim "(.)" "..(12.34)..")    ; returns "12.34).."
  11651.  
  11652. COMMON LISP COMPATABILITY:
  11653. Common LISP also  supports a list of characters as a valid  <trim-stuff>
  11654. argument.  An  example  of  this  is:  (STRING-TRIM  '(#\Tab  #\Newline)
  11655. mystring).  XLISP does not support this  non-string  parameter.  Porting
  11656. from XLISP will be no problem,  but  modifications  will be necessary if
  11657. porting from Common LISP code which uses a list of characters.
  11658.  
  11659.  
  11660. string-lessp
  11661. ________________________________________________________________________
  11662.  
  11663. type: predicate function (subr) 
  11664. location: built-in
  11665. source file: xlstr.c
  11666. Common LISP compatible: yes
  11667. supported on: all machines
  11668.  
  11669. SYNTAX
  11670.  
  11671. (string-lessp <string1> <string2> [ <key> <offset> ] ... )
  11672.     <string1>    -    a string expression
  11673.     <string2>    -    a string expression
  11674.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11675.     <offset>    -    an optional integer expression (for a keyword)
  11676.  
  11677. DESCRIPTION
  11678.  
  11679. The STRING-LESSP  function takes two string  arguments.  A non-NIL value
  11680. is returned if  <string1> is less than  <string2> in an ASCII  ordering,
  11681. otherwise  NIL is returned.  The non-NIL  value  returned is the integer
  11682. index of the  first  character  of  <string1>  which is  CHAR-LESSP  the
  11683. corresponding character of <string2>.  This test is not case sensitive -
  11684. the character #\a is considered to be the same as #\A.
  11685.  
  11686. The keyword  arguments allow for accessing  substrings  within <string1>
  11687. and <string2>.  The keyword  arguments each require the keyword (:START1
  11688. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11689. keyword  first and the  integer  second.  The pairs may be in any order.
  11690. The start  keywords  specify the  starting  offset of the  substring.  A
  11691. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11692. keywords  specify the ending offset of the substring.  A value of 3 ends
  11693. the string after the 3rd character (an offset of 3 characters).
  11694.  
  11695. EXAMPLES
  11696.  
  11697.     (string-lessp "a" "b")            ; returns 0
  11698.     (string-lessp "a" "a")            ; returns NIL
  11699.     (string-lessp "a" "A")            ; returns NIL
  11700.     (string-lessp "A" "a")            ; returns NIL
  11701.     (string-lessp "abc" "abc ")        ; returns 3
  11702.     (string-lessp "1234567" "1234qrst")    ; returns 4
  11703.  
  11704.     (string-lessp "J Smith" "K Smith"     ; strip off the first chars 
  11705.           :start1 1 :start2 1)        ; returns NIL
  11706.  
  11707.  
  11708. string-not-equal
  11709. ________________________________________________________________________
  11710.  
  11711. type: function (subr) 
  11712. location: built-in
  11713. source file: xlstr.c
  11714. Common LISP compatible: yes
  11715. supported on: all machines
  11716.  
  11717. SYNTAX
  11718.  
  11719. (string-not-equal <string1> <string2> [ <key> <offset> ] ... )
  11720.     <string1>    -    a string expression
  11721.     <string2>    -    a string expression
  11722.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11723.     <offset>    -    an optional integer expression (for a keyword)
  11724.  
  11725. DESCRIPTION
  11726.  
  11727. The  STRING-NOT-EQUAL  function  takes two string  arguments.  A non-NIL
  11728. value is returned if <string1> is not equal to <string2>,  otherwise NIL
  11729. is  returned.  The non-NIL  value  returned is the integer  index of the
  11730. first character of <string1> which is CHAR-NOT-EQUAL  the  corresponding
  11731. character of <string2>.  This test is not case sensitive - the character
  11732. #\a is considered to be the same as #\A.
  11733.  
  11734. The keyword  arguments allow for accessing  substrings  within <string1>
  11735. and <string2>.  The keyword  arguments each require the keyword (:START1
  11736. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11737. keyword  first and the  integer  second.  The pairs may be in any order.
  11738. The start  keywords  specify the  starting  offset of the  substring.  A
  11739. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11740. keywords  specify the ending offset of the substring.  A value of 3 ends
  11741. the string after the 3rd character (an offset of 3 characters).
  11742.  
  11743. EXAMPLES
  11744.  
  11745.     (string-not-equal "a" "b")        ; returns 0
  11746.     (string-not-equal "a" "a")        ; returns NIL
  11747.     (string-not-equal "a" "A")        ; returns NIL
  11748.     (string-not-equal "A" "a")        ; returns NIL
  11749.     (string-not-equal "abc" "abc ")        ; returns 3
  11750.  
  11751.     (string-not-equal "J Smith" "K Smith"     ; strip off the first chars 
  11752.            :start1 1 :start2 1)        ; returns NIL
  11753.     (string-not-equal "abc" "123456789"     ; leave just the first 3 chars 
  11754.            :end2 3 :end1 3)        ; returns 0
  11755.  
  11756. NOTE:
  11757. The STRING-NOT-EQUAL  function is listed in the documentation that comes
  11758. with XLISP as  STRING-NOT-EQUALP.  It  functions  properly  in the XLISP
  11759. code as STRING-NOT-EQUAL.
  11760.  
  11761.  
  11762. string-not-greaterp
  11763. ________________________________________________________________________
  11764.  
  11765. type: predicate function (subr) 
  11766. location: built-in
  11767. source file: xlstr.c
  11768. Common LISP compatible: yes
  11769. supported on: all machines
  11770.  
  11771. SYNTAX
  11772.  
  11773. (string-not-greaterp <string1> <string2> [ <key> <offset> ] ... )
  11774.     <string1>    -    a string expression
  11775.     <string2>    -    a string expression
  11776.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11777.     <offset>    -    an optional integer expression (for a keyword)
  11778.  
  11779. DESCRIPTION
  11780.  
  11781. The STRING-NOT-GREATERP  function takes two string arguments.  A non-NIL
  11782. value is returned if <string1> is less than or equal to <string2>  in an
  11783. ASCII  ordering,  otherwise NIL is returned.  The non-NIL value returned
  11784. is the  integer  index of the  first  character  of  <string1>  which is
  11785. CHAR-NOT-GREATERP  the corresponding  character of <string2>.  This test
  11786. is not case  sensitive - the  character #\a is considered to be the same
  11787. as #\A.
  11788.  
  11789. The keyword  arguments allow for accessing  substrings  within <string1>
  11790. and <string2>.  The keyword  arguments each require the keyword (:START1
  11791. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11792. keyword  first and the  integer  second.  The pairs may be in any order.
  11793. The start  keywords  specify the  starting  offset of the  substring.  A
  11794. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11795. keywords  specify the ending offset of the substring.  A value of 3 ends
  11796. the string after the 3rd character (an offset of 3 characters).
  11797.  
  11798. EXAMPLES
  11799.  
  11800.     (string-not-greaterp "a" "b")        ; returns 0
  11801.     (string-not-greaterp "b" "a")        ; returns NIL
  11802.     (string-not-greaterp "a" "a")        ; returns 1
  11803.     (string-not-greaterp "a" "A")        ; returns 1
  11804.     (string-not-greaterp "A" "a")        ; returns 1
  11805.     (string-not-greaterp "abc" "abc ")    ; returns 3
  11806.     (string-not-greaterp "12345" "1234qr")    ; returns 4
  11807.  
  11808.     (string-not-greaterp "J Smith" "K Smith"; strip off the first chars 
  11809.           :start1 1 :start2 1)        ; returns 7
  11810.  
  11811.  
  11812. string-not-lessp
  11813. ________________________________________________________________________
  11814.  
  11815. type: predicate function (subr) 
  11816. location: built-in
  11817. source file: xlstr.c
  11818. Common LISP compatible: yes
  11819. supported on: all machines
  11820.  
  11821. SYNTAX
  11822.  
  11823. (string-not-lessp <string1> <string2> [ <key> <offset> ] ... )
  11824.     <string1>    -    a string expression
  11825.     <string2>    -    a string expression
  11826.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11827.     <offset>    -    an optional integer expression (for a keyword)
  11828.  
  11829. DESCRIPTION
  11830.  
  11831. The  STRING-NOT-LESSP  function  takes two string  arguments.  A non-NIL
  11832. value is returned if <string1> is greater than or equal to  <string2> in
  11833. an  ASCII  ordering,  otherwise  NIL  is  returned.  The  non-NIL  value
  11834. returned is the integer index of the first character of <string1>  which
  11835. is CHAR-NOT-LESSP  the corresponding  character of <string2>.  This test
  11836. is not case  sensitive - the  character #\a is considered to be the same
  11837. as #\A.
  11838.  
  11839. The keyword  arguments allow for accessing  substrings  within <string1>
  11840. and <string2>.  The keyword  arguments each require the keyword (:START1
  11841. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11842. keyword  first and the  integer  second.  The pairs may be in any order.
  11843. The start  keywords  specify the  starting  offset of the  substring.  A
  11844. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11845. keywords  specify the ending offset of the substring.  A value of 3 ends
  11846. the string after the 3rd character (an offset of 3 characters).
  11847.  
  11848. EXAMPLES
  11849.  
  11850.     (string-not-lessp "a" "b")        ; returns NIL
  11851.     (string-not-lessp "a" "a")        ; returns 1
  11852.     (string-not-lessp "a" "A")        ; returns 1
  11853.     (string-not-lessp "A" "a")        ; returns 1
  11854.     (string-not-lessp "abc" "abc ")        ; returns NIL
  11855.     (string-not-lessp "1234qr" "123456")    ; returns 4
  11856.  
  11857.     (string-not-lessp "J Smith" "K Jones"     ; strip off the first chars 
  11858.           :start1 1 :start2 1)        ; returns 2
  11859.  
  11860.  
  11861. string-right-trim
  11862. ________________________________________________________________________
  11863.  
  11864. type: function (subr) 
  11865. location: built-in
  11866. source file: xlstr.c
  11867. Common LISP compatible: similar
  11868. supported on: all machines
  11869.  
  11870. SYNTAX
  11871.  
  11872. (string-right-trim <trim-stuff> <string> )
  11873.     <trim-stuff>    -    a string expression
  11874.     <string>    -    a string expression
  11875.  
  11876. DESCRIPTION
  11877.  
  11878. The  STRING-RIGHT-TRIM  function takes the  <trim-stuff>  characters and
  11879. removes  them  from the  right  end of the  <string>.  The  <trim-stuff>
  11880. characters  are an  un-ordered  set of characters to be removed - so any
  11881. character that occurs in  <trim-stuff> is removed if it appears in right
  11882. portion of <string>.  A new string is created and returned as the result
  11883. of this function.
  11884.  
  11885. EXAMPLES
  11886.  
  11887.     (string-right-trim "." "....foo....")    ; returns "....foo"
  11888.     (string-right-trim "<>" "<<<<bar>>>>")    ; returns "<<<<bar"
  11889.     (string-right-trim "(.)" "..(12.34)..")    ; returns "..(12.34"
  11890.  
  11891. COMMON LISP COMPATABILITY:
  11892. Common LISP also  supports a list of characters as a valid  <trim-stuff>
  11893. argument.  An  example  of  this  is:  (STRING-TRIM  '(#\Tab  #\Newline)
  11894. mystring).  XLISP does not support this  non-string  parameter.  Porting
  11895. from XLISP will be no problem,  but  modifications  will be necessary if
  11896. porting from Common LISP code which uses a list of characters.
  11897.  
  11898.  
  11899. string-trim
  11900. ________________________________________________________________________
  11901.  
  11902. type: function (subr) 
  11903. location: built-in
  11904. source file: xlstr.c
  11905. Common LISP compatible: similar
  11906. supported on: all machines
  11907.  
  11908. SYNTAX
  11909.  
  11910. (string-trim <trim-stuff> <string> )
  11911.     <trim-stuff>    -    a string expression
  11912.     <string>    -    a string expression
  11913.  
  11914. DESCRIPTION
  11915.  
  11916. The STRING-TRIM  function takes the <trim-stuff>  characters and removes
  11917. them from both ends of the <string>.  The <trim-stuff> characters are an
  11918. un-ordered  set of  characters  to be  removed - so any  character  that
  11919. occurs in  <trim-stuff>  is  removed if it appears  in  <string>.  A new
  11920. string is created and returned as the result of this function.
  11921.  
  11922. EXAMPLES
  11923.  
  11924.     (string-trim "." "....foo....")        ; returns "foo"
  11925.     (string-trim "<>" "<<<<bar>>>>")    ; returns "bar"
  11926.     (string-trim "(.)" "..(12.34)..")    ; returns "12.34"
  11927.  
  11928. COMMON LISP COMPATABILITY:
  11929. Common LISP also  supports a list of characters as a valid  <trim-stuff>
  11930. argument.  An  example  of  this  is:  (STRING-TRIM  '(#\Tab  #\Newline)
  11931. mystring).  XLISP does not support this  non-string  parameter.  Porting
  11932. from XLISP will be no problem,  but  modifications  will be necessary if
  11933. porting from Common LISP code which uses a list of characters.
  11934.  
  11935.  
  11936. string-upcase
  11937. ________________________________________________________________________
  11938.  
  11939. type: function (subr) 
  11940. location: built-in
  11941. source file: xlstr.c
  11942. Common LISP compatible: yes
  11943. supported on: all machines
  11944.  
  11945. SYNTAX
  11946.  
  11947. (string-upcase <string> [ { :start | :end } <offset> ] ... )
  11948.     <string>    -    a string expression
  11949.     <offset>    -    an optional integer expression (for a keyword)
  11950.  
  11951. DESCRIPTION
  11952.  
  11953. The  STRING-UPCASE  function  takes a string  argument and returns a new
  11954. string that has been made upper case.
  11955.  
  11956. The keyword  arguments allow for accessing  substrings  within <string>.
  11957. The  keyword  arguments  require a keyword  (:START or :END) first and a
  11958. single  integer  expression  second.  The :START  keyword  specifies the
  11959. starting offset for the STRING-UPCASE operation on <string>.  A value of
  11960. 0 starts  the string at the  beginning  (no  offset).  The :END  keyword
  11961. specifies the end offset for the operation on <string>.
  11962.  
  11963. EXAMPLES
  11964.  
  11965.     (string-upcase "ABcd+-12&[")        ; returns "ABCD+-&["
  11966.     (string-upcase "abcdefgh"         ;
  11967.              :start 2 :end 4)    ; returns "abCDefgh"
  11968.  
  11969.     (setq mystr "ABcdEFgh")            ; set up variable
  11970.     (string-upcase mystr)            ; returns "ABCDEFGH"
  11971.     (print mystr)                ; prints  "ABcdEFgh"
  11972.  
  11973.  
  11974. sublis
  11975. ________________________________________________________________________
  11976.  
  11977. type: function (subr) 
  11978. location: built-in
  11979. source file: xllist.c
  11980. Common LISP compatible: similar
  11981. supported on: all machines
  11982.  
  11983. SYNTAX
  11984.  
  11985. (sublis <a-list> <expr> [ { :test | :test-not } <test> ] )
  11986.     <expr>        -    the expression to substitute within - an atom 
  11987.                 or list
  11988.     <a-list>    -    the association list to search
  11989.     <test>        -    optional test function (default is EQL)
  11990.  
  11991. DESCRIPTION
  11992.  
  11993. SUBLIS  searches  through an <expr> and replaces each of the elements in
  11994. the <expr> that match the CAR of the  elements of the  association  list
  11995. <a-list>  with the CDR of elements of the <a-list>.  The <expr> with the
  11996. substitutions  (if any) is returned.  You may specify your own test with
  11997. the  :TEST and  :TEST-NOT  keywords  followed  by the test you  which to
  11998. perform.  The SUBLIS  function is normally  used with a dotted pair (A .
  11999. B) association  list.  It is possible to use a normal list pair (A B) or
  12000. a list of the form (A (B C)).
  12001.  
  12002. EXAMPLES
  12003.  
  12004.     (sublis '( (a . b))   '(a a))        ; returns (B B)
  12005.     (sublis '( (a b))     '(a a))        ; returns ((B) (B))
  12006.     (sublis '( (a (b c))) '(a a))        ; returns (((B C)) ((B C)))
  12007.  
  12008.     (setq newlist '( (a . 1)         ; set up an association list
  12009.              (b . 2)         ;
  12010.              (c . 3) ))        ;
  12011.     (sublis newlist '(a b c d e f b a c))    ; returns (1 2 3 D E F 2 1 3)
  12012.     (sublis newlist 'a)            ; returns 1
  12013.  
  12014.     (setq mylist '((a my-a) (b his-b)     ; set up a non-dotted pair
  12015.                (c her-c) (d end)))    ;   assoc list
  12016.     (sublis mylist '(a b c d e f g))    ; returns ((MY-A) (HIS-B) 
  12017.                         ;          (HER-C) (END) E F G)
  12018.     (sublis mylist 'a)            ; returns (MY-A)
  12019.  
  12020.     (setq numlist '((1 . a) (2 . b)) )    ; set up a new assoc list
  12021.     (defun mytest (x y) (princ ": ")     ; set up my own test function
  12022.                 (princ x)         ;   with 2 parameters
  12023.                 (princ " ")     ;   to see what SUBLIS does
  12024.                 (princ y) (terpri)    ;
  12025.                 T)            ;   always return TRUE
  12026.     (sublis numlist '(3 1) :test mytest)    ; prints     : (3 1) 1
  12027.                         ;   returns A
  12028.                         ;   because the entire list
  12029.                         ;   succeeds with the test
  12030.                         ;   and so (1 . A) produces
  12031.                         ;   the returned value
  12032.     (sublis numlist '(1) :test-not mytest)    ; prints     : (1) 1
  12033.                         ;        : (1) 2
  12034.                         ;        : 1 1
  12035.                         ;        : 1 2
  12036.                         ;        : NIL 1
  12037.                         ;        : NIL 2
  12038.                         ;   returns (1)
  12039.                         ;   because SUBLIS tried to
  12040.                         ;   match every list/sublist
  12041.                         ;   against each entry in the
  12042.                         ;   assoc. list and failed
  12043.                         ;   because of the :TEST-NOT
  12044.                         ;   and so returned the 
  12045.                         ;   original list unaltered
  12046.  
  12047. NOTE:
  12048. The  SUBLIS  function  can work  with a list or  string  as the  <expr>.
  12049. However, the default EQL test does not work with lists or strings,  only
  12050. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  12051. keyword along with EQUAL for <test>.
  12052.  
  12053. COMMON LISP COMPATABILITY:
  12054. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  12055. function  that is  applied  to each  element  of  <a-list>  before it is
  12056. tested.  XLISP does not support this.
  12057.  
  12058.  
  12059. subseq
  12060. ________________________________________________________________________
  12061.  
  12062. type: function (subr) 
  12063. location: built-in
  12064. source file: xlstr.c
  12065. Common LISP compatible: similar
  12066. supported on: all machines
  12067.  
  12068. SYNTAX
  12069.  
  12070. (subseq <string> <start> [ <end> ] )
  12071.     <string>    -    a string expression
  12072.     <start>        -    an integer expression
  12073.     <end>        -    an integer expression
  12074.  
  12075. DESCRIPTION
  12076.  
  12077. The SUBSEQ function extracts a substring from <string> starting with the
  12078. <start> offset and ending with the <end> offset.  The <start> offset has
  12079. a origin or 0.  The substring is returned.
  12080.  
  12081. EXAMPLES
  12082.  
  12083.     (subseq "12345678" 0)            ; returns "12345678"
  12084.     (subseq "12345678" 2)            ; returns "345678"
  12085.     (subseq "12345678" 2 4)            ; returns "34"
  12086.     (subseq "1234" 3)            ; returns "4"
  12087.  
  12088.     (subseq "1234" 4)            ; returns ""
  12089.     (subseq "1234" 4 2)            ; returns ""
  12090.     (subseq "1234" 5)            ; error: string index out of 
  12091.                         ;      bounds - 5
  12092.  
  12093. COMMON LISP COMPATABILITY:
  12094. The SUBSEQ in Common LISP is intended  to return a portion of a sequence
  12095. -  a   SUBSEQuence.  This   function   operates  on  lists  and  vectors
  12096. (one-dimensional  arrays of data) - basically ordered data.  Strings are
  12097. just one of the valid types  operated on by SUBSEQ in Common  LISP.  The
  12098. XLISP SUBSEQ function only operates on strings.
  12099.  
  12100.  
  12101. subst
  12102. ________________________________________________________________________
  12103.  
  12104. type: function (subr) 
  12105. location: built-in
  12106. source file: xllist.c
  12107. Common LISP compatible: similar
  12108. supported on: all machines
  12109.  
  12110. SYNTAX
  12111.  
  12112. (subst <new-expr> <old-expr> <expr> [ { :test | :test-not } <test> ] )
  12113.     <old-expr>    -    the expression to search for 
  12114.     <new-expr>    -    the expression to replace <old-expr> with
  12115.     <expr>        -    the expression to substitute within - atom/list
  12116.     <test>        -    optional test function (default is EQL)
  12117.  
  12118. DESCRIPTION
  12119.  
  12120. SUBST  searches  through an <expr> and replaces  each of the  <old-expr>
  12121. elements  with the  <new-expr>.  The <expr> with the  substitutions  (if
  12122. any) is  returned.  You may  specify  your own test  with the  :TEST and
  12123. :TEST-NOT keywords followed by the test you which to perform.
  12124.  
  12125. EXAMPLES
  12126.  
  12127.     (subst 'new 'old '(old mid dif))    ; returns (NEW MID DIF)
  12128.     (subst '(a) 'old '(old mid dif))    ; returns ((A) MID DIF)
  12129.     (subst "a" 'old '(old mid dif))        ; returns ("a" MID DIF)
  12130.  
  12131.     (defun mytest (x y) (princ x)(princ " "); define a test function
  12132.                 (princ y)(terpri)    ;   that prints the arguments 
  12133.                 T )             ;   and always returns TRUE
  12134.     (subst 'a 'b '(a b c d) :test 'mytest)    ; prints (A B C D) B   returns A
  12135.     (subst 'a 'b '(a b) :test-not 'mytest)    ; prints (A B) B
  12136.                         ;     A B
  12137.                         ;     (B) B
  12138.                         ;     B B
  12139.                         ;     NIL B     returns (A B)
  12140.  
  12141. NOTE:
  12142. The  SUBST  function  can  work  with a list or  string  as the  <expr>.
  12143. However, the default EQL test does not work with lists or strings,  only
  12144. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  12145. keyword along with EQUAL for <test>.
  12146.  
  12147. COMMON LISP COMPATABILITY:
  12148. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  12149. function  that is applied to each element of <expr> before it is tested.
  12150. XLISP does not support this.
  12151.  
  12152.  
  12153. symbol-name
  12154. ________________________________________________________________________
  12155.  
  12156. type: function (subr) 
  12157. location: built-in
  12158. source file: xlbfun.c
  12159. Common LISP compatible: yes
  12160. supported on: all machines
  12161.  
  12162. SYNTAX
  12163.  
  12164. (symbol-name <symbol> )
  12165.     <symbol>    -    an expression that evaluates to a symbol name 
  12166.  
  12167. DESCRIPTION
  12168.  
  12169. The SYMBOL-NAME  function takes the <symbol>  expression and returns the
  12170. printable string of the <symbol>.  If the <symbol> had not existed, then
  12171. it will be created and INTERNed into the system symbol table *OBARRAY* -
  12172. but with it's value unbound and an empty property list.
  12173.  
  12174. EXAMPLES
  12175.  
  12176.     (symbol-name 'foo)            ; returns "FOO"
  12177.     (symbol-name 'gleep)            ; returns "GLEEP"
  12178.  
  12179.     (setq my-symbol 'flop)            ; define MY-SYMBOL
  12180.     (symbol-name my-symbol)            ; returns "FLOP"
  12181.  
  12182.  
  12183. symbol-plist
  12184. ________________________________________________________________________
  12185.  
  12186. type: function (subr) 
  12187. location: built-in
  12188. source file: xlbfun.c
  12189. Common LISP compatible: yes
  12190. supported on: all machines
  12191.  
  12192. SYNTAX
  12193.  
  12194. (symbol-plist <symbol> )
  12195.     <symbol>    -    the symbol name with a property list
  12196.  
  12197. DESCRIPTION
  12198.  
  12199. SYMBOL-PLIST  returns the actual  property  list from the <symbol>.  The
  12200. <symbol> must be an existing,  bound  variable,  but it does not need to
  12201. have anything in it's property list.
  12202.  
  12203. Property  lists are lists  attached to any user defined  variables.  The
  12204. lists are in the form of (name1  val1 name2 val2  ....).  Any  number of
  12205. properties may be attached to a single variable.
  12206.  
  12207. EXAMPLES
  12208.  
  12209.     (setq person 'bobby)            ; create a var with a value
  12210.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  12211.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  12212.     (putprop person '(10 20 30) 'stats)    ; add a STATS list
  12213.     (symbol-plist person)            ; returns the property list:
  12214.                         ; (STATS (10 20 30)
  12215.                         ;  JOB DISC-JOCKEY
  12216.                         ;  LAST-NAME BOOGIE)
  12217.  
  12218.  
  12219. symbol-value
  12220. ________________________________________________________________________
  12221.  
  12222. type: function (subr) 
  12223. location: built-in
  12224. source file: xlbfun.c
  12225. Common LISP compatible: yes
  12226. supported on: all machines
  12227.  
  12228. SYNTAX
  12229.  
  12230. (symbol-value <symbol> )
  12231.     <symbol>    -    an expression that evaluates to a symbol name 
  12232.  
  12233. DESCRIPTION
  12234.  
  12235. The SYMBOL-VALUE  function takes the <symbol> expression and returns the
  12236. current value of the <symbol>.
  12237.  
  12238. If the <symbol>  had not existed,  then it will be created and  INTERNed
  12239. into the system symbol table *OBARRAY* - but with it's value unbound and
  12240. an  empty  property  list.  In this  case of a  previously  non-existant
  12241. <symbol>,  since it has no bound  value,  the  SYMBOL-VALUE  will  still
  12242. report an error due to an unbound variable.
  12243.  
  12244. EXAMPLES
  12245.  
  12246.     (setq myvar 55)                ; set MYVAR to value 55
  12247.     (symbol-value 'myvar)            ; returns 55
  12248.  
  12249.     (symbol-value 'floop)            ; error: unbound variable 
  12250.  
  12251.     (setq my-symbol 'a)            ; set MY-SYMBOL to A
  12252.     (setq a '(contents of symbol a))    ; set A to value -
  12253.                         ;   (CONTENTS OF SYMBOL A)
  12254.     (symbol-value my-symbol)        ; returns (CONTENTS OF SYMBOL A)
  12255.  
  12256.  
  12257. symbolp
  12258. ________________________________________________________________________
  12259.  
  12260. type: predicate function (subr)
  12261. location: built-in
  12262. source file: xllist.c
  12263. Common LISP compatible: yes
  12264. supported on: all machines
  12265.  
  12266. SYNTAX
  12267.  
  12268. (symbolp <expr> )
  12269.     <expr>        -    the expression to check
  12270.  
  12271. DESCRIPTION
  12272.  
  12273. The  SYMBOLP  predicate  checks  if an <expr>  is a valid  symbol.  T is
  12274. returned  if <expr> is a symbol, NIL is  returned  otherwise.  An <expr>
  12275. that evaluates to an integer, function (subr or otherwise), and so on is
  12276. not a symbol.  However, the quoted  (un-evaluated) name of these objects
  12277. (like 'MYARRAY) is a valid symbol.
  12278.  
  12279. EXAMPLES
  12280.  
  12281.     (symbolp (make-symbol "a"))        ; returns T - symbol
  12282.     (symbolp 'a)                ; returns T - symbol
  12283.  
  12284.     (symbolp #(1 2 3))            ; returns NIL - array
  12285.     (symbolp (lambda (x) (print x)))    ; returns NIL - closure 
  12286.     (symbolp *standard-output*)        ; returns NIL - stream
  12287.     (symbolp 1.2)                ; returns NIL - float
  12288.     (symbolp 2)                ; returns NIL - integer
  12289.     (symbolp object)            ; returns NIL - object
  12290.     (symbolp "hi")                ; returns NIL - string
  12291.  
  12292.     (symbolp #'car)                ; returns NIL - subr 
  12293.     (symbolp 'car)                ; returns T - it is a symbol now
  12294.     (symbolp '2)                ; returns NIL - not a symbol
  12295.  
  12296.  
  12297. system
  12298. ________________________________________________________________________
  12299.  
  12300. type: function (subr) 
  12301. location: system extenstion
  12302. source file: msstuff.c and osdefs.h and osptrs.h
  12303. Common LISP compatible: no
  12304. supported on: MS-DOS compatibles
  12305.  
  12306. SYNTAX
  12307.  
  12308. (system <command> )
  12309.     <command>    -    the OS command string to be executed
  12310.  
  12311. DESCRIPTION
  12312.  
  12313. The SYSTEM  function  will send the <command>  string to the  underlying
  12314. operating  system for execution.  After  execution of the <command>, the
  12315. SYSTEM function will return a T result if the <command> was  successful.
  12316. If the  <command>  was not  successful,  the numeric  error code will be
  12317. returned.  Any output from the  <command>  execution  will not be put in
  12318. the transcript file.
  12319.  
  12320. EXAMPLES
  12321.  
  12322.     (system "dir")                ; do a PC directory listing
  12323.     (system "mycmd")            ; execute a special command
  12324.  
  12325. NOTE:
  12326. This  function is an  extension of the XLISP  system.  It is provided in
  12327. the  MSSTUFF.C  source code file.  If your XLISP  system is built for an
  12328. IBM PC and  compatibles or generic  MS-DOS, this function will work.  If
  12329. your  system  is built on UNIX or some  other  operating  system,  it is
  12330. unlikely  that  these   functions   will  work  unless  you  extend  the
  12331. appropriate  STUFF.C file (which may be called something  different like
  12332. UNIXSTUFF.C).  The source that could be put in the  appropriate  STUFF.C
  12333. file for this extension to work on a UNIX style system is:
  12334.  
  12335.     /* xsystem - execute a system command */
  12336.     LVAL xsystem()
  12337.     {
  12338.         char *cmd="COMMAND";
  12339.         if (moreargs())
  12340.         cmd = (char *)getstring(xlgastring());
  12341.         xllastarg();
  12342.         return (system(cmd) == 0 ? true : cvfixnum((FIXTYPE)errno));
  12343.     }
  12344.  
  12345. The source that gets added to the OSDEFS.H file is:
  12346.  
  12347.     extern LVAL xsystem();
  12348.  
  12349. The source that gets added to the OSPTRS.H file is:
  12350.  
  12351.     {    "SYSTEM",    S,    xsystem    },
  12352.  
  12353.  
  12354. t
  12355. ________________________________________________________________________
  12356.  
  12357. type: system constant
  12358. location: built-in
  12359. source file: xlinit.c
  12360. Common LISP compatible: yes
  12361. supported on: all machines
  12362.  
  12363. SYNTAX
  12364.  
  12365. t
  12366.  
  12367. DESCRIPTION
  12368.  
  12369. The T constant is built into XLISP.  It represents True - as oppossed to
  12370. false (NIL).
  12371.  
  12372. EXAMPLES
  12373.     (setq myvar T)                ; set MYVAR to True
  12374.     (setq myvar 'T)                ; T and 'T both evaluate to T
  12375.     (if t (print "this will print")        ; if/then/else
  12376.           (print "this won't print"))
  12377.  
  12378. NOTE:
  12379. Be careful  with the T value.  It is  possible to do a SETQ on T and set
  12380. it to other values (like NIL).  Some operations will still return proper
  12381. T or NIL values, but the system will be in a bad state.
  12382.  
  12383.  
  12384. tagbody
  12385. ________________________________________________________________________
  12386.  
  12387. type: special form (fsubr)
  12388. location: built-in
  12389. source file: xlcont.c
  12390. Common LISP compatible: yes
  12391. supported on: all machines
  12392.  
  12393. SYNTAX
  12394.  
  12395. (tagbody  [ <expr> ... ]  )
  12396.     <expr>        -    expressions comprising the body of the block
  12397.                 which may contain GOs or tags for GO  
  12398.  
  12399. DESCRIPTION
  12400.  
  12401. The TAGBODY special form is basically a 'block'  construct that contains
  12402. a block of code  (expressions)  to evaluate.  After the execution of the
  12403. TAGBODY  <expr>'s,  NIL is  returned.  The TAGBODY  special  form allows
  12404. 'go-to' style branching within the 'block'  construct via the GO special
  12405. form.  To  allow  this,  each  <expr>  may  be  a  tag  or a  form.  The
  12406. tag-symbol  is the 'label' and must exist  somewhere  within the 'block'
  12407. that the GO occurs within.
  12408.  
  12409. EXAMPLES
  12410.  
  12411.     (tagbody                ; build the 'block'
  12412.        start (print "begin")        ; tag - start
  12413.           (GO end)            ; 
  12414.          (print "hello")        ; won't ever be reached
  12415.        end   (print "done"))        ; tag - END
  12416.                         ; prints  "begin" "done"
  12417.                         ;   returns NIL
  12418.  
  12419.  
  12420. tan
  12421. ________________________________________________________________________
  12422.  
  12423. type: function (subr) 
  12424. location: built-in
  12425. source file: xlmath.c
  12426. Common LISP compatible: similar
  12427. supported on: all machines
  12428.  
  12429. SYNTAX
  12430.  
  12431. (tan <expr> )
  12432.     <expr>        -    floating point number/expression
  12433.  
  12434. DESCRIPTION
  12435.  
  12436. The TAN  function  calculates  the tangent of the <expr> and returns the
  12437. result.  The <expr> is in radians.
  12438.  
  12439. EXAMPLES
  12440.  
  12441.     (tan 0.0)                ; returns 0
  12442.     (tan 1.0)                ; returns 1.55741
  12443.     (tan (/ 3.14159 2))            ; returns 753696
  12444.     (tan 2.0)                ; returns -2.18504
  12445.     (tan 3.0)                ; returns -0.142547
  12446.     (tan 3.14159)                ; returns -2.65359e-06
  12447.     (tan 4.5)                ; returns 4.63733
  12448.  
  12449.  
  12450. COMMON LISP COMPATABILITY:
  12451. Common LISP allows for integer numbers, which XLISP does not support for
  12452. TAN.
  12453.  
  12454.  
  12455. terpri
  12456. ________________________________________________________________________
  12457.  
  12458. type: function (subr) 
  12459. location: built-in
  12460. source file: xlfio.c  and  xlprin.c
  12461. Common LISP compatible: yes
  12462. supported on: all machines
  12463.  
  12464. SYNTAX
  12465.  
  12466. (terpri  [ <destination> ] )
  12467.     <destination>    -    an optional destination - must be a file pointer
  12468.                 or stream, the default is *standard-output*
  12469.  
  12470. DESCRIPTION
  12471.  
  12472. The TERPRI  function  prints a new-line to the specified  <destination>.
  12473. This will  terminate  the current print line for  <destination>.  NIL is
  12474. always returned as the result.  The  <destination> may be a file pointer
  12475. or a  stream.  If there is no  <destination>,  *STANDARD-OUTPUT*  is the
  12476. default.
  12477.  
  12478. EXAMPLES
  12479.  
  12480.     (terpri)                ; prints  <NL>
  12481.  
  12482.     (setq f (open "pr" :direction :output )); create a file
  12483.     (princ "hi" f)                ; returns "hi"
  12484.     (princ 727 f)                ; returns 727
  12485.     (princ "ho" f)                ; returns "ho"
  12486.     (terpri f)                ; returns NIL
  12487.     (close f)                ; file contains hi727ho\n
  12488.  
  12489. COMMON LISP COMPATABILITY:
  12490. Common LISP specifies that print operations with a <destination> of NIL,
  12491. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  12492. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  12493. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  12494. XLISP does not allow T as a valid argument for <destination>.
  12495.  
  12496.  
  12497. third
  12498. ________________________________________________________________________
  12499.  
  12500. type: function (subr) 
  12501. location: built-in
  12502. source file: xlinit.c
  12503. Common LISP compatible: yes
  12504. supported on: all machines
  12505.  
  12506. SYNTAX
  12507.  
  12508. (third <expr> )
  12509.     <expr>        -    a list or list expression
  12510.  
  12511. DESCRIPTION
  12512.  
  12513. THIRD  returns the third  element of a list or list  expression.  If the
  12514. list is NIL, NIL is returned.
  12515.  
  12516. EXAMPLES
  12517.     (third '(1 2 3 4))            ; returns 3
  12518.     (third NIL)                ; returns NIL
  12519.  
  12520.     (setq kids '(junie vickie cindy chris))    ; set up variable KIDS
  12521.     (first kids)                ; returns JUNIE
  12522.     (second kids)                ; returns VICKIE
  12523.     (third kids)                ; returns CINDY
  12524.     (fourth kids)                ; returns CHRIS
  12525.     (rest kids)                ; returns (VICKIE CINDY CHRIS)
  12526.  
  12527. NOTE:
  12528. This  function is set to the same  code as CADDR.  
  12529.  
  12530.  
  12531. throw
  12532. ________________________________________________________________________
  12533.  
  12534. type: special form (fsubr)
  12535. location: built-in
  12536. source file: xlcont.c and xljump.c
  12537. Common LISP compatible: yes
  12538. supported on: all machines
  12539.  
  12540. SYNTAX
  12541.  
  12542. (throw  <tag-symbol>  [ <expr> ]  )
  12543.     <tag-symbol>    -    an expression that evaluates to a symbol
  12544.     <expr>        -    an optional expression to be returned
  12545.  
  12546. DESCRIPTION
  12547.  
  12548. The CATCH and THROW  special  forms allow for non-local  exits and traps
  12549. without going through the intermediate evaluations and function returns.
  12550. The  <expr>  in THROW  specifies  what  value is to be  returned  by the
  12551. corresponding  CATCH.  If there is no <expr>, a NIL is  returned  to the
  12552. corresponding  CATCH.  If a THROW  is  evaluated  with no  corresponding
  12553. CATCH, an error is  generated  - "error:  no target for  THROW".  If, in
  12554. the  calling  process,  more  than  one  CATCH  is set up for  the  same
  12555. <tag-symbol>, the most recently  evaluated  <tag-symbol> will be the one
  12556. that does the actual catching.
  12557.  
  12558. EXAMPLES
  12559.  
  12560.     (catch 'mytag)                ; returns NIL    - no THROW
  12561.     (catch 'mytag (+ 1 (+ 2 3)))        ; returns 6     - no THROW
  12562.     (catch 'mytag (+ 1 (throw 'mytag)))    ; returns NIL    - caught it
  12563.     (catch 'mytag (+ 1 (throw 'mytag 55)))    ; returns 55    - caught it
  12564.     (catch 'mytag (throw 'foo))        ; error: no target for THROW
  12565.  
  12566.     (defun in (x)                 ; define IN
  12567.        (if (numberp x) (+ x x)        ;   if number THEN double
  12568.                    (throw 'math 42)))    ;             ELSE throw 42
  12569.     (defun out (x)                ; define OUT
  12570.       (princ "<") (princ  (* (in x) 2))    ;   double via multiply
  12571.       (princ ">"))                ;
  12572.     (defun main (x)                ; define MAIN
  12573.       (catch 'math (out x)))        ;   with CATCH
  12574.     (in 5)                    ; returns 10
  12575.     (out 5)                    ; prints  <20>   returns ">"
  12576.     (main 5)                ; prints  <20>   returns ">"
  12577.     (main 'a)                ; prints  <     returns 42
  12578.  
  12579. NOTE:
  12580. Although  CATCH  and  THROW  will  accept a  <tag-symbol>  that is not a
  12581. symbol, it will not find this  improper  <tag-symbol>.  An error will be
  12582. generated - "error:  no target for THROW".
  12583.  
  12584.  
  12585. :tmacro
  12586. ________________________________________________________________________
  12587.  
  12588. type: keyword
  12589. location: built-in
  12590. source file: xlread.c
  12591. Common LISP compatible: no
  12592. supported on: all machines
  12593.  
  12594. SYNTAX
  12595.  
  12596. (:tmacro . <function> )
  12597.     <function>    -    a function
  12598.  
  12599. DESCRIPTION
  12600.  
  12601. :TMACRO is an entry that is used in the  *READTABLE*.  *READTABLE*  is a
  12602. system  variable that contains  XLISP's data structures  relating to the
  12603. processing  of  characters  from  the  user (or  files)  and  read-macro
  12604. expansions.  The  existance  of  the  :TMACRO  keyword  means  that  the
  12605. specified  character is a terminal read macro.  For :TMACRO, the form of
  12606. the  *READTABLE*  entry is a dotted pair like (:TMACRO .  <function>  ).
  12607. The <function> can be a built-in  read-macro  function or a user defined
  12608. lambda expression.  The <function> takes two parameters, an input stream
  12609. specification,   and  an  integer  that  is  the  character  value.  The
  12610. <function>  should  return NIL if the  character is  'white-space'  or a
  12611. value CONSed with NIL to return the value.  The <function> will probably
  12612. read additional characters from the input stream.
  12613.  
  12614. EXAMPLES
  12615.  
  12616.     (defun look-at (table)            ; define a function to 
  12617.      (dotimes (ch 127)            ;   look in a table
  12618.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  12619.             (if (and (consp entry)        ;   :TMACRO entries
  12620.                      (equal (car entry)     ;
  12621.                     ':TMACRO))    ;
  12622.               (princ (int-char ch)))))    ;
  12623.      (terpri))                ;
  12624.                          ;
  12625.     (look-at *readtable*)            ;  prints "'(),;`
  12626.  
  12627. NOTE:
  12628. The system defines that the following are :TMACRO characters:
  12629.  
  12630.     \ " ` , ( ) ;
  12631.  
  12632. CAUTION:
  12633. If you experiment  with  *READTABLE*, it is useful to save the old value
  12634. in a variable, so that you can restore the system state.
  12635.  
  12636.  
  12637. top-level
  12638. ________________________________________________________________________
  12639.  
  12640. type: function (subr) 
  12641. location: built-in
  12642. source file: xlbfun.c  and  xldbug.c
  12643. Common LISP compatible: no
  12644. supported on: all machines
  12645.  
  12646. SYNTAX
  12647.  
  12648. (top-level)
  12649.  
  12650.  
  12651. DESCRIPTION
  12652.  
  12653. The  TOP-LEVEL  function  aborts to the top level of XLISP.  This may be
  12654. from within several levels of the break loop.  This is valid for BREAKs,
  12655. ERRORs and CERRORs  (continuable  errors).  If  TOP-LEVEL  is  evaluated
  12656. while not in a break  loop, a  message  is  printed - "[ back to the top
  12657. level ]".  This  message  does not cause  XLISP to go into a break loop.
  12658. TOP-LEVEL never actually returns a value.
  12659.  
  12660. EXAMPLES
  12661.  
  12662.     (top-level)                ; [ back to the top level ]
  12663.  
  12664.     (break "out")                ; break: out        (1st)
  12665.     (break "twice")                ; break: twice        (2nd)
  12666.     (top-level)                ; to exit out of break loop 
  12667.  
  12668. KEYSTROKE EQUIVALENT:
  12669. In the IBM PC and MS-DOS  versions of XLISP, a CTRL-c key  sequence  has
  12670. the same  effect as doing a  (TOP-LEVEL).  On a  Macintosh,  this can be
  12671. accomplished by a pull-down menu or a COMMAND-t.
  12672.  
  12673.  
  12674. trace
  12675. ________________________________________________________________________
  12676.  
  12677. type: special form (fsubr)
  12678. location: built-in
  12679. source file: xlcont.c
  12680. Common LISP compatible: similar
  12681. supported on: all machines
  12682.  
  12683. SYNTAX
  12684.  
  12685. (trace  <function> ... )
  12686.     <function>    -    an unquoted function
  12687.  
  12688. DESCRIPTION
  12689.  
  12690. The TRACE  special form allows the tracing of user or system  functions.
  12691. TRACE returns a list  containing  the current set of functions  that are
  12692. being traced.  The <function> does not have to be currently  defined, it
  12693. can be created as part of the  execution.  The trace output  consists of
  12694. entry and exit  information.  At entry and exit of a traced  <function>,
  12695. lines will be printed of the form:
  12696.  
  12697.     Entering: <function>, Argument list: <arg-list>  
  12698.         .
  12699.         .
  12700.         .
  12701.     Exiting: <function>, Value: <ret-value>
  12702.  
  12703. EXAMPLES
  12704.  
  12705.     (defun foo (x) (print (car x)))        ; define FOO
  12706.     (trace 'foo)                ; returns (FOO)
  12707.     (trace 'car)                ; returns (CAR FOO)
  12708.     (foo '(a))                ; Entering: FOO, Argument list: ((A))
  12709.                         ;  Entering: CAR, Argument list: ((A))
  12710.                         ;  Exiting: CAR, Value: A
  12711.                         ; A
  12712.                         ; Exiting: FOO, Value: A
  12713.                         ; returns A
  12714.  
  12715. COMMON LISP COMPATABILITY:
  12716. The XLISP TRACE  function  does not support any keyword  options,  which
  12717. Common LISP allows.
  12718.  
  12719.  
  12720. *tracelimit*
  12721. ________________________________________________________________________
  12722.  
  12723. type: system variable
  12724. location: built-in
  12725. source file: xlinit.c  and  xldbug.c
  12726. Common LISP compatible: no
  12727. supported on: all machines
  12728.  
  12729. SYNTAX
  12730.  
  12731. *tracelimit*
  12732.  
  12733.  
  12734. DESCRIPTION
  12735.  
  12736. *TRACELIMIT*  is a system  variable  that  controls  the number of forms
  12737. printed on entry to the break loop.  If *TRACELIMIT* is an integer, then
  12738. the  integer is the  maximum  number of forms that will be  printed.  If
  12739. *TRACELIMIT*  is NIL or a  non-integer,  then all of the  forms  will be
  12740. printed.  Note that  *TRACENABLE*  needs to be set to a non-NIL value to
  12741. enable the  printing  of  back-trace  information  on entry to the break
  12742. loop.
  12743.  
  12744. EXAMPLES
  12745.  
  12746.     (defun foo (x) (fee x))            ; define FOO
  12747.     (defun fee (y) (break))            ; define FEE
  12748.     (setq *tracenable* T)            ; enable the back trace
  12749.     (setq *tracelimit* NIL)            ; show all the entries
  12750.     (foo 5)                    ; break: **BREAK**
  12751.                         ; prints  Function:.....BREAK..
  12752.                         ;      Function:.....FEE....
  12753.                         ;      Arguments:
  12754.                         ;        5
  12755.                         ;      Function:.....FOO....
  12756.                         ;       Arguments:
  12757.                         ;        5
  12758.     (clean-up)                ; from break loop
  12759.     (setq *tracelimit* 2)            ; show only 2 entries
  12760.     (foo 5)                    ; break: **BREAK**
  12761.                         ; prints  Function:.....BREAK..
  12762.                         ;      Function:.....FEE....
  12763.                         ;      Arguments:
  12764.                         ;        5
  12765.     (clean-up)                ; from break loop
  12766.  
  12767. NOTE:
  12768. *TRACENABLE* and *TRACELIMIT* have to do with back trace  information at
  12769. entry to a break loop and have nothing to do with TRACE and UNTRACE.
  12770.  
  12771.  
  12772. *tracelist*
  12773. ________________________________________________________________________
  12774.  
  12775. type: system variable
  12776. location: built-in
  12777. source file: xlinit.c  and  xleval.c
  12778. Common LISP compatible: no
  12779. supported on: all machines
  12780.  
  12781. SYNTAX
  12782.  
  12783. *tracelist*
  12784.  
  12785.  
  12786. DESCRIPTION
  12787.  
  12788. *TRACELIST*  is a system  variable  that  contains a list of the current
  12789. functions being traced.
  12790.  
  12791. EXAMPLES
  12792.  
  12793.     (defun foo (x) (print (car x)))        ; define FOO
  12794.     (trace foo)                ; returns (FOO)
  12795.     (trace car)                ; returns (CAR FOO)
  12796.     (print *tracelist*)            ; prints  (CAR FOO)
  12797.     (untrace foo)                ; returns (CAR)
  12798.     (untrace car)                ; returns NIL
  12799.     (print *tracelist*)            ; prints  NIL
  12800.  
  12801.  
  12802. *tracenable*
  12803. ________________________________________________________________________
  12804.  
  12805. type: system variable
  12806. location: built-in
  12807. source file: xlinit.c  and  xldbug.c
  12808. Common LISP compatible: no
  12809. supported on: all machines
  12810.  
  12811. SYNTAX
  12812.  
  12813. *tracenable*
  12814.  
  12815.  
  12816. DESCRIPTION
  12817.  
  12818. *TRACENABLE* is a system variable that controls whether or not the break
  12819. loop prints any back trace  information  on entry to the break loop.  If
  12820. *TRACENABLE* is NIL, then there will be no information  printed on entry
  12821. to the break loop.  If *TRACENABLE* is non-NIL, then information will be
  12822. printed.  The INIT.LSP  initialization  file sets  *TRACENABLE*  to NIL,
  12823. which suppresses the printing.
  12824.  
  12825. EXAMPLES
  12826.  
  12827.     (defun foo (x) (fee x))            ; define FOO
  12828.     (defun fee (y) (break))            ; define FEE
  12829.     (setq *tracenable* T)            ; enable the back trace
  12830.     (setq *tracelimit* NIL)            ; show all the entries
  12831.     (foo 5)                    ; break: **BREAK**
  12832.                         ; prints  Function:.....BREAK..
  12833.                         ;      Function:.....FEE....
  12834.                         ;      Arguments:
  12835.                         ;        5
  12836.                         ;      Function:.....FOO....
  12837.                         ;       Arguments:
  12838.                         ;        5
  12839.     (clean-up)                ; from break loop
  12840.     (setq *tracelimit* 2)            ; show only 2 entries
  12841.     (foo 5)                    ; break: **BREAK**
  12842.                         ; prints  Function:.....BREAK..
  12843.                         ;      Function:.....FEE....
  12844.                         ;      Arguments:
  12845.                         ;        5
  12846.     (clean-up)                ; from break loop
  12847.  
  12848. NOTE:
  12849. *TRACENABLE* and *TRACELIMIT* have to do with back trace  information at
  12850. entry to a break loop and have nothing to do with TRACE and UNTRACE.
  12851.  
  12852.  
  12853. *trace-output*
  12854. ________________________________________________________________________
  12855.  
  12856. type: system variable 
  12857. location: built-in
  12858. source file: xlinit.c  xlio.c
  12859. Common LISP compatible: yes
  12860. supported on: all machines
  12861.  
  12862. SYNTAX
  12863.  
  12864. *trace-output*
  12865.  
  12866.  
  12867. DESCRIPTION
  12868.  
  12869. *TRACE-OUTPUT*  is a system  variable  that contains a file pointer that
  12870. points to the file where all trace output goes to.  The default file for
  12871. *TRACE-OUTPUT*  is the  system  standard  error  device -  normally  the
  12872. screen.
  12873.  
  12874. EXAMPLES
  12875.     *trace-output*                ; returns #<File-Stream: #243de>
  12876.  
  12877. NOTE:
  12878. *TRACE-OUTPUT*, *DEBUG-IO* and *ERROR-OUTPUT* are normally all set to the 
  12879. same file stream - STDERR.
  12880.  
  12881.  
  12882. truncate
  12883. ________________________________________________________________________
  12884.  
  12885. type: function (subr) 
  12886. location: built-in
  12887. source file: xlmath.c
  12888. Common LISP compatible: similar
  12889. supported on: all machines
  12890.  
  12891. SYNTAX
  12892.  
  12893. (truncate <expr> )
  12894.     <expr>        -    integer or floating point number/expression
  12895.  
  12896. DESCRIPTION
  12897.  
  12898. The TRUNCATE  function  takes the <expr> and  truncates it to an integer
  12899. value and returns this result.
  12900.  
  12901. EXAMPLES
  12902.  
  12903.     (truncate 123.456)            ; returns 123
  12904.     (truncate -1.49)            ; returns -1
  12905.     (truncate -1.59)            ; returns -1
  12906.     (truncate 123)                ; returns 123
  12907.     (truncate 123.999)            ; returns 123
  12908.  
  12909. COMMON LISP COMPATABILITY:
  12910. Common LISP allows an optional division  parameter, which XLISP does not
  12911. support.
  12912.  
  12913.  
  12914. type-of
  12915. ________________________________________________________________________
  12916.  
  12917. type: function (subr)
  12918. location: built-in
  12919. source file: xlsys.c
  12920. Common LISP compatible: similar
  12921. supported on: all machines
  12922.  
  12923. SYNTAX
  12924.  
  12925. (type-of <expr> )
  12926.     <expr>        -    an expression to check
  12927.  
  12928. DESCRIPTION
  12929.  
  12930. The TYPE-OF function returns the type of the expression.
  12931.  
  12932. EXAMPLES
  12933.  
  12934.     (type-of NIL)                ; returns NIL        
  12935.     (type-of '#(1 2 3))            ; returns ARRAY    
  12936.     (type-of (lambda (x) (print x)))    ; returns CLOSURE
  12937.     (type-of '(a b))            ; returns CONS        
  12938.     (type-of #'savefun)            ; returns CLOSURE
  12939.     (type-of '(a . b))            ; returns CONS        
  12940.     (type-of *standard-output*)        ; returns FILE-STREAM
  12941.     (type-of 1.2)                ; returns FLONUM    
  12942.     (type-of #'do)                ; returns FSUBR        
  12943.     (type-of 1)                ; returns FIXNUM    
  12944.     (type-of object)            ; returns OBJECT    
  12945.     (type-of "str")                ; returns STRING    
  12946.     (type-of #'car)                ; returns SUBR        
  12947.     (type-of 'a)                ; returns SYMBOL    
  12948.     (type-of #\a)                ; returns CHARACTER
  12949.     (type-of (make-string-input-stream "a")); returns UNNAMED-STREAM
  12950.  
  12951. COMMON LISP COMPATABILITY:
  12952. The XLISP and Common LISP  TYPE-OF  functions  are  basically  the same.
  12953. Differences between the two can occur in what the types are called (like
  12954. CHARACTER in XLISP and STANDARD-CHAR in Common LISP).  Also, Common LISP
  12955. can give additional  information - for strings, it returns a list of the
  12956. form (SIMPLE-STRING 32) where the number 32 is the string size.
  12957.  
  12958.  
  12959. *unbound*
  12960. ________________________________________________________________________
  12961.  
  12962. type: system constant
  12963. location: built-in
  12964. source file: xlinit.c  and  xlsym.c
  12965. Common LISP compatible: no
  12966. supported on: all machines
  12967.  
  12968. SYNTAX
  12969.  
  12970. *unbound*
  12971.  
  12972.  
  12973. DESCRIPTION
  12974.  
  12975. *UNBOUND* is a system  constant  that is used to indicate  when a symbol
  12976. has no value.  *UNBOUND* is set to the value *UNBOUND*.  This means that
  12977. the system thinks the symbol *UNBOUND* has no value.
  12978.  
  12979. EXAMPLES
  12980.     *unbound*                ; error: unbound variable
  12981.     (setq a 5)                ; returns 5
  12982.     a                    ; returns 5
  12983.     (setq a '*unbound*)            ; returns *UNBOUND*
  12984.     a                    ; error: unbound variable
  12985.  
  12986. unless
  12987. ________________________________________________________________________
  12988.  
  12989. type: special form (fsubr)
  12990. location: built-in
  12991. source file: xlcont.c
  12992. Common LISP compatible: yes
  12993. supported on: all machines
  12994.  
  12995. SYNTAX
  12996.  
  12997. (unless <test> [ <expr> ... ] )
  12998.     <test>        -    an expression - NIL or non-NIL
  12999.     <expr>        -    expressions comprising a body of code
  13000.  
  13001. DESCRIPTION
  13002.  
  13003. The UNLESS macro executes the <expr> forms if <test>  evaluates to a NIL
  13004. value.  If <test> is NIL, the value of the last  <expr> is  returned  as
  13005. the result.  If <test> is non-NIL,  NIL is returned  with none of <expr>
  13006. evaluated.
  13007.  
  13008. EXAMPLES
  13009.  
  13010.     (unless NIL)                ; returns NIL
  13011.     (unless T)                ; returns NIL
  13012.     (unless NIL (print "hi") 'foo)        ; prints  "hi"    returns FOO
  13013.     (unless (listp "a")             ;
  13014.           (print "not a list"))        ; prints  "not a list"
  13015.                         ; returns "not a list"
  13016.  
  13017.  
  13018. untrace
  13019. ________________________________________________________________________
  13020.  
  13021. type: special form (fsubr)
  13022. location: built-in
  13023. source file: xlcont.c
  13024. Common LISP compatible: similar
  13025. supported on: all machines
  13026.  
  13027. SYNTAX
  13028.  
  13029. (untrace  <function> ... )
  13030.     <function>    -    a function name 
  13031.  
  13032. DESCRIPTION
  13033.  
  13034. The UNTRACE  special form removes  <function>  from the current  list of
  13035. traced  functions.  UNTRACE returns a list containing the current set of
  13036. functions that are being traced.  If the <function> does currently exist
  13037. or is  currently be traced,  there will be no error  reported.  If there
  13038. are no functions being traced, a NIL is returned.
  13039.  
  13040. EXAMPLES
  13041.  
  13042.     (defun foo (x) (print (car x)))        ; define FOO
  13043.     (trace 'foo)                ; returns (FOO)
  13044.     (foo '(a))                ; Entering: FOO, Argument list: ((A))
  13045.                         ; A
  13046.                         ; Exiting: FOO, Value: A
  13047.                         ; returns A
  13048.     (untrace 'foo)                ; returns NIL
  13049.     (untrace 'glip)                ; returns NIL
  13050.     (foo '(a))                ; prints  A   and returns  A
  13051.  
  13052. COMMON LISP COMPATABILITY:
  13053. The XLISP UNTRACE  function  does not support any options,  which Common
  13054. LISP allows.
  13055.  
  13056.  
  13057. upper-case-p
  13058. ________________________________________________________________________
  13059.  
  13060. type: predicate function (subr) 
  13061. location: built-in
  13062. source file: xlstr.c 
  13063. Common LISP compatible: yes
  13064. versions: all machines
  13065.  
  13066. SYNTAX
  13067.  
  13068. (upper-case-p <char> )
  13069.     <char>        -    a character expression
  13070.  
  13071. DESCRIPTION
  13072.  
  13073. The UPPER-CASE-P  predicate checks if the <char>  expression is an upper
  13074. case  character.  If <char> is upper case a T is  returned,  otherwise a
  13075. NIL is returned.  Upper case characters are 'A' (ASCII decimal value 65)
  13076. through 'Z' (ASCII decimal value 90).
  13077.  
  13078. EXAMPLES
  13079.  
  13080.     (upper-case-p #\A)            ; returns T
  13081.     (upper-case-p #\a)            ; returns NIL
  13082.     (upper-case-p #\1)            ; returns NIL
  13083.     (upper-case-p #\[)            ; returns NIL
  13084.  
  13085.  
  13086. unwind-protect
  13087. ________________________________________________________________________
  13088.  
  13089. type: special form (fsubr)
  13090. location: built-in
  13091. source file: xlcont.c
  13092. Common LISP compatible: yes
  13093. supported on: all machines
  13094.  
  13095. SYNTAX
  13096.  
  13097. (unwind-protect <protect-form> <clean-up-form> ... )
  13098.     <protect-form>    -    a form that is to be protected
  13099.     <clean-up-form>    -    a sequence forms to execute after <protect-form>
  13100.  
  13101. DESCRIPTION
  13102.  
  13103. The UNWIND-PROTECT  special form allows the protecting (trapping) of all
  13104. forms of exit  from the  <protect-form>.  The  exits  that  are  trapped
  13105. include  errors,  THROW,  RETURN  and GO.  The  <clean-up-form>  will be
  13106. executed  in all cases - when there is an exit from  <protect-form>  and
  13107. when the form does not have exit.  UNWIND-PROTECT will return the result
  13108. from the <protect-form>, not from the <clean-up-form>s.  Errors or exits
  13109. that occur in the  <clean-up-form> are not protected.  It is possible to
  13110. trap these with another UNWIND-PROTECT.
  13111.  
  13112. EXAMPLES
  13113.  
  13114.     (unwind-protect             ;
  13115.         (+ 2 2)             ; protected form
  13116.         (print "an exit"))        ; clean up form
  13117.                         ; prints "an exit"
  13118.                         ; returns 4
  13119.  
  13120.     (nodebug)                ; to turn off break loop traps
  13121.     (unwind-protect             ;
  13122.         (+ 1 "2")            ; protected form
  13123.         (print "something happened"))    ; clean up form
  13124.                         ; error: bad argument type - "2"
  13125.                         ; prints "something happened"
  13126.     
  13127.     (catch 'mytag                 ; 
  13128.       (unwind-protect             ; 
  13129.           (throw 'mytag)             ; protected form
  13130.         (print "an exit") ) )        ; clean up form
  13131.                         ; prints "an exit"
  13132.  
  13133.     (nodebug)                ; to turn off break loop traps
  13134.     (unwind-protect             ;
  13135.         (throw 'notag)             ; protected form
  13136.         (print "an exit"))        ; clean up form
  13137.                         ; error: no target for THROW
  13138.                         ; prints "an exit"
  13139.  
  13140.     (prog ()                 ; 
  13141.         (print "start")            ;
  13142.         (unwind-protect         ;
  13143.             (go end)         ; protected form
  13144.             (print "an exit"))    ; clean-up form
  13145.       end     (print "end") )            ; prints "start"
  13146.                         ; prints "an exit"
  13147.                         ; prints "end"
  13148.  
  13149.     (prog ()                 ; 
  13150.         (print "start")            ;
  13151.         (unwind-protect         ;
  13152.             (return "I'm done")    ; protected form
  13153.             (print "but first"))    ; clean-up form
  13154.          (print "won't get here") )    ; prints "start"
  13155.                         ; prints "but first"
  13156.                         ; returns "I'm done"
  13157.  
  13158.  
  13159. vector
  13160. ________________________________________________________________________
  13161.  
  13162. type: function (subr)
  13163. location: built-in
  13164. source file: xlbfun.c
  13165. Common LISP compatible: yes
  13166. supported on: all machines
  13167.  
  13168. SYNTAX
  13169.  
  13170. (vector [ <expr> ... ] )
  13171.     <expr>        -    an expression
  13172.  
  13173. DESCRIPTION
  13174.  
  13175. The VECTOR function creates an initialized  vector and returns it as the
  13176. result.  VECTOR is  essentially  a fast  method to do a  one-dimensional
  13177. MAKE-ARRAY with initial data in the vector.
  13178.  
  13179. EXAMPLES
  13180.  
  13181.     (vector 'a 'b 'c)            ; returns #(A B C)
  13182.     (vector '(a b) '(c d))            ; returns #((A B) (C D))
  13183.     (vector)                ; returns #()
  13184.     (vector NIL)                ; returns #(NIL)
  13185.     (vector 'a () 4 "s")            ; returns #(A NIL 4 "s")
  13186.  
  13187.  
  13188. when
  13189. ________________________________________________________________________
  13190.  
  13191. type: special form (fsubr)
  13192. location: built-in
  13193. source file: xlcont.c
  13194. Common LISP compatible: yes
  13195. supported on: all machines
  13196.  
  13197. SYNTAX
  13198.  
  13199. (when  <test> [ <expr> ... ] )
  13200.     <test>        -    an expression - NIL or non-NIL
  13201.     <expr>        -    expressions comprising a body of code
  13202.  
  13203. DESCRIPTION
  13204.  
  13205. The WHEN  macro  executes  the  <expr>  forms if <test>  evaluates  to a
  13206. non-NIL  value.  If <test> is  non-NIL,  the value of the last <expr> is
  13207. returned as the result.  If <test> is NIL, NIL is returned  with none of
  13208. <expr> evaluated.
  13209.  
  13210. EXAMPLES
  13211.  
  13212.     (when NIL)                ; returns NIL
  13213.     (when T)                ; returns T
  13214.     (when T (print "hi") 'foo)        ; prints  "hi"    returns FOO
  13215.     (when (listp '(a))             ;
  13216.           (print "a list"))            ; prints  "a list"
  13217.                         ; returns "a list"
  13218.  
  13219.  
  13220. :white-space
  13221. ________________________________________________________________________
  13222.  
  13223. type: keyword
  13224. location: built-in
  13225. source file: xlread.c
  13226. Common LISP compatible: no
  13227. supported on: all machines
  13228.  
  13229. SYNTAX
  13230.  
  13231. :white-space
  13232.  
  13233.  
  13234. DESCRIPTION
  13235.  
  13236. :WHITE-SPACE  is an entry that is used in the  *READTABLE*.  *READTABLE*
  13237. is a system variable that contains  XLISP's data structures  relating to
  13238. the  processing of  characters  from the user (or files) and  read-macro
  13239. expansions.  The existance of the  :WHITE-SPACE  keyword  means that the
  13240. specified  character may be skipped over.  The system  defines that tab,
  13241. space, return and line-feed are :WHITE-SPACE characters.
  13242.  
  13243. EXAMPLES
  13244.  
  13245.     (defun look-at (table)            ; define a function to 
  13246.      (dotimes (ch 127)            ;   look in a table
  13247.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  13248.         (case entry             ;   entries with a function
  13249.           (NIL        NIL)        ;
  13250.           (:CONSTITUENT NIL)        ;
  13251.           (:WHITE-SPACE (print ch))        ;
  13252.           (T        NIL))))        ;
  13253.      (terpri))                ;
  13254.     (look-at *readtable*)            ;  prints  9         tab
  13255.                         ;          10         newline
  13256.                         ;          12         formfeed
  13257.                         ;          13         return
  13258.                         ;          32        space
  13259.  
  13260. CAUTION:
  13261. If you experiment  with  *READTABLE*, it is useful to save the old value
  13262. in a variable, so that you can restore the system state.
  13263.  
  13264.  
  13265. write-byte
  13266. ________________________________________________________________________
  13267.  
  13268. type: function (subr) 
  13269. location: built-in
  13270. source file: xlfio.c
  13271. Common LISP compatible: yes
  13272. supported on: all machines
  13273.  
  13274. SYNTAX
  13275.  
  13276. (write-byte  <expr>  [ <destination> ] )
  13277.     <expr>        -    an integer expression
  13278.     <destination>    -    an optional destination - must be a file pointer
  13279.                 or stream, the default is *standard-output*
  13280.  
  13281. DESCRIPTION
  13282.  
  13283. The  WRITE-BYTE  function  writes  the  <expr>  as a single  byte to the
  13284. specified  <destination>.  Only the <expr> byte is  written.  The <expr>
  13285. must be an integer  expression.  The <expr> is returned  as the  result.
  13286. The  <destination>  may be a file  pointer  or a stream.  If there is no
  13287. <destination>, *STANDARD-OUTPUT* is the default.
  13288.  
  13289. EXAMPLES
  13290.  
  13291.     (write-byte 67)                ; prints  C    returns 67
  13292.     
  13293.     (setq fp (open "t" :direction :output))    ; create file 
  13294.     (write-byte 65 fp)            ; returns 65
  13295.     (write-byte 66 fp)            ; returns 66
  13296.     (write-byte 10 fp)            ; returns 10
  13297.     (close fp)                ; returns NIL
  13298.     (read (open "t" :direction :input))    ; returns AB
  13299.  
  13300. COMMON LISP COMPATABILITY:
  13301. Common LISP specifies that print operations with a <destination> of NIL,
  13302. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  13303. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  13304. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  13305. XLISP does not allow T as a valid argument for <destination>.
  13306.  
  13307.  
  13308. write-char
  13309. ________________________________________________________________________
  13310.  
  13311. type: function (subr) 
  13312. location: built-in
  13313. source file: xlfio.c
  13314. Common LISP compatible: yes
  13315. supported on: all machines
  13316.  
  13317. SYNTAX
  13318.  
  13319. (write-char  <char-expr>  [ <destination> ] )
  13320.     <char-expr>    -    a character expression
  13321.     <destination>    -    an optional destination - must be a file pointer
  13322.                 or stream, the default is *standard-output*
  13323.  
  13324. DESCRIPTION
  13325.  
  13326. The  WRITE-CHAR   function  writes  the  <char-expr>  to  the  specified
  13327. <destination>.  Only the <char-expr> is written.  The  <char-expr>  must
  13328. be a character  expression.  The  <char-expr> is returned as the result.
  13329. The  <destination>  may be a file  pointer  or a stream.  If there is no
  13330. <destination>, *STANDARD-OUTPUT* is the default.
  13331.  
  13332. EXAMPLES
  13333.  
  13334.     (write-char #\C)            ; prints  C    
  13335.     
  13336.     (setq fp (open "t" :direction :output))    ; create file 
  13337.     (write-char #\A fp)            ; returns #\A
  13338.     (write-char #\B fp)            ; returns #\B
  13339.     (write-char #\Newline fp)        ; returns #\Newline
  13340.     (close fp)                ; returns NIL
  13341.     (read (open "t" :direction :input))    ; returns AB
  13342.  
  13343.  
  13344. COMMON LISP COMPATABILITY:
  13345. Common LISP specifies that print operations with a <destination> of NIL,
  13346. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  13347. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  13348. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  13349. XLISP does not allow T as a valid argument for <destination>.
  13350.  
  13351.  
  13352. zerop
  13353. ________________________________________________________________________
  13354.  
  13355. type: predicate function (subr)
  13356. location: built-in
  13357. source file: xlmath.c
  13358. Common LISP compatible: yes
  13359. supported on: all machines
  13360.  
  13361. SYNTAX
  13362.  
  13363. (zerop <expr> )
  13364.     <expr>        -    the numeric expression to check
  13365.  
  13366. DESCRIPTION
  13367.  
  13368. The ZEROP  predicate  checks to see if the number  <expr> is zero.  T is
  13369. returned  if the  number  is  zero,  NIL is  returned  otherwise.  A bad
  13370. argument  type  error  is  generated  if the  <expr>  is  not a  numeric
  13371. expression.
  13372.  
  13373. EXAMPLES
  13374.  
  13375.     (zerop 0)                ; returns T
  13376.     (zerop 0.0)                ; returns T
  13377.     (zerop 99999.9)                ; returns NIL
  13378.     (zerop -0.000000000002)            ; returns NIL
  13379.  
  13380.     (zerop 'a)                ; error: bad argument type
  13381.     (setq a 0)                ; set value of A to 0
  13382.     (zerop a)                ; returns T
  13383.  
  13384.  
  13385.