home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lisp / interpre / xlispplu / referenc / xlispref.txt
Text File  |  1989-12-11  |  426KB  |  13,471 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)        ; returns 127
  6868.     (logior 5 #b010)            ; returns 7
  6869.     (logior 99 #x1FF)            ; returns 511
  6870.     (logior 99 #x400)            ; returns 1123
  6871.  
  6872. NOTE:
  6873. XLISP does not check when read-macro  expansions (like #x0FF) are out of
  6874. bounds.  It gives no error  message and will just truncate the number to
  6875. the  low-order  bits  that it can deal  with  (usually  32 bits or 8 hex
  6876. digits).
  6877.  
  6878.  
  6879. lognot
  6880. ________________________________________________________________________
  6881.  
  6882. type: function (subr) 
  6883. location: built-in
  6884. source file: xlmath.c
  6885. Common LISP compatible: yes
  6886. supported on: all machines
  6887.  
  6888. SYNTAX
  6889.  
  6890. (lognot  <expr> )
  6891.     <expr>        -    an integer expression
  6892.  
  6893. DESCRIPTION
  6894.  
  6895. The LOGNOT  function  returns the  logical  (bitwise)  INVERSION  of the
  6896. expression.
  6897.  
  6898. EXAMPLES
  6899.  
  6900.     (lognot 255)                ; returns -256
  6901.     (lognot #xffff0000)            ; returns 65535
  6902.     (lognot #x00000000)            ; returns -1
  6903.     (lognot 1)                ; returns -2
  6904.  
  6905.     (logand (lognot 256) 65535)        ; returns 65279
  6906.     (lognot #xFFFFFFFE)            ; returns 1
  6907.     (lognot #xFFFFFFFC)            ; returns 3
  6908.  
  6909. NOTE:
  6910. XLISP does not check when read-macro  expansions (like #x0FF) are out of
  6911. bounds.  It gives no error  message and will just truncate the number to
  6912. the  low-order  bits  that it can deal  with  (usually  32 bits or 8 hex
  6913. digits).
  6914.  
  6915.  
  6916. logxor
  6917. ________________________________________________________________________
  6918.  
  6919. type: function (subr) 
  6920. location: built-in
  6921. source file: xlmath.c
  6922. Common LISP compatible: yes
  6923. supported on: all machines
  6924.  
  6925. SYNTAX
  6926.  
  6927. (logxor  <expr1> ... )
  6928.     <exprN>        -    an integer expression
  6929.  
  6930. DESCRIPTION
  6931.  
  6932. The LOGXOR function  returns the logical  (bitwise)  EXCLUSIVE-OR of the
  6933. list of  expressions.  If there is only  one  argument,  it is  returned
  6934. unaltered.  If there  are two or more  arguments,  the  LOGXOR  function
  6935. performs the exclusive-or successively applying the bitwise operation.
  6936.  
  6937. EXAMPLES
  6938.  
  6939.     (logxor 0 0)                ; returns 0
  6940.     (logxor 0 1)                ; returns 1
  6941.     (logxor 1 0)                ; returns 1
  6942.     (logxor 1 1)                ; returns 0
  6943.     (logxor #b0011 #b0101)            ; returns 6 
  6944.      (logxor 255 #xF0)            ; returns 15
  6945.     (logxor 255 #x0F)            ; returns 240
  6946.     (logxor 255 (logxor 255 99))        ; returns 99
  6947.  
  6948. NOTE:
  6949. XLISP does not check when read-macro  expansions (like #x0FF) are out of
  6950. bounds.  It gives no error  message and will just truncate the number to
  6951. the  low-order  bits  that it can deal  with  (usually  32 bits or 8 hex
  6952. digits).
  6953.  
  6954.  
  6955. loop
  6956. ________________________________________________________________________
  6957.  
  6958. type: special form (fsubr)
  6959. location: built-in
  6960. source file: xlcont.c
  6961. Common LISP compatible: yes
  6962. supported on: all machines
  6963.  
  6964. SYNTAX
  6965.  
  6966. (loop  <body> ...  )
  6967.     <body>        -    a series of expressions
  6968.  
  6969. DESCRIPTION
  6970.  
  6971. The LOOP  special  form  specifies  a  'repeat-forever'  construct.  The
  6972. expressions  in <body> will be evaluated.  When the last  expression  is
  6973. evaluated in <body>, LOOP will then repeat the <body>.  When a RETURN is
  6974. evaluated  within a LOOP, the  specified  value will be  returned.  LOOP
  6975. itself does not generate a return value.  Other exit mechanisms  include
  6976. GO, THROW, RETURN-FROM and errors.
  6977.  
  6978. EXAMPLES
  6979.  
  6980.     (setq i 65)                ; initial value
  6981.     (loop                    ; LOOP
  6982.         (princ (int-char i) )        ;   print the character
  6983.         (if (= i 90) (return "done"))    ;   test for limit
  6984.         (setq i (1+ i) ) )        ;   increment and repeat
  6985.                         ; prints
  6986.                         ;   ABCDEFGHIJKLMNOPQRSTUVWXYZ
  6987.                         ; returns "done"
  6988.  
  6989. NOTE:
  6990. If you create a LOOP with no exit  mechanism,  you will probably have to
  6991. abort your XLISP session.
  6992.  
  6993.  
  6994. lower-case-p
  6995. ________________________________________________________________________
  6996.  
  6997. type: predicate function (subr) 
  6998. location: built-in
  6999. source file: xlstr.c 
  7000. Common LISP compatible: yes
  7001. versions: all machines
  7002.  
  7003. SYNTAX
  7004.  
  7005. (lower-case-p <char> )
  7006.     <char>        -    a character expression
  7007.  
  7008. DESCRIPTION
  7009.  
  7010. The LOWER-CASE-P  predicate  checks if the <char>  expression is a lower
  7011. case  character.  If <char> is lower case a T is  returned,  otherwise a
  7012. NIL is returned.  Lower case characters are 'a' (ASCII decimal value 97)
  7013. through 'z' (ASCII decimal value 122).
  7014.  
  7015. EXAMPLES
  7016.  
  7017.     (lower-case-p #\a)            ; returns T
  7018.     (lower-case-p #\A)            ; returns NIL
  7019.     (lower-case-p #\1)            ; returns NIL
  7020.     (lower-case-p #\[)            ; returns NIL
  7021.  
  7022.  
  7023. macroexpand
  7024. ________________________________________________________________________
  7025.  
  7026. type: function (subr) 
  7027. location: built-in
  7028. source file: xlbfun.c
  7029. Common LISP compatible: similar
  7030. supported on: all machines
  7031.  
  7032. SYNTAX
  7033.  
  7034. (macroexpand <form> )
  7035.     <form>        -    a macro form
  7036.  
  7037. DESCRIPTION
  7038.  
  7039. The  MACROEXPAND  function  takes a <form> and  recursively  expands the
  7040. macro   definitions  used  in  the  <form>.  The  function  returns  the
  7041. expansion.  If the <form> does not contain a macro, the form is returned
  7042. unaltered.
  7043.  
  7044. EXAMPLES
  7045.  
  7046.     (defmacro plus (n1 n2) `(+ ,n1 ,n2))    ; define PLUS macro
  7047.     (plus 1 2)                ; returns 3
  7048.     (macroexpand '(plus 3 4))        ; returns (+ 3 4)
  7049.  
  7050.     (defmacro pl (p1 p2) `(plus ,p1 ,p2))    ; define PL macro using PLUS
  7051.     (pl 3 4)                ; returns 7
  7052.     (macroexpand '(pl 3 4))            ; returns (+ 3 4)
  7053.     (macroexpand-1 '(pl 3 4))        ; returns (PLUS 3 4)
  7054.  
  7055. COMMON LISP COMPATABILITY:
  7056. Common  LISP  returns  2 values  for its  result  of  MACROEXPAND  - the
  7057. expanded  form and a T or NIL value that  indicates  if the <form> was a
  7058. macro.  XLISP returns only the expanded form.
  7059.  
  7060. COMMON LISP COMPATABILITY:
  7061. Common  LISP  supports  an  optional  argument  in  MACROEXPAND  for the
  7062. environment  of the  expansion.  XLISP does not  support  this  optional
  7063. argument.
  7064.  
  7065.  
  7066. macroexpand-1
  7067. ________________________________________________________________________
  7068.  
  7069. type: function (subr) 
  7070. location: built-in
  7071. source file: xlbfun.c
  7072. Common LISP compatible: similar
  7073. supported on: all machines
  7074.  
  7075. SYNTAX
  7076.  
  7077. (macroexpand-1 <form> )
  7078.     <form>        -    a macro form
  7079.  
  7080. DESCRIPTION
  7081.  
  7082. The MACROEXPAND-1 function takes a <form> and expands the first level of
  7083. the macro  definition  used in the  <form>.  The  function  returns  the
  7084. expansion.  If the <form> does not contain a macro, the form is returned
  7085. unaltered.
  7086.  
  7087. EXAMPLES
  7088.  
  7089.     (defmacro plus (n1 n2) `(+ ,n1 ,n2))    ; define PLUS macro
  7090.     (plus 1 2)                ; returns 3
  7091.     (macroexpand '(plus 3 4))        ; returns (+ 3 4)
  7092.     (macroexpand-1 '(plus 3 4))        ; returns (+ 3 4)
  7093.  
  7094.     (defmacro pl (p1 p2) `(plus ,p1 ,p2))    ; define PL macro using PLUS
  7095.     (pl 3 4)                ; returns 7
  7096.     (macroexpand '(pl 3 4))            ; returns (+ 3 4)
  7097.     (macroexpand-1 '(pl 3 4))        ; returns (PLUS 3 4)
  7098.  
  7099. COMMON LISP COMPATABILITY:
  7100. Common  LISP  returns 2 values  for its  result of  MACROEXPAND-1  - the
  7101. expanded  form and a T or NIL value that  indicates  if the <form> was a
  7102. macro.  XLISP returns only the expanded form.
  7103.  
  7104. COMMON LISP COMPATABILITY:
  7105. Common LISP  supports an  optional  argument  in  MACROEXPAND-1  for the
  7106. environment  of the  expansion.  XLISP does not  support  this  optional
  7107. argument.
  7108.  
  7109.  
  7110. macrolet
  7111. ________________________________________________________________________
  7112.  
  7113. type: special form (fsubr)
  7114. location: built-in
  7115. source file: xlcont.c
  7116. Common LISP compatible: yes
  7117. supported on: all machines
  7118.  
  7119. SYNTAX
  7120.  
  7121. (macrolet  ( [ <macro> ... ]  ) <expr> ... )
  7122.     <macro>        -    a macro definition binding which is of the 
  7123.                 form  ( <symbol> <arg-list> <body> )
  7124.     <symbol>    -    the symbol specifying the function name
  7125.     <arg-list>    -    the argument list for the function 
  7126.     <body>        -    the body of the function
  7127.     <expr>        -    an expression
  7128.  
  7129. DESCRIPTION
  7130.  
  7131. The  MACROLET  special  form is basically a local block  construct  that
  7132. allows  local  <macro>  definitions  followed  by a  block  of  code  to
  7133. evaluate.  The first form after the macrolet is the 'binding'  form.  It
  7134. contains  a series of  <macro>s.  The  MACROLET  form will  sequentially
  7135. execute the <expr>'s after defining the <macro>s.  The value of the last
  7136. <expr> evaluated is returned.  When the MACROLET is finished  execution,
  7137. the <symbol>'s that were defined will no longer exist.
  7138.  
  7139. EXAMPLES
  7140.  
  7141.                         ; a MACROLET form including
  7142.     (macrolet ((pls (n1 n2) `(+ ,n1 ,n2)))    ;  PLS macro
  7143.       (pls 4 5))                ;  returns 9
  7144.                         ; the PLS macro no longer exists
  7145.     (pls 4 5)                ; error: unbound function - PLS
  7146.  
  7147.                         ; an empty MACROLET
  7148.     (macrolet () (print 'a))        ; prints A
  7149.  
  7150.  
  7151. make-array
  7152. ________________________________________________________________________
  7153.  
  7154. type: function (subr) 
  7155. location: built-in
  7156. source file: xlbfun.c
  7157. Common LISP compatible: similar
  7158. supported on: all machines
  7159.  
  7160. SYNTAX
  7161.  
  7162. (make-array <size> )
  7163.     <size>        -    the size (integer) of the array to be created
  7164.  
  7165. DESCRIPTION
  7166.  
  7167. MAKE-ARRAY creates an array of the specified size and returns the array.
  7168. Array  elements  may be any valid  lisp data type -  including  lists or
  7169. arrays.  Arrays  made by  MAKE-ARRAY  and  accessed  by AREF are base 0.
  7170. This means the first  element is  accessed  by element  number 0 and the
  7171. last  element is  accessed  by element  number n-1 (where n is the array
  7172. size).  Array elements are initialized to NIL.
  7173.  
  7174. EXAMPLES
  7175.     (setq my-array (make-array 16))        ; make the array
  7176.     (aref my-array 0)            ; return 0th (first) element
  7177.     (aref my-array 15)            ; return 15th (last) element
  7178.     (aref my-array 16)            ; error: non existant element
  7179.     (dotimes (i 16)             ; set each element to its index
  7180.          (setf (aref my-array i) i))    ;     by the setf function
  7181.  
  7182.     (setq new (make-array 4))        ; make another array
  7183.     (setf (aref new 0) (make-array 4))    ; make new[0] an array of 4
  7184.     (setf (aref (aref new 0) 1) 'a)        ; set new[0,1] = 'a
  7185.     (setf (aref new 2) '(a b c))        ; set new[2] = '(a b c)
  7186.     my-array                ; look at array
  7187.  
  7188. READ MACRO:
  7189. There is a built-in  read-macro  for arrays - # (the hash symbol).  This
  7190. allows you to create  arbitrary arrays with initial values without going
  7191. through a  MAKE-ARRAY  function.  There is also the VECTOR  function  to
  7192. create initialized arrays.  For example:
  7193.  
  7194.     (aref #(0 1 2) 1)            ; returns 1
  7195.  
  7196. COMMON LISP COMPATABILITY:
  7197. XLISP  only  supports   one-dimensional  arrays.  Common  LISP  supports
  7198. multi-dimension  arrays.  Common  LISP  also  supports  various  keyword
  7199. parameters that are not supported in XLISP.
  7200.  
  7201.  
  7202. make-string-input-stream
  7203. ________________________________________________________________________
  7204.  
  7205. type: function (subr) 
  7206. location: built-in
  7207. source file: xlfio.c
  7208. Common LISP compatible: yes
  7209. supported on: all machines
  7210.  
  7211. SYNTAX
  7212.  
  7213. (make-string-input-stream <string> [ <start-pos> [ <end-pos> ] ] )
  7214.     <string>    -    a string expression
  7215.     <start-pos>    -    an optional numeric expression, default value
  7216.                 is 0 (giving the first character of the string)
  7217.     <end-pos>    -    an optional numeric expression, default value
  7218.                 is the length of the string
  7219.  
  7220. DESCRIPTION
  7221.  
  7222. The MAKE-STRING-INPUT-STREAM function creates an unnamed stream from the
  7223. <string>  expression.  The stream  can then be used as any other  stream
  7224. object.  The optional  <start-pos>  expression  specifies  the  starting
  7225. offset of the <string>  expression.  A <start-pos>  of 0 will start with
  7226. the  beginning  of  the  <string>.  The  optional  <end-pos>  expression
  7227. specifies the ending offset of the <string>  expression.  A <end-pos> of
  7228. 4 will  make  the  fourth  character  the  last  in the  stream.  If the
  7229. function is  successful,  it returns the unnamed stream  object.  If the
  7230. string is empty, an unnamed stream is still returned.  Error  conditions
  7231. include <start-pos> and <end-pos> being out of bounds.
  7232.  
  7233. EXAMPLES
  7234.  
  7235.     (make-string-input-stream "abcdefgh")    ; returns #<Unnamed-Stream: #277e2>
  7236.     (read (make-string-input-stream     ;
  7237.              "123456"))            ; returns 123456
  7238.     (read (make-string-input-stream     ;
  7239.              "123456" 1))            ; returns 23456
  7240.     (read (make-string-input-stream     ;
  7241.              "123456" 1 3))            ; returns 23
  7242.  
  7243.     (read (make-string-input-stream     ;
  7244.              "123" 0))            ; returns 123
  7245.     (read (make-string-input-stream     ;
  7246.              "123" 0 3))            ; returns 123
  7247.     (read (make-string-input-stream     ;
  7248.              "123" 2 1))            ; returns NIL
  7249.     (read (make-string-input-stream     ;
  7250.              "123" 0 4))            ; error: string index out of 
  7251.                          ;        bounds - 4
  7252.  
  7253.  
  7254. make-string-output-stream
  7255. ________________________________________________________________________
  7256.  
  7257. type: function (subr) 
  7258. location: built-in
  7259. source file: xlfio.c
  7260. Common LISP compatible: yes
  7261. supported on: all machines
  7262.  
  7263. SYNTAX
  7264.  
  7265. (make-string-output-stream)
  7266.  
  7267.  
  7268. DESCRIPTION
  7269.  
  7270. The  MAKE-STRING-OUTPUT-STREAM  function  creates and returns an unnamed
  7271. output stream.  The stream can then be used as any other stream  object.
  7272.  
  7273.  
  7274. EXAMPLES
  7275.  
  7276.     (make-string-output-stream)        ; returns #<Unnamed-Stream: #2d9c0>
  7277.     (setq out (make-string-output-stream))    ; returns #<Unnamed-Stream: #2d95c>
  7278.     (format out "fee fi fo fum ")        ; \
  7279.     (format out "I smell the blood of ")    ;  fill up output stream
  7280.     (format out "Elmer Fudd")        ; /
  7281.     (get-output-stream-string out)        ; returns 
  7282.                         ;    "fee fi fo fum I smell
  7283.                         ;       the blood of Elmer Fudd"
  7284.     (format out "~%now what")        ; add more to output stream
  7285.     (get-output-stream-string out)        ; returns "\nnow what"
  7286.     (format out "hello")            ; add more to output stream
  7287.     (read out)                ; returns HELLO
  7288.  
  7289.  
  7290. make-symbol
  7291. ________________________________________________________________________
  7292.  
  7293. type: function (subr) 
  7294. location: built-in
  7295. source file: xlbfun.c
  7296. Common LISP compatible: yes
  7297. supported on: all machines
  7298.  
  7299. SYNTAX
  7300.  
  7301. (make-symbol <symbol-str> )
  7302.     <symbol-str>    -    a string expression
  7303.  
  7304. DESCRIPTION
  7305.  
  7306. The MAKE-SYMBOL  function takes a string name - <symbol-str> and creates
  7307. a new symbol.  This symbol is  temporary  and is not  interned  (placed)
  7308. into the symbol hash table  *OBARRAY*.  If the symbol already exists, no
  7309. error or action is taken and the old values and  property  lists  remain
  7310. intact.  The MAKE-SYMBOL function returns the symbol as its result.
  7311.  
  7312. EXAMPLES
  7313.  
  7314.     (defun lookin (sym)             ; create a function to 
  7315.        (aref *obarray*             ;   look inside *OBARRAY*
  7316.              (hash sym (length *obarray*))));   and look for a specific
  7317.                         ;   symbol - returns a list
  7318.  
  7319.     (lookin "FEE")                ; returns (CHAR-INT NTH ++) 
  7320.                         ;   FEE symbol doesn't exist
  7321.     (MAKE-SYMBOL "FEE")            ; returns FEE symbol
  7322.     (lookin "FEE")                ; returns (CHAR-INT NTH ++) 
  7323.                         ;   FEE still doesn't exist
  7324.     (intern "FEE")                ; intern FEE symbol
  7325.     (lookin "FEE")                ; returns (FEE CHAR-INT NTH ++) 
  7326.                         ;   FEE does now exist
  7327.  
  7328. NOTE:
  7329. When you  MAKE-SYMBOL  a symbol  like  "fingers",  this is a lower  case
  7330. symbol.  Note  that  this  is  different  from  doing a  MAKE-SYMBOL  on
  7331. "FINGERS".  "fingers" and "FINGERS" are two different symbols.  Remember
  7332. also that normal symbols created by XLISP are upper case names.
  7333.  
  7334.  
  7335. makunbound
  7336. ________________________________________________________________________
  7337.  
  7338. type: defined function (closure)
  7339. location: extension
  7340. source file: init.lsp
  7341. Common LISP compatible: yes
  7342. supported on: all machines
  7343.  
  7344. SYNTAX
  7345.  
  7346. (makunbound  <symbol> )
  7347.     <symbol>    -    an expression evaluating to a symbol
  7348.  
  7349. DESCRIPTION
  7350.  
  7351. The  MAKUNBOUND  function makes a symbol's value  unbound.  The <symbol>
  7352. must be a valid  symbol,  but it does  not  need  to have a  value.  The
  7353. MAKUNBOUND function returns the symbol as its result.
  7354.  
  7355. EXAMPLES
  7356.  
  7357.     (makunbound 'florp)            ; returns FLORP
  7358.     (setq myvar "hi")            ; setup MYVAR "hi"
  7359.     myvar                    ; returns "hi"
  7360.     (makunbound 'myvar)            ; returns MYVAR
  7361.     myvar                    ; error: unbound variable
  7362.  
  7363. NOTE:
  7364. MAKUNBOUND is not misspelled - there is no 'e' in it.
  7365.  
  7366. NOTE:
  7367. The  FMAKUNBOUND  works on  functions  (closures)  in the same way  that
  7368. MAKUNBOUND  works on variables.  Be sure to use the correct one for what
  7369. you are unbinding.  These  functions do not generate an error if you try
  7370. to unbind the wrong  type.  This is because of the  definition  of these
  7371. functions  and the fact that the function and  variable  name spaces are
  7372. separate.  You can have both a function called FOO and a variable called
  7373. FOO.
  7374.  
  7375. NOTE:
  7376. The function MAKUNBOUND is created in the INIT.LSP file.  If it does not
  7377. exist in your XLISP system, you might be having a problem with INIT.LSP.
  7378. Before you start XLISP, look in the directory you are currently  in, and
  7379. check to see if there is an INIT.LSP.
  7380.  
  7381.  
  7382. mapc
  7383. ________________________________________________________________________
  7384.  
  7385. type: function (subr) 
  7386. location: built-in
  7387. source file: xllist.c
  7388. Common LISP compatible: yes
  7389. supported on: all machines
  7390.  
  7391. SYNTAX
  7392.  
  7393. (mapc <function> <list1> [ <list2> ... ] )
  7394.     <function>    -    a function definition (like a LAMBDA) 
  7395.                 or a function name
  7396.     <listN>        -    a list or list expression
  7397.  
  7398. DESCRIPTION
  7399.  
  7400. MAPC applies the  <function> to the succesive  CARs of each of the lists
  7401. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7402. The MAPC  function  returns a list that is  equivalent to the first list
  7403. <list1>.  It's purpose is to perform operations that have  side-effects.
  7404. If the lists are of different  lengths, the shortest list will determine
  7405. the number of applications of <function>.
  7406.  
  7407. EXAMPLES
  7408.  
  7409.     (mapc 'princ '(hi there bob))        ; prints HITHEREBOB
  7410.                         ;   returns (HI THERE BOB)
  7411.  
  7412.     (mapc '+ '(1 2 3) '(1 2 3))        ; returns (1 2 3)
  7413.                         ;   there were no side effects
  7414.  
  7415.     (mapc (lambda (x y) (print (+ x y)))    ; define fun. with side effects
  7416.           '(1 2 3) '(1 2 3))        ;   prints 2 4 6 
  7417.                         ;   returns (1 2 3)
  7418.  
  7419. NOTE:
  7420. The use of the <function>  will work properly when it is a quoted symbol
  7421. (which is the name of the function), an unquoted  symbol (whose value is
  7422. a function) or a closure object (like a LAMBDA).
  7423.  
  7424.  
  7425. mapcan
  7426. ________________________________________________________________________
  7427.  
  7428. type: defined macro (closure)
  7429. location: extension
  7430. source file: init.lsp
  7431. Common LISP compatible: yes
  7432. supported on: all machines
  7433.  
  7434. SYNTAX
  7435.  
  7436. (mapcan <function> <list1> [ <list2> ... ] )
  7437.     <function>    -    a function definition (like a LAMBDA) 
  7438.                 or a function name
  7439.     <listN>        -    a list or list expression
  7440.  
  7441. DESCRIPTION
  7442.  
  7443. MAPCAN applies the <function> to the succesive CARs of each of the lists
  7444. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7445. MAPCAN is similar to MAPCAR, except that the MAPCAN macro returns a list
  7446. that is constructed via the destructive  NCONC function from the results
  7447. of the <function>  applications.  If the lists are of different lengths,
  7448. the  shortest  list  will  determine  the  number  of  applications   of
  7449. <function>.
  7450.  
  7451. EXAMPLES
  7452.  
  7453.     (mapcar 'list '(1 2 3) '(a b c) )    ; returns ((1 A) (2 B) (3 C))
  7454.     (mapcan 'list '(1 2 3) '(a b c) )    ; returns (1 A 2 B 3 C)
  7455.     (mapcan 'list '(a b c)             ; different length lists
  7456.            '(1 2 3 4 5 6))        ;   returns (A 1 B 2 C 3)
  7457.  
  7458. NOTE:
  7459. Remember that MAPCAN uses NCONC and so it deals with its list  arguments
  7460. destructively.  It is often  used when you want to  remove  NIL  entries
  7461. from the resulting list - because NCONC will take out the NILs.
  7462.  
  7463. NOTE:
  7464. The use of the <function>  will work properly when it is a quoted symbol
  7465. (which is the name of the function), an unquoted  symbol (whose value is
  7466. a function) or a closure object (like a LAMBDA).
  7467.  
  7468. NOTE:
  7469. The macros MAPCAN and MAPCON are created in the INIT.LSP  file.  If they
  7470. do not exist in your XLISP  system,  you might be having a problem  with
  7471. INIT.LSP.  Before  you  start  XLISP,  look  in the  directory  you  are
  7472. currently in, and check to see if there is an INIT.LSP.
  7473.  
  7474.  
  7475. mapcar
  7476. ________________________________________________________________________
  7477.  
  7478. type: function (subr) 
  7479. location: built-in
  7480. source file: xllist.c
  7481. Common LISP compatible: yes
  7482. supported on: all machines
  7483.  
  7484. SYNTAX
  7485.  
  7486. (mapcar <function> <list1> [ <list2> ... ] )
  7487.     <function>    -    a function definition (like a LAMBDA) 
  7488.                 or a function name
  7489.     <listN>        -    a list or list expression
  7490.  
  7491. DESCRIPTION
  7492.  
  7493. MAPCAR applies the <function> to the succesive CARs of each of the lists
  7494. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7495. The MAPCAR function  returns a list that is constructed from the results
  7496. of the <function>  applications.  If the lists are of different lengths,
  7497. the  shortest  list  will  determine  the  number  of  applications   of
  7498. <function>.
  7499.  
  7500. EXAMPLES
  7501.  
  7502.     (mapcar '+ '(1 2 3) '(1 2 3))        ; returns (2 4 6)
  7503.     (mapcar 'princ '(1 2 3))        ; prints 123
  7504.                         ;   returns (1 2 3)
  7505.     (mapcar '+ '(1 2 3)             ; different length lists
  7506.            '(1 2 3 4 5 6))        ;   returns (2 4 6)
  7507.  
  7508. NOTE:
  7509. The use of the <function>  will work properly when it is a quoted symbol
  7510. (which is the name of the function), an unquoted  symbol (whose value is
  7511. a function) or a closure object (like a LAMBDA).
  7512.  
  7513.  
  7514. mapcon
  7515. ________________________________________________________________________
  7516.  
  7517. type: defined macro (closure)
  7518. location: extension
  7519. source file: init.lsp
  7520. Common LISP compatible: yes
  7521. supported on: all machines
  7522.  
  7523. SYNTAX
  7524.  
  7525. (mapcon <function> <list1> [ <list2> ... ] )
  7526.     <function>    -    a function definition (like a LAMBDA) 
  7527.                 or a function name
  7528.     <listN>        -    a list or list expression
  7529.  
  7530. DESCRIPTION
  7531.  
  7532. MAPCON  applies the  <function>  to the  successive  CDRs of each of the
  7533. lists  <listN>.  Each of the  lists  supplies  one of the  arguments  to
  7534. <function>.  The MAPCON macro is similar to the MAPLIST function, except
  7535. that MAPCON returns a list that is constructed via the destructive NCONC
  7536. function from the results of the <function>  applications.  If the lists
  7537. are of different lengths, the shortest list will determine the number of
  7538. applications of <function>.
  7539.  
  7540. EXAMPLES
  7541.  
  7542.     (maplist 'list '(a b))            ; returns (((A B)) ((B)))
  7543.     (mapcon  'list '(a b))            ; returns ((A B) (B))
  7544.  
  7545. NOTE:
  7546. Remember that MAPCON uses NCONC and so it  destructively  deals with its
  7547. list arguments.
  7548.  
  7549. NOTE:
  7550. The use of the <function>  will work properly when it is a quoted symbol
  7551. (which is the name of the function), an unquoted  symbol (whose value is
  7552. a function) or a closure object (like a LAMBDA).
  7553.  
  7554. NOTE:
  7555. The macros MAPCAN and MAPCON are created in the INIT.LSP  file.  If they
  7556. do not exist in your XLISP  system,  you might be having a problem  with
  7557. INIT.LSP.  Before  you  start  XLISP,  look  in the  directory  you  are
  7558. currently in, and check to see if there is an INIT.LSP.
  7559.  
  7560.  
  7561. mapl
  7562. ________________________________________________________________________
  7563.  
  7564. type: function (subr) 
  7565. location: built-in
  7566. source file: xllist.c
  7567. Common LISP compatible: yes
  7568. supported on: all machines
  7569.  
  7570. SYNTAX
  7571.  
  7572. (mapl <function> <list1> [ <list2> ... ] )
  7573.     <function>    -    a function definition (like a LAMBDA) 
  7574.                 or a function name
  7575.     <listN>        -    a list or list expression
  7576.  
  7577. DESCRIPTION
  7578.  
  7579. MAPL applies the <function> to the successive  CDRs of each of the lists
  7580. <listN>.  Each of the lists supplies one of the arguments to <function>.
  7581. The MAPL  function  returns a list that is  equivalent to the first list
  7582. <list1>.  It's purpose is to perform operations that have  side-effects.
  7583. If the lists are of different  lengths, the shortest list will determine
  7584. the number of applications of <function>.
  7585.  
  7586. EXAMPLES
  7587.  
  7588.     (mapl 'print '(a b c))            ; prints (A B C)
  7589.                         ;        (B C)
  7590.                         ;        (C)
  7591.                         ; returns (A B C)
  7592.  
  7593.     (mapl (lambda (x y) (princ x) (princ y)    ; apply lambda fun. to list
  7594.                 (terpri))        ;
  7595.           '(a b c) '(1 2 3))        ; prints (A B C)(1 2 3)
  7596.                         ;        (B C)(2 3)
  7597.                         ;        (C)(3)
  7598.                         ; returns (A B C)
  7599.  
  7600. NOTE:
  7601. The use of the <function>  will work properly when it is a quoted symbol
  7602. (which is the name of the function), an unquoted  symbol (whose value is
  7603. a function) or a closure object (like a LAMBDA).
  7604.  
  7605.  
  7606. maplist
  7607. ________________________________________________________________________
  7608.  
  7609. type: function (subr) 
  7610. location: built-in
  7611. source file: xllist.c
  7612. Common LISP compatible: yes
  7613. supported on: all machines
  7614.  
  7615. SYNTAX
  7616.  
  7617. (maplist <function> <list1> [ <list2> ... ] )
  7618.     <function>    -    a function definition (like a LAMBDA) 
  7619.                 or a function name
  7620.     <listN>        -    a list or list expression
  7621.  
  7622. DESCRIPTION
  7623.  
  7624. MAPLIST  applies the  <function> to the  successive  CDRs of each of the
  7625. lists  <listN>.  Each of the  lists  supplies  one of the  arguments  to
  7626. <function>.  The  MAPLIST  function  returns a list that is  constructed
  7627. from the  results of the  <function>  applications.  If the lists are of
  7628. different  lengths,  the  shortest  list will  determine  the  number of
  7629. applications of <function>.
  7630.  
  7631. EXAMPLES
  7632.  
  7633.     (maplist 'print '(a b c))        ; prints (A B C)
  7634.                         ;        (B C)
  7635.                         ;        (C)
  7636.                         ; returns ((A B C) (B C) (C))
  7637.  
  7638.     (maplist (lambda (x y)             ; append the lists into one    
  7639.              (length (append x y)))    ;   list and find it's length
  7640.          '(a b c d) '(1 2 3 4))        ; returns (8 6 4 2)
  7641.  
  7642. NOTE:
  7643. The use of the <function>  will work properly when it is a quoted symbol
  7644. (which is the name of the function), an unquoted  symbol (whose value is
  7645. a function) or a closure object (like a LAMBDA).
  7646.  
  7647.  
  7648. max
  7649. ________________________________________________________________________
  7650.  
  7651. type: function (subr) 
  7652. location: built-in
  7653. source file: xlmath.c
  7654. Common LISP compatible: yes
  7655. supported on: all machines
  7656.  
  7657. SYNTAX
  7658.  
  7659. (max <expr1> ... )
  7660.     <exprN>        -    integer or floating point number/expression
  7661.  
  7662. DESCRIPTION
  7663.  
  7664. The MAX function returns the largest numeric expression from the list of
  7665. arguments.
  7666.  
  7667. EXAMPLES
  7668.  
  7669.     (max 1)                    ; returns 1
  7670.     (max 1 -5 9)                ; returns 9
  7671.  
  7672.     (setq a '( 9 3 5 2))            ; set up a list - (9 3 5 2)
  7673.     (apply 'max a)                ; returns 9
  7674.     (apply #'max a)                ; returns 9
  7675.     (apply 'min a)                ; returns 2
  7676.  
  7677.  
  7678. member
  7679. ________________________________________________________________________
  7680.  
  7681. type: function (subr) 
  7682. location: built-in
  7683. source file: xllist.c
  7684. Common LISP compatible: similar
  7685. supported on: all machines
  7686.  
  7687. SYNTAX
  7688.  
  7689. (member <expr> <list-expr> [ { :test | :test-not } <test> ] )
  7690.     <expr>        -    the expression to find - an atom or list
  7691.     <list-expr>    -    the list to search
  7692.     <test>        -    optional test function (default is EQL)
  7693.  
  7694. DESCRIPTION
  7695.  
  7696. MEMBER  searches  through  <list-expr>  for  <expr>.  If  found,  MEMBER
  7697. returns the  remainder  of the  <list-expr>  starting  with  <expr>.  If
  7698. <expr> is not found, a NIL is  returned.  You may specify  your own test
  7699. with the :TEST and :TEST-NOT  keywords followed by the test you which to
  7700. perform.
  7701.  
  7702. EXAMPLES
  7703.  
  7704.     (member 'a '(1 2 3 4))            ; returns NIL
  7705.     (member '2 '(1 2 3 4))            ; returns (2 3 4)
  7706.  
  7707.     (setq mylist '(2 4 8 16 32 64 128 256))    ; make a numeric list
  7708.     (member 6 mylist :test '<)        ; returns (8 16 32 64 128 256)
  7709.     (member 6 (reverse mylist) :test-not '<); returns (4 2)
  7710.     (member '20 '(60 40 20 10) :test '> )    ; returns (10)
  7711.  
  7712.     (member '(a) '((see) (a) (cat))     ; returns ((A) (CAT))
  7713.               :test 'equal)        ;   note EQUAL as test
  7714.     (member "hi" '("a" "hi" "c")         ; returns ("hi" "c")
  7715.         :test 'string= )        ;   note STRING= as test
  7716.  
  7717.  
  7718. NOTE:
  7719. The  MEMBER  function  can work  with a list or  string  as the  <expr>.
  7720. However, the default EQL test does not work with lists or strings,  only
  7721. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  7722. keyword along with EQUAL for <test>.
  7723.  
  7724. COMMON LISP COMPATABILITY:
  7725. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  7726. function  that is applied to each  element of  <list-expr>  before it is
  7727. tested.  XLISP does not support this.
  7728.  
  7729.  
  7730.  
  7731. :mescape
  7732. ________________________________________________________________________
  7733.  
  7734. type: keyword
  7735. location: built-in
  7736. source file: xlread.c
  7737. Common LISP compatible: no
  7738. supported on: all machines
  7739.  
  7740. SYNTAX
  7741.  
  7742. :mescape
  7743.  
  7744.  
  7745. DESCRIPTION
  7746.  
  7747. :MESCAPE is an entry that is used in the  *READTABLE*.  *READTABLE* is a
  7748. system  variable that contains  XLISP's data structures  relating to the
  7749. processing  of  characters  from  the  user (or  files)  and  read-macro
  7750. expansions.  The  existance  of the  :MESCAPE  keyword  means  that  the
  7751. specified  character is to be used as a multiple escape  character.  The
  7752. system  defines  that  the the  vertical  bar  character  | is the  only
  7753. :MESCAPE character.
  7754.  
  7755. EXAMPLES
  7756.  
  7757.     (defun look-at (table)            ; define a function to 
  7758.      (dotimes (ch 127)            ;   look in a table
  7759.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  7760.         (case entry             ;   entries with a function
  7761.           (:MESCAPE             ;
  7762.               (princ (int-char ch)))    ;
  7763.           (T        NIL))))        ;
  7764.      (terpri))                ;
  7765.     (look-at *readtable*)            ;  prints  | 
  7766.  
  7767. CAUTION:
  7768. If you experiment  with  *READTABLE*, it is useful to save the old value
  7769. in a variable, so that you can restore the system state.
  7770.  
  7771.  
  7772. min
  7773. ________________________________________________________________________
  7774.  
  7775. type: function (subr) 
  7776. location: built-in
  7777. source file: xlmath.c
  7778. Common LISP compatible: yes
  7779. supported on: all machines
  7780.  
  7781. SYNTAX
  7782.  
  7783. (min <expr1> ... )
  7784.     <exprN>        -    integer or floating point number/expression
  7785.  
  7786. DESCRIPTION
  7787.  
  7788. The MIN  function  returns the  minimum  (most  negative or most  nearly
  7789. negative) numeric expression from the list of arguments.
  7790.  
  7791. EXAMPLES
  7792.  
  7793.     (min 1)                    ; returns 1
  7794.     (min 8 7 4 2)                ; returns 2
  7795.     (min 2 3 -1 -99)            ; returns -99
  7796.     (setq a '( 9 3 5 2))            ; make a numeric list - (9 3 5 2)
  7797.     (apply 'min a)                ; returns 2
  7798.     (apply #'min a)                ; returns 2
  7799.     (apply 'max a)                ; returns 9
  7800.  
  7801.  
  7802. minusp
  7803. ________________________________________________________________________
  7804.  
  7805. type: predicate function (subr)
  7806. location: built-in
  7807. source file: xlmath.c
  7808. Common LISP compatible: yes
  7809. supported on: all machines
  7810.  
  7811. SYNTAX
  7812.  
  7813. (minusp <expr> )
  7814.     <expr>        -    the numeric expression to check
  7815.  
  7816. DESCRIPTION
  7817.  
  7818. The MINUSP predicate  checks to see if the number <expr> is negative.  T
  7819. is returned if the number is negative  (less than zero), NIL is returned
  7820. otherwise.  A bad argument  type error is generated if the <expr> is not
  7821. a numeric expression.
  7822.  
  7823. EXAMPLES
  7824.  
  7825.     (minusp 1)                ; returns NIL
  7826.     (minusp 0)                ; returns NIL
  7827.     (minusp -1)                ; returns T
  7828.     (minusp -.000000005)            ; returns T
  7829.     (minusp #xFFFFFFFF)            ; returns T
  7830.     (minusp #x01)                ; returns NIL
  7831.  
  7832.     (minusp 'a)                ; error: bad argument type
  7833.     (setq a -3.5)                ; set A to -3.5
  7834.     (minusp a)                ; returns T
  7835.  
  7836.  
  7837. nconc
  7838. ________________________________________________________________________
  7839.  
  7840. type: function (subr) 
  7841. location: built-in
  7842. source file: xllist.c
  7843. Common LISP compatible: yes
  7844. supported on: all machines
  7845.  
  7846. SYNTAX
  7847.  
  7848. (nconc [ <list1> ... ] )
  7849.     <listN>        -    a list to DESTRUCTIVELY concatenate
  7850.  
  7851. DESCRIPTION
  7852.  
  7853. NCONC  destructively  concatenates  a sequence of lists and returns  the
  7854. result of this concatentation.  The destructive aspect of this operation
  7855. means  that the  actual  symbol  values  are used in the  list-modifying
  7856. operations  - not  copies.  This  means, for  NCONC,  that the lists are
  7857. spliced  together.  <listN> must  evaluate to a valid list.  An atom for
  7858. <listN> will result in an error.  NIL is a valid <listN>.
  7859.  
  7860. EXAMPLES
  7861.  
  7862.     (setq a '(1 2 3))            ; set up A with (1 2 3)
  7863.     (setq b '(4 5 6))            ; set up B with (4 5 6)
  7864.     (setq c '(7 8 9))            ; set up C with (7 8 9)
  7865.     (NCONC a b c)                ; returns (1 2 3 4 5 6 7 8 9)
  7866.     (setf (nth 8 a) 'end)            ; change last element of A
  7867.     (print a)                ; prints (1 2 3 4 5 6 7 8 END)
  7868.     (print b)                ; prints (4 5 6 7 8 END)
  7869.     (print c)                ; prints (7 8 END)
  7870.  
  7871.  
  7872. :new
  7873. ________________________________________________________________________
  7874.  
  7875. type: message selector
  7876. location: built-in
  7877. source file: xlobj.c
  7878. Common LISP compatible: no
  7879. supported on: all machines
  7880.  
  7881. SYNTAX
  7882.  
  7883. (send <class> :new <args> )
  7884.     <class>        -    an existing XLISP class except for 'CLASS'
  7885.     <args>        -    the init. args for the new instance 
  7886. (send class :new <ivars> [ <cvars> [ <superclass> ] ] )
  7887.     <ivars>        -    list of instance variables for new class
  7888.     <cvars>        -    list of class variable symbols for new class
  7889.     <superclass>    -    superclass for new object 
  7890.                 (the default is 'OBJECT')
  7891.  
  7892. DESCRIPTION
  7893.  
  7894. The :NEW message selector exhibits 2 different  behaviors.  When you are
  7895. creating  an  instance  of a  class  you  only  need  the  :NEW  message
  7896. (consisting  of the  message  selector  and  any  data).  When  you  are
  7897. creating a new class with :NEW, you need to specify  instance  variables
  7898. and optionally the class variables and superclass.
  7899.  
  7900. EXAMPLES
  7901.     (setq new-class             ; create NEW-CLASS with STATE
  7902.         (send class :new '(state)))    ;
  7903.     (setq new-obj (send new-class :new))    ; create NEW-OBJ of NEW-CLASS
  7904.     (send new-obj :show)            ; shows the object
  7905.     (setq sub-class             ; create SUB-CLASS of NEW-CLASS
  7906.         (send class :new '(sub-state)     ;
  7907.                  '() new-class));
  7908.     (send sub-class :show)            ; show the SUB-CLASS
  7909.  
  7910. nil
  7911. ________________________________________________________________________
  7912.  
  7913. type: system constant
  7914. location: built-in
  7915. source file: xlsym.c
  7916. Common LISP compatible: yes
  7917. supported on: all machines
  7918.  
  7919. SYNTAX
  7920.  
  7921. nil
  7922.  
  7923. DESCRIPTION
  7924.  
  7925. The NIL  constant  represents  the empty  list or the  false  value - as
  7926. oppossed  to the true value (the  symbol T).  NIL can be writen as the 3
  7927. character symbol NIL or as the empty list ().
  7928.  
  7929. EXAMPLES
  7930.     (setq myvar NIL)            ; set MYVAR to False
  7931.     (setq myvar 'NIL)            ; NIL and 'NIL evaluate to NIL    
  7932.     (setq myvar ())                ; () is the empty list = NIL
  7933.     (setq myvar '())            ; () and '() evaluate to NIL
  7934.     (if nil (print "this won't print")    ; if/then/else
  7935.             (print "this will print"))
  7936.  
  7937. NOTE:
  7938. You can not change the value of NIL.
  7939.  
  7940.  
  7941. :nmacro
  7942. ________________________________________________________________________
  7943.  
  7944. type: keyword
  7945. location: built-in
  7946. source file: xlread.c
  7947. Common LISP compatible: no
  7948. supported on: all machines
  7949.  
  7950. SYNTAX
  7951.  
  7952. (:nmacro  .  <function> )
  7953.     <function>    -    a function
  7954.  
  7955. DESCRIPTION
  7956.  
  7957. :NMACRO is an entry that is used in the  *READTABLE*.  *READTABLE*  is a
  7958. system  variable that contains  XLISP's data structures  relating to the
  7959. processing  of  characters  from  the  user (or  files)  and  read-macro
  7960. expansions.  The  existance  of  the  :NMACRO  keyword  means  that  the
  7961. specified character is the start of a non-terminal  macro.  For :NMACRO,
  7962. the form of the  *READTABLE*  entry is a dotted  pair  like  (:NMACRO  .
  7963. <function> ).  The <function> can be a built-in read-macro function or a
  7964. user defined lambda expression.  The <function> takes two parameters, an
  7965. input stream  specification, and an integer that is the character value.
  7966. The <function>  should return NIL if the character is 'white-space' or a
  7967. value CONSed with NIL to return the value.  The <function> will probably
  7968. read additional characters from the input stream.
  7969.  
  7970. EXAMPLES
  7971.  
  7972.     (defun look-at (table)            ; define a function to 
  7973.      (dotimes (ch 127)            ;   look in a table
  7974.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  7975.             (if (and (consp entry)        ;   :NMACRO entries
  7976.                      (equal (car entry)     ;
  7977.                     ':NMACRO))    ;
  7978.               (princ (int-char ch)))))    ;
  7979.      (terpri))                ;
  7980.                          ;
  7981.     (look-at *readtable*)            ;  prints  #
  7982.  
  7983. NOTE:
  7984. The system defines that the hash (#) character is a  non-terminal.  This
  7985. is because  the hash is used for a variety  of 'read  macro  expansions'
  7986. including FUNCTION, an ASCII code, and hexadecimal numbers.
  7987.  
  7988. CAUTION:
  7989. If you experiment  with  *READTABLE*, it is useful to save the old value
  7990. in a variable, so that you can restore the system state.
  7991.  
  7992.  
  7993. nodebug
  7994. ________________________________________________________________________
  7995.  
  7996. type: defined function (closure) 
  7997. location: extension
  7998. source file: init.lsp
  7999. Common LISP compatible: no
  8000. supported on: all machines
  8001.  
  8002. SYNTAX
  8003.  
  8004. (nodebug)
  8005.  
  8006.  
  8007. DESCRIPTION
  8008.  
  8009. The NODEBUG function sets  *BREAKENABLE* to NIL.  This has the effect of
  8010. turning off the break loop for errors.  NODEBUG always returns NIL.  The
  8011. default is DEBUG enabled.
  8012.  
  8013. EXAMPLES
  8014.  
  8015.     (nodebug)                ; returns NIL
  8016.     (+ 1 "a")                ; error: bad argument type
  8017.                         ; but doesn't enter break-loop
  8018.     (debug)                    ; returns T
  8019.     (+ 1 "a")                ; error: bad argument type
  8020.                         ; enters break-loop
  8021.     (clean-up)                ; from within the break-loop
  8022.  
  8023. NOTE:
  8024. The  functions  DEBUG and NODEBUG are created in the INIT.LSP  file.  If
  8025. they do not exist in your  XLISP  system,  you might be having a problem
  8026. with  INIT.LSP.  Before you start XLISP, look in the  directory  you are
  8027. currently in, and check to see if there is an INIT.LSP.
  8028.  
  8029.  
  8030. not
  8031. ________________________________________________________________________
  8032.  
  8033. type: predicate function (subr)
  8034. location: built-in
  8035. source file: xlbfun.c
  8036. Common LISP compatible: yes
  8037. supported on: all machines
  8038.  
  8039. SYNTAX
  8040.  
  8041. (not <expr> )
  8042.     <expr>        -    the expression to check
  8043.  
  8044. DESCRIPTION
  8045.  
  8046. The NOT  predicate  checks to see if the <expr> is false.  T is returned
  8047. if the expression is NIL, NIL is returned otherwise.
  8048.  
  8049. EXAMPLES
  8050.  
  8051.     (not '())                ; returns T - empty list
  8052.     (not ())                ; returns T - still empty
  8053.     (setq a NIL)                ; set up a variable
  8054.     (not a)                    ; returns T - value = empty list
  8055.  
  8056.     (not "a")                ; returns NIL - not a list
  8057.     (not 'a)                ; returns NIL - not a list
  8058.  
  8059. NOTE:
  8060. The NOT predicate is the same function as the NULL predicate.  
  8061.  
  8062.  
  8063. nstring-downcase
  8064. ________________________________________________________________________
  8065.  
  8066. type: function (subr) 
  8067. location: built-in
  8068. source file: xlstr.c
  8069. Common LISP compatible: yes
  8070. supported on: all machines
  8071.  
  8072. SYNTAX
  8073.  
  8074. (nstring-downcase <string> [ { :start | :end } <offset> ] ... )
  8075.     <string>    -    a string expression
  8076.     <offset>    -    an optional integer expression (for a keyword)
  8077.  
  8078. DESCRIPTION
  8079.  
  8080. The NSTRING-DOWNCASE function takes a string argument and makes it lower
  8081. case.  This function  modifies the string (or string variable  itself) -
  8082. it does not just make a copy.  The lower case string is returned.
  8083.  
  8084. The keyword  arguments allow for accessing  substrings  within <string>.
  8085. The  keyword  arguments  require a keyword  (:START or :END) first and a
  8086. single  integer  expression  second.  The :START  keyword  specifies the
  8087. starting offset for the NSTRING-DOWNCASE operation on <string>.  A value
  8088. of 0 starts the string at the  beginning  (no offset).  The :END keyword
  8089. specifies the end offset for the operation on <string>.
  8090.  
  8091. EXAMPLES
  8092.  
  8093.     (nstring-downcase "ABcd+-12&[")        ; returns "abcd+-&["
  8094.     (nstring-downcase "ABCDEFGH"         ;
  8095.              :start 2 :end 4)    ; returns "ABcdEFGH"
  8096.  
  8097.     (setq mystr "ABcdEFgh")            ; set up variable
  8098.     (nstring-downcase mystr)        ; returns "abcdefgh"
  8099.     (print mystr)                ; prints  "abcdefgh"
  8100.                         ; note that MYSTR is modified
  8101.  
  8102.  
  8103. nstring-upcase
  8104. ________________________________________________________________________
  8105.  
  8106. type: function (subr) 
  8107. location: built-in
  8108. source file: xlstr.c
  8109. Common LISP compatible: yes
  8110. supported on: all machines
  8111.  
  8112. SYNTAX
  8113.  
  8114. (nstring-upcase <string> [ { :start | :end } <offset> ] ... )
  8115.     <string>    -    a string expression
  8116.     <offset>    -    an optional integer expression (for a keyword)
  8117.  
  8118. DESCRIPTION
  8119.  
  8120. The  NSTRING-UPCASE  function takes a string argument and makes it upper
  8121. case.  This function  modifies the string (or string variable  itself) -
  8122. it does not just make a copy.  The upper case string is returned.
  8123.  
  8124. The keyword  arguments allow for accessing  substrings  within <string>.
  8125. The  keyword  arguments  require a keyword  (:START or :END) first and a
  8126. single  integer  expression  second.  The :START  keyword  specifies the
  8127. starting offset for the  NSTRING-UPCASE  operation on <string>.  A value
  8128. of 0 starts the string at the  beginning  (no offset).  The :END keyword
  8129. specifies the end offset for the operation on <string>.
  8130.  
  8131. EXAMPLES
  8132.  
  8133.     (nstring-upcase "ABcd+-12&[")        ; returns "ABCD+-&["
  8134.     (nstring-upcase "abcdefgh"         ;
  8135.              :start 2 :end 4)    ; returns "abCDefgh"
  8136.  
  8137.     (setq mystr "ABcdEFgh")            ; set up variable
  8138.     (nstring-upcase mystr)            ; returns "ABCDEFGH"
  8139.     (print mystr)                ; prints  "ABCDEFGH"
  8140.                         ; note that MYSTR is modified
  8141.  
  8142.  
  8143. nth
  8144. ________________________________________________________________________
  8145.  
  8146. type: function (subr) 
  8147. location: built-in
  8148. source file: xllist.c
  8149. Common LISP compatible: yes
  8150. supported on: all machines
  8151.  
  8152. SYNTAX
  8153.  
  8154. (nth <expr> <list-expr> )
  8155.     <expr>        -    an integer expression
  8156.     <list-expr>    -    a list or list expression
  8157.  
  8158. DESCRIPTION
  8159.  
  8160. NTH returns the <expr>'th element of <list-expr>.  If the <list-expr> is
  8161. shorter than <expr>, a NIL is  returned.  The counting  sequence is base
  8162. zero - the first element is the 0th element.
  8163.  
  8164. EXAMPLES
  8165.  
  8166.     (nth 4 '(0 1 2 3 4 5 6))        ; returns 4
  8167.     (nth 3 '(a b))                ; returns NIL
  8168.  
  8169.     (nth 4 'a)                ; error: bad argument type 
  8170.     (nth 3 "abcdefg")            ; error: bad argument type 
  8171.  
  8172.  
  8173. nthcdr
  8174. ________________________________________________________________________
  8175.  
  8176. type: function (subr) 
  8177. location: built-in
  8178. source file: xllist.c
  8179. Common LISP compatible: yes
  8180. supported on: all machines
  8181.  
  8182. SYNTAX
  8183.  
  8184. (nthcdr <expr> <list-expr> )
  8185.     <expr>        -    an integer expression
  8186.     <list-expr>    -    a list or list expression
  8187.  
  8188. DESCRIPTION
  8189.  
  8190. NTHCDR returns the <expr>'th CDR of  <list-expr>.  If the <list-expr> is
  8191. shorter than <expr>, a NIL is  returned.  The counting  sequence is base
  8192. zero - the first element is the 0th element.
  8193.  
  8194. EXAMPLES
  8195.  
  8196.     (nthcdr 4 '(0 1 2 3 4 5 6))        ; returns (4 5 6)
  8197.     (nthcdr 3 '(a b))            ; returns NIL
  8198.  
  8199.     (nthcdr 4 'a)                ; error: bad argument type
  8200.  
  8201.  
  8202. null
  8203. ________________________________________________________________________
  8204.  
  8205. type: predicate function (subr)
  8206. location: built-in
  8207. source file: xlbfun.c
  8208. Common LISP compatible: yes
  8209. supported on: all machines
  8210.  
  8211. SYNTAX
  8212.  
  8213. (null <expr> )
  8214.     <expr>        -    the expression to check
  8215.  
  8216. DESCRIPTION
  8217.  
  8218. The NULL  predicate  checks  <expr> for an empty list.  T is returned if
  8219. the list is empty, NIL is returned  otherwise.  The <expr> does not have
  8220. to be a valid  list, but if it is not a list then NIL is returned as the
  8221. result.
  8222.  
  8223. EXAMPLES
  8224.  
  8225.     (null '())                ; returns T - empty list
  8226.     (null ())                ; returns T - still empty
  8227.     (setq a NIL)                ; set up a variable
  8228.     (null a)                ; returns T - value = empty list
  8229.  
  8230.     (null "a")                ; returns NIL - not a list
  8231.     (null 'a)                ; returns NIL - not a list
  8232.  
  8233. NOTE:
  8234. The NULL predicate is the same function as the NOT predicate.
  8235.  
  8236.  
  8237. numberp
  8238. ________________________________________________________________________
  8239.  
  8240. type: predicate function (subr)
  8241. location: built-in
  8242. source file: xlbfun.c
  8243. Common LISP compatible: yes
  8244. supported on: all machines
  8245.  
  8246. SYNTAX
  8247.  
  8248. (numberp <expr> )
  8249.     <expr>        -    the expression to check
  8250.  
  8251. DESCRIPTION
  8252.  
  8253. The NUMBERP predicate checks if an <expr> is a number.  T is returned if
  8254. <expr>  is  an  integer  or  floating  point  number,  NIL  is  returned
  8255. otherwise.
  8256.  
  8257. EXAMPLES
  8258.  
  8259.     (numberp 1)                ; returns T - integer
  8260.     (numberp 1.2)                ; returns T - float
  8261.     (numberp '1)                ; returns T - still an integer
  8262.     (numberp #x034)                ; returns T - readmacro produces
  8263.                         ;             an integer
  8264.  
  8265.     (numberp 'a)                ; returns NIL - symbol
  8266.     (numberp #\a)                ; returns NIL - character
  8267.     (numberp NIL)                ; returns NIL - NIL
  8268.     (numberp #(0 1 2))            ; returns NIL - array 
  8269.  
  8270.  
  8271. *obarray*
  8272. ________________________________________________________________________
  8273.  
  8274. type: system variable
  8275. location: built-in
  8276. source file: xlsym.c
  8277. Common LISP compatible: no
  8278. supported on: all machines
  8279.  
  8280. SYNTAX
  8281.  
  8282. *obarray*
  8283.  
  8284.  
  8285. DESCRIPTION
  8286.  
  8287. *OBARRAY* is the system  variable that contains the system symbol table.
  8288. This symbol table is an XLISP array that is constructed out of lists.
  8289.  
  8290. EXAMPLES
  8291.  
  8292.     (defun lookin (sym)             ; create a function to 
  8293.        (aref *obarray*             ;   look inside *OBARRAY*
  8294.              (hash sym (length *obarray*))));   and look for a specific
  8295.                            ;   symbol - returns a list
  8296.                         ;
  8297.     (lookin "CAR")                ; returns (TEST PEEK CAR)
  8298.     (lookin "car")                ; returns NIL
  8299.  
  8300. NOTE:
  8301. When looking into  *OBARRAY* or INTERNing  symbols,  remember that "car"
  8302. and "CAR" are two  different  symbols in *OBARRAY*.  Remember  also that
  8303. normal  symbols  created by XLISP are upper case names.  So, if you type
  8304. in "car" as a normal  symbol, it will be the  symbol  "CAR"  after  this
  8305. normal upper-casing operation.
  8306.  
  8307.  
  8308. object
  8309. ________________________________________________________________________
  8310.  
  8311. type: object 
  8312. location: built-in
  8313. source file: xlobj.c
  8314. Common LISP compatible: no
  8315. supported on: all machines
  8316.  
  8317. SYNTAX
  8318.  
  8319. object
  8320.  
  8321.  
  8322. DESCRIPTION
  8323.  
  8324. OBJECT is an object  class.  An object  is a  composite  structure  that
  8325. contains   internal  state   information,   methods  (which  respond  to
  8326. messages), a pointer to the object's class and a pointer to the object's
  8327. super-class.  XLISP  contains  two built in  objects:  OBJECT and CLASS.
  8328. OBJECT is the superclass for the CLASS object.
  8329.  
  8330. EXAMPLES
  8331.     (send object :show)            ; look at the object definition
  8332.  
  8333.                         ; example use of objects
  8334.     (setq my-class                 ; new class MY-CLASS with STATE
  8335.         (send class :new '(state)))    ;
  8336.     (send my-class :answer :isnew '()    ; set up initialization
  8337.         '((setq state nil) self))    ;
  8338.     (send my-class :answer :set-it '(value)    ; create :SET-IT message
  8339.         '((setq state value)))        ;
  8340.     (setq my-obj (send my-class :new))    ; create MY-OBJ out of MY-CLASS
  8341.     (send my-obj :set-it 5)            ; STATE is set to 5
  8342.  
  8343. OBJECT DEFINITION:
  8344. The internal definition of the OBJECT object instance is:
  8345.  
  8346.     Object is #<Object: #23fd8>, Class is #<Object: #23fe2>
  8347.       MESSAGES = ((:SHOW . #<Subr-: #23db2>) 
  8348.                 (:CLASS . #<Subr-: #23dee>) 
  8349.               (:ISNEW . #<Subr-: #23e2a>))
  8350.       IVARS = NIL
  8351.       CVARS = NIL
  8352.       CVALS = NIL
  8353.       SUPERCLASS = NIL
  8354.       IVARCNT = 0
  8355.       IVARTOTAL = 0
  8356.     #<Object: #23fd8>
  8357.  
  8358. The  class of  OBJECT  is  CLASS.  There  is no  superclass  of  OBJECT.
  8359. Remember that the location  information (like #23fd8) varies from system
  8360. to system, yours will probably look different.
  8361.  
  8362. BUILT-IN METHODS:
  8363. The built in methods in XLISP include:
  8364.  
  8365.         <message>    operation
  8366.         -------------------------------------------------------
  8367.         :ANSWER        Add a method to an object.
  8368.         :CLASS        Return the object's class.
  8369.         :ISNEW        Run initialization code on object.
  8370.         :NEW        Create a new object (instance or class).
  8371.         :SHOW        Show the internal state of the object.
  8372.  
  8373. MESSAGE STRUCTURE:
  8374. The normal XLISP  convention  for a <message> is to have a valid  symbol
  8375. preceeded  by a  colon  like  :ISNEW  or  :MY-MESSAGE.  However,  it  is
  8376. possible  to define a  <message>  that is a symbol  without a colon, but
  8377. this makes the code less readable.
  8378.  
  8379.  
  8380. objectp
  8381. ________________________________________________________________________
  8382.  
  8383. type: predicate function (subr)
  8384. location: built-in
  8385. source file: xlbfun.c
  8386. Common LISP compatible: no
  8387. supported on: all machines
  8388.  
  8389. SYNTAX
  8390.  
  8391. (objectp  <expr> )
  8392.     <expr>        -    the expression to check
  8393.  
  8394. DESCRIPTION
  8395.  
  8396. The OBJECTP  predicate checks if the <expr> is an object.  T is returned
  8397. if <expr> is an object, NIL is returned otherwise.
  8398.  
  8399. EXAMPLES
  8400.  
  8401.     (objectp object)            ; returns T
  8402.     (objectp class)                ; returns T
  8403.     (objectp NIL)                ; returns NIL
  8404.     (objectp '(a b))            ; returns NIL
  8405.  
  8406.  
  8407. oddp
  8408. ________________________________________________________________________
  8409.  
  8410. type: predicate function (subr)
  8411. location: built-in
  8412. source file: xlmath.c
  8413. Common LISP compatible: yes
  8414. supported on: all machines
  8415.  
  8416. SYNTAX
  8417.  
  8418. (oddp <expr> )
  8419.     <expr>        -    the integer numeric expression to check
  8420.  
  8421. DESCRIPTION
  8422.  
  8423. The ODDP  predicate  checks  to see if the  number  <expr> is odd.  T is
  8424. returned  if the  number  is  odd,  NIL  is  returned  otherwise.  A bad
  8425. argument  type  error  is  generated  if the  <expr>  is  not a  numeric
  8426. expression.  A bad floating  point  operation is generated if the <expr>
  8427. is a floating point number.  Zero is an even number.
  8428.  
  8429. EXAMPLES
  8430.  
  8431.     (oddp 0)                ; returns NIL
  8432.     (oddp 1)                ; returns T
  8433.     (oddp 2)                ; returns NIL
  8434.     (oddp -1)                ; returns T
  8435.     (oddp -2)                ; returns NIL
  8436.  
  8437.     (oddp 13.0)                ; error: bad flt. pt. op.
  8438.     (oddp 'a)                ; error: bad argument type
  8439.     (setq a 3)                ; set value of A to 3
  8440.     (oddp a)                ; returns T
  8441.  
  8442.  
  8443. open
  8444. ________________________________________________________________________
  8445.  
  8446. type: function (subr) 
  8447. location: built-in
  8448. source file: xlfio.c
  8449. Common LISP compatible: yes
  8450. supported on: all machines
  8451.  
  8452. SYNTAX
  8453.  
  8454. (open  <file> [ :direction <in-out> ]  )
  8455.     <file>        -    a string expression or symbol 
  8456.     <in-out>    -    an optional keyword symbol that must either
  8457.                 :INPUT or :OUTPUT.  The default is :INPUT.
  8458.  
  8459. DESCRIPTION
  8460.  
  8461. The OPEN function  opens the <file> for input or output.  The <file> may
  8462. be a string  expression  or a symbol.  Following the <file>, there is an
  8463. optional  keyword,  :DIRECTION.  The argument  following  this is either
  8464. :INPUT or :OUTPUT  which  specifies  the  direction  of the file.  If no
  8465. :DIRECTION  is  specified,  the  default  is  :INPUT.  When  <file> is a
  8466. string, you may specify a complete  file  location or  extensions  (like
  8467. "/usr/local/bin/myfile.lsp" or "A:\LISP\TIM.BAT").  If the file open was
  8468. successful, then a file pointer of the form #<File:  #99999> is returned
  8469. as the result.  If the file open was not  successful, a NIL is returned.
  8470. For an input file, the file has to exist, or an error will be  signaled.
  8471.  
  8472. EXAMPLES
  8473.  
  8474.     (setq f (open 'mine :direction :output)); create file MINE
  8475.     (print "hi" f)                ; returns "hi"
  8476.     (close f)                ; file contains <hi>   <NL>
  8477.     (setq f (open 'mine :direction :input))    ; open MYFILE for input
  8478.     (read f)                ; returns "hi"    
  8479.     (close f)                ; close it
  8480.  
  8481. FILE NAMES:
  8482. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  8483. automatically made uppercase.  In using XLISP, this means you don't have
  8484. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  8485. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  8486. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  8487. if you do a (open 'foo-file :direction :output), this will create a file
  8488. named  "FOO-FILE"  because  XLISP  uppercases  its symbols.  If you do a
  8489. (open  "foo-file"  :direction  :output),  this will  create a file named
  8490. "foo-file"  because UNIX doesn't uppercase its file names.  Another case
  8491. is if you do (savefun mydefun), this will create the file "MYDEFUN.lsp".
  8492. So, if you are having trouble with opening and accessing files, check to
  8493. make sure the file name is in the proper case.
  8494.  
  8495. COMMON LISP COMPATABILITY:
  8496. Common LISP supports  bidirectional files.  So, porting Common LISP code
  8497. may be difficult to port if it uses these other file types.
  8498.  
  8499.  
  8500. &optional
  8501. ________________________________________________________________________
  8502.  
  8503. type: keyword
  8504. location: built-in
  8505. source file: xleval.c
  8506. Common LISP compatible: similar
  8507. supported on: all machines
  8508.  
  8509. SYNTAX
  8510.  
  8511. &optional [ <opt-arg> | ( <opt-arg> [ <opt-value> [ <opt-symbol> ] ] ) ] ...
  8512.     <opt-arg>    -    optional argument
  8513.     <opt-value>    -    optional argument initialization
  8514.     <exist-symbol>    -    optional argument existence symbol
  8515.  
  8516. DESCRIPTION
  8517.  
  8518. In XLISP, there are several times that you define a formal argument list
  8519. for a body of code (like DEFUN,  DEFMACRO,  :ANSWER and LAMBDA).  All of
  8520. the formal  arguments  that are  defined are  required  to appear in the
  8521. invocation  of the  defined  function  or  operation.  If there  are any
  8522. &OPTIONAL arguments defined, they will be filled in order.  If there are
  8523. insufficient  parameters for the &OPTIONAL  arguments, they will contain
  8524. NIL, unless the arguments have an <opt-value>  initial value  specified.
  8525. The  <exist-symbol>,  if  it  is  specified,  will  contain  a T if  the
  8526. <opt-arg>  was  supplied  by the  function  call and a NIL if it was not
  8527. supplied  by  the  function   call.  This   <exist-symbol>   allows  the
  8528. programmer  to  test  for an  arguments  existence.  At  the  end of the
  8529. function or operation  execution,  these local  symbols and their values
  8530. are are removed.
  8531.  
  8532. EXAMPLES
  8533.  
  8534.     (defun foo                 ; define function FOO
  8535.       (a &optional b (c 1) )        ;   with some optional args
  8536.       (print a) (print b) (print c))    ;
  8537.     (foo)                    ; error: too few arguments 
  8538.     (foo 1)                    ; prints 1 NIL 1
  8539.     (foo 1 2)                ; prints 1 2 1
  8540.     (foo 1 2 3)                ; prints 1 2 3 
  8541.  
  8542.     (defun fee                ; define function FEE
  8543.       (a &optional (b 9 b-passed) )        ;   with some optional args
  8544.       (print a) (print b)            ;
  8545.       (if b-passed (print "b was passed")    ;
  8546.                    (print "b not passed")))    ;
  8547.     (fee 1)                    ; prints 1 9 "b not passed"
  8548.     (fee 1 2)                ; prints 1 2 "b was passed"
  8549.  
  8550.  
  8551. or
  8552. ________________________________________________________________________
  8553.  
  8554. type: special form (fsubr)
  8555. location: built-in
  8556. source file: xlcont.c
  8557. Common LISP compatible: yes
  8558. supported on: all machines
  8559.  
  8560. SYNTAX
  8561.  
  8562. (or  [ <expr1> ... ] )
  8563.     <exprN>        -    an expression
  8564.  
  8565. DESCRIPTION
  8566.  
  8567. The OR special form evaluates a sequence of expressions  and returns the
  8568. effect of a logical  INCLUSIVE-OR  operation on the expressions.  If all
  8569. of the expressions  are NIL, NIL is returned as OR's result.  Evaluation
  8570. of the expressions  will stop when an expression  evaluates to something
  8571. other than NIL, none of the  subsequent  expressions  will be evaluated.
  8572. If there are no expressions, OR returns NIL as its result.
  8573.  
  8574. EXAMPLES
  8575.  
  8576.     (or NIL NIL NIL)            ; returns NIL
  8577.     (or NIL T NIL)                ; returns T
  8578.     (or NIL (princ "hi") (princ "ho"))    ; prints  hi  and returns "hi"
  8579.     (or T T T)                ; returns T
  8580.     (or)                    ; returns NIL
  8581.  
  8582.     (setq a 5)  (setq b 6)            ; set up A and B
  8583.     (if (or (< a b) (< b a))        ; if 
  8584.        (print "not equal")            ;  then
  8585.        (print "equal"))            ;  else
  8586.                         ; prints  "not equal"
  8587.  
  8588.  
  8589. peek
  8590. ________________________________________________________________________
  8591.  
  8592. type: function (subr) 
  8593. location: built-in
  8594. source file: xlsys.c
  8595. Common LISP compatible: no
  8596. supported on: all machines
  8597.  
  8598. SYNTAX
  8599.  
  8600. (peek <address> )
  8601.     <address>    -    an integer expression
  8602.  
  8603. DESCRIPTION
  8604.  
  8605. The PEEK function  returns the internal  memory value at the  <address>.
  8606. The returned value is an integer.
  8607.  
  8608. EXAMPLES
  8609.  
  8610.     (setq var 0)                ; set up VAR with 0
  8611.     (address-of var)            ; returns 123224
  8612.     (address-of 'var)            ; returns 161922
  8613.     (peek (address-of var))            ; returns 83951616
  8614.     (peek (1+ (address-of var)))        ; returns 16777216
  8615.     (peek (+ 2 (address-of var)))        ; returns 0  <-- value of VAR
  8616.     (setq var 14)                ; change the value to 14
  8617.     (peek (+ 2 (address-of var)))        ; returns 14
  8618.     (setq var 99)                ; change the value to 99
  8619.     (peek (+ 2 (address-of var)))        ; returns 99
  8620.  
  8621. CAUTION:
  8622. Be careful  when  modifying  the  internal  state of XLISP.  If you have
  8623. modified it, it would be a good idea to exit XLISP and  re-enter  before
  8624. doing any work you really want to retain.
  8625.  
  8626. ADDITIONAL CAUTION:
  8627. It is possible to PEEK and POKE not just XLISP's  memory put other parts
  8628. of your  computer's  memory.  Be very careful when doing this.  Also, in
  8629. some  computers,  just looking at a memory  location can cause things to
  8630. happen - I/O locations fall in this category.
  8631.  
  8632.  
  8633. peek-char
  8634. ________________________________________________________________________
  8635.  
  8636. type: function (subr) 
  8637. location: built-in
  8638. source file: xlfio.c  
  8639. Common LISP compatible: similar
  8640. supported on: all machines
  8641.  
  8642. SYNTAX
  8643.  
  8644. (peek-char  [ <skip-flag>  [ <source> ] ]  )
  8645.     <skip-flag>    -    an optional expression - default is NIL
  8646.     <source>    -    an optional source - must be a file pointer
  8647.                 or stream, the default is *standard-input*
  8648.  
  8649. DESCRIPTION
  8650.  
  8651. The PEEK-CHAR  function looks at a single  character  from the specified
  8652. <source>.  The character  looked-at is returned as an integer  value for
  8653. the  result.  If the  <skip-flag>  expression  is  NIL,  then  the  next
  8654. character will be looked-at,  without  advancing the position within the
  8655. file.  If  the   <skip-flag>   expression  is  non-NIL,  then  the  next
  8656. non-white-space character will be looked-at.  This skipping does advance
  8657. the position within the file.  White-space characters include blank, tab
  8658. and new-line  characters.  If <skip-flag>  is not used, no skipping will
  8659. occur.  The <source>  may be a file pointer or a stream.  If there is no
  8660. <source>,   *STANDARD-INPUT*  is  the  default.  If  an  end-of-file  is
  8661. encountered in the <source>, then NIL will be returned as the result.
  8662.  
  8663. EXAMPLES
  8664.  
  8665.     (setq fp (open "f" :direction :output))    ; create file "f"
  8666.     (print 12 fp)                ;
  8667.     (princ "  34" fp)  (terpri fp)        ;
  8668.     (close fp)                ;
  8669.                         ;
  8670.     (setq fp (open "f" :direction :input))    ; open "f" for reading
  8671.     (peek-char NIL fp)            ; returns #\1
  8672.     (peek-char NIL fp)            ; returns #\1 - didn't advance
  8673.     (read-char fp)                ; returns #\1 - force advance
  8674.     (peek-char NIL fp)            ; returns #\2
  8675.     (read-char fp)                ; returns #\2 - force advance
  8676.     (peek-char NIL fp)            ; returns #\Newline
  8677.     (peek-char T fp)            ; returns #\3 - skipped blanks
  8678.     (read-line fp)                ; returns "34"
  8679.     (close fp)                ;
  8680.  
  8681. COMMON LISP COMPATABILITY:
  8682. The XLISP and Common LISP PEEK-CHAR  functions are compatable for simple
  8683. cases.  They both  allow  for the  optional  <skip-flag>  and  <source>.
  8684. However, in Common LISP, there are addition parameters which occur right
  8685. after <source> that support various end-of-file operations and recursive
  8686. calls.  So, when porting from Common LISP to XLISP,  remember  there are
  8687. additional  arguments in Common LISP's  PEEK-CHAR that are not supported
  8688. in XLISP.
  8689.  
  8690.  
  8691. plusp
  8692. ________________________________________________________________________
  8693.  
  8694. type: predicate function (subr)
  8695. location: built-in
  8696. source file: xlmath.c
  8697. Common LISP compatible: yes
  8698. supported on: all machines
  8699.  
  8700. SYNTAX
  8701.  
  8702. (plusp <expr> )
  8703.     <expr>        -    the numeric expression to check
  8704.  
  8705. DESCRIPTION
  8706.  
  8707. The PLUSP  predicate  checks to see if the number <expr> is positive.  T
  8708. is returned if the number is positive  (greater than 0), NIL is returned
  8709. otherwise.  A bad argument  type error is generated if the <expr> is not
  8710. a numeric expression.
  8711.  
  8712. EXAMPLES
  8713.  
  8714.     (plusp 0)                ; returns NIL
  8715.     (plusp 1)                ; returns T
  8716.     (plusp -1)                ; returns NIL
  8717.     (plusp #xFFFFFFFF)            ; returns NIL
  8718.     (plusp #x0FFFFFFF)            ; returns T
  8719.  
  8720.     (plusp 'a)                ; error: bad argument type
  8721.     (setq a 4)                ; set value of A to 4
  8722.     (plusp a)                ; returns T
  8723.  
  8724.  
  8725. poke
  8726. ________________________________________________________________________
  8727.  
  8728. type: function (subr) 
  8729. location: built-in
  8730. source file: xlsys.c
  8731. Common LISP compatible: no
  8732. supported on: all machines
  8733.  
  8734. SYNTAX
  8735.  
  8736. (poke  <address>  <expr> )
  8737.     <address>    -    an integer expression
  8738.     <expr>        -    an integer expression
  8739.  
  8740. DESCRIPTION
  8741.  
  8742. The POKE function  writes the <expr> at the internal memory value at the
  8743. specified  <address>.  The  returned  value is <expr>.  Be very  careful
  8744. with this function.
  8745.  
  8746. EXAMPLES
  8747.  
  8748.     (setq var 0)                ; set up VAR with 0
  8749.     (address-of var)            ; returns 123224
  8750.     (address-of 'var)            ; returns 161922
  8751.     (peek (address-of var))            ; returns 83951616
  8752.     (peek (1+ (address-of var)))        ; returns 16777216
  8753.     (peek (+ 2 (address-of var)))        ; returns 0  <-- value of VAR
  8754.     (setq var 14)                ; change the value to 14
  8755.     (peek (+ 2 (address-of var)))        ; returns 14
  8756.     (poke (+ 2 (address-of var)) 1023)    ; POKE the value to 1023
  8757.     (print var)                ; prints  1023
  8758.  
  8759. CAUTION:
  8760. Be careful  when  modifying  the  internal  state of XLISP.  If you have
  8761. modified it, it would be a good idea to exit XLISP and  re-enter  before
  8762. doing any work you really want to retain.
  8763.  
  8764. ADDITIONAL CAUTION:
  8765. It is possible to PEEK and POKE not just XLISP's  memory but other parts
  8766. of your  computer's  memory.  Be very careful when doing this.  Also, in
  8767. some  computers,  just looking at a memory  location can cause things to
  8768. happen - I/O locations fall in this category.
  8769.  
  8770.  
  8771. pp
  8772. ________________________________________________________________________
  8773.  
  8774. type: function (subr)
  8775. location: extension 
  8776. source file: pp.lsp
  8777. Common LISP compatible: no
  8778. supported on: all machines
  8779.  
  8780. SYNTAX
  8781.  
  8782. (pp  <expr> [ <destination>  [ <break-size> ] ] )
  8783.     <expr>        -    an expression to be pretty printed
  8784.     <destination>    -    an optional destination - must be a file pointer
  8785.                 or stream, the default is *standard-output*
  8786.     <break-size>    -    an integer expression - default is 45
  8787.  
  8788. DESCRIPTION
  8789.  
  8790. The PP  function  produces a pretty  looking  version of the  <expr> and
  8791. prints it to the specified  <destination>.  If <expr> is an atom (like a
  8792. string, a  symbol,  a number,  etc.)  PP will  print it like  PRINT.  If
  8793. <expr> is a list, it will  perform  indenting.  T is always  returned as
  8794. the result of PP.  The  <destination> may be a file pointer or a stream.
  8795. If there is no <destination>  (or it is NIL),  *STANDARD-OUTPUT*  is the
  8796. default.  The  <break-size>  paramter  is  used  to  determine  when  an
  8797. expression   should  be  broken  into   multiple   lines.  The   default
  8798. <break-size> is 45.
  8799.  
  8800. EXAMPLES
  8801.  
  8802.     (pp 'a)                    ; prints  A        returns T
  8803.     (pp "abcd")                ; prints  "abcd"    returns T
  8804.     (pp '(a (b c)))                ; prints  (A (B C)) returns T
  8805.  
  8806. COMMON LISP COMPATABILITY:
  8807. In  Common  LISP,  the PP  functionality  is  provided  with the  PPRINT
  8808. function.  The PP function was available in previous  XLISP releases and
  8809. is still  accessible.  It does allow you to specify  the length  through
  8810. <break-size>, which is not available in PPRINT.
  8811.  
  8812. NOTE:
  8813. PP is an extension to the XLISP system provided in the PP.LSP file.  The
  8814. default  system and INIT.LSP  start-up  code do not  automatically  load
  8815. PP.LSP.  You need to  specifically  LOAD it  yourself  during your XLISP
  8816. session.  Another alternative is to put the code or a (LOAD "pp") in the
  8817. INIT.LSP  file.  The PP.LSP should have come with your XLISP system.  If
  8818. it doesn't, refer to the EXAMPLE PROGRAMS chapter.
  8819.  
  8820.  
  8821. pprint
  8822. ________________________________________________________________________
  8823.  
  8824. type: function (subr)
  8825. location: built-in
  8826. source file: xlpp.c
  8827. Common LISP compatible: yes
  8828. supported on: all machines
  8829.  
  8830. SYNTAX
  8831.  
  8832. (pp  <expr> [ <destination> ] )
  8833.     <expr>        -    an expression to be pretty printed
  8834.     <destination>    -    an optional destination - must be a file pointer
  8835.                 or stream, the default is *standard-output*
  8836.  
  8837. DESCRIPTION
  8838.  
  8839. The PPRINT function  produces a pretty looking version of the <expr> and
  8840. prints it to the specified  <destination>.  If <expr> is an atom (like a
  8841. string, a symbol, a number,  etc.)  PPRINT will print it like PRINT.  If
  8842. <expr>  is a list,  it will  perform  indenting,  as  necessary.  NIL is
  8843. always  returned  as the result of PPRINT.  The  <destination>  may be a
  8844. file pointer or a stream.  If there is no <destination>  (or it is NIL),
  8845. *STANDARD-OUTPUT* is the default.
  8846.  
  8847. EXAMPLES
  8848.  
  8849.     (pprint 'a)        ; prints  A        returns T
  8850.     (pprint "abcd")        ; prints  "abcd"    returns T
  8851.  
  8852.     (pprint '(a-very-long-name (first list) (second list)))
  8853.                 ;
  8854.                 ; prints (A-VERY-LONG-NAME (FIRST LIST)
  8855.                 ;                (SECOND LIST))
  8856.  
  8857. COMMON LISP COMPATABILITY:
  8858. Common LISP specifies that PPRINT with a  <destination>  of NIL, will go
  8859. to    *STANDARD-OUTPUT*.   XLISP   does   not   send   the   output   to
  8860. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8861. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8862. XLISP does not allow T as a valid argument for <destination>.
  8863.  
  8864.  
  8865. prin1
  8866. ________________________________________________________________________
  8867.  
  8868. type: function (subr) 
  8869. location: built-in
  8870. source file: xlfio.c  and  xlprin.c
  8871. Common LISP compatible: yes
  8872. supported on: all machines
  8873.  
  8874. SYNTAX
  8875.  
  8876. (prin1  <expr>  [ <destination> ] )
  8877.     <expr>        -    an expression
  8878.     <destination>    -    an optional destination - must be a file pointer
  8879.                 or stream, the default is *standard-output*
  8880.  
  8881. DESCRIPTION
  8882.  
  8883. The PRIN1  function  prints the <expr> to the  specified  <destination>.
  8884. The  <expr> is printed  without a  new-line.  If <expr> is a string,  it
  8885. will be printed  with quotes  around the string.  The <expr> is returned
  8886. as the result.  The <destination> may be a file pointer or a stream.  If
  8887. there is no <destination>, *STANDARD-OUTPUT* is the default.  The TERPRI
  8888. function is used to terminate the print lines produced.
  8889.  
  8890. EXAMPLES
  8891.  
  8892.     (prin1 'a)                ; prints  A    without <NL>
  8893.     (prin1 '(a b))                ; prints  (A B)    without <NL>
  8894.     (prin1 2.5)                ; prints  2.5    without <NL>
  8895.     (prin1 "hi")                ; prints  "hi"     without <NL>
  8896.  
  8897.     (setq f (open "f" :direction :output))    ; create file 
  8898.     (prin1 "hi" f)                ; returns "hi"
  8899.     (prin1 1234 f)                ; returns 1234
  8900.     (prin1 "he" f)                ; returns "he"
  8901.     (close f)                 ; file contains <"hi"1234"he"> 
  8902.  
  8903. COMMON LISP COMPATABILITY:
  8904. Common LISP specifies that print operations with a <destination> of NIL,
  8905. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  8906. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8907. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8908. XLISP does not allow T as a valid argument for <destination>.
  8909.  
  8910.  
  8911. princ
  8912. ________________________________________________________________________
  8913.  
  8914. type: function (subr) 
  8915. location: built-in
  8916. source file: xlfio.c  and  xlprin.c
  8917. Common LISP compatible: yes
  8918. supported on: all machines
  8919.  
  8920. SYNTAX
  8921.  
  8922. (princ  <expr>  [ <destination> ] )
  8923.     <expr>        -    an expression
  8924.     <destination>    -    an optional destination - must be a file pointer
  8925.                 or stream, the default is *standard-output*
  8926.  
  8927. DESCRIPTION
  8928.  
  8929. The PRINC  function  prints the <expr> to the  specified  <destination>.
  8930. The  <expr> is printed  without a  new-line.  If <expr> is a string,  it
  8931. will not be  printed  with  quotes  around  the  string.  The  <expr> is
  8932. returned as the result.  The  <destination>  may be a file  pointer or a
  8933. stream.  If there is no <destination>, *STANDARD-OUTPUT* is the default.
  8934. The TERPRI function is used to terminate the print lines produced.
  8935.  
  8936. EXAMPLES
  8937.  
  8938.     (princ 'a)                ; prints  A    without <NL>
  8939.     (princ '(a b))                ; prints  (A B)    without <NL>
  8940.     (princ 99)                ; prints  99    without <NL>
  8941.     (princ "hi")                ; prints  hi    without <NL>
  8942.  
  8943.     (setq f (open "f" :direction :output))    ; create file
  8944.     (princ "hi" f)                ; returns "hi"
  8945.     (princ 727 f)                ; returns 727
  8946.     (princ "ho" f)                ; returns "ho"
  8947.     (close f)                ; file contains <hi727ho>
  8948.  
  8949. COMMON LISP COMPATABILITY:
  8950. Common LISP specifies that print operations with a <destination> of NIL,
  8951. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  8952. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  8953. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  8954. XLISP does not allow T as a valid argument for <destination>.
  8955.  
  8956.  
  8957. print
  8958. ________________________________________________________________________
  8959.  
  8960. type: function (subr) 
  8961. location: built-in
  8962. source file: xlfio.c  and  xlprin.c
  8963. Common LISP compatible: yes
  8964. supported on: all machines
  8965.  
  8966. SYNTAX
  8967.  
  8968. (print  <expr>  [ <destination> ] )
  8969.     <expr>        -    an expression
  8970.     <destination>    -    an optional destination - must be a file pointer
  8971.                 or stream, the default is *standard-output*
  8972.  
  8973. DESCRIPTION
  8974.  
  8975. The PRINT  function  prints the <expr> to the  specified  <destination>.
  8976. The <expr> is printed followed by a new-line.  If <expr> is a string, it
  8977. will be printed  with quotes  around the string.  The <expr> is returned
  8978. as the result.  The <destination> may be a file pointer or a stream.  If
  8979. there is no <destination>, *STANDARD-OUTPUT* is the default.
  8980.  
  8981. EXAMPLES
  8982.  
  8983.     (print 'a)                ; prints  A    with <NL>
  8984.     (print '(a b))                ; prints  (A B)    with <NL>
  8985.     (print 99)                ; prints  99    with <NL>
  8986.     (print "hi")                ; prints  "hi"    with <NL>
  8987.  
  8988.     (setq f (open "f" :direction :output))    ; create file
  8989.     (print "hi" f)                ; returns "hi"
  8990.     (print 727 f)                ; returns 727
  8991.     (print "ho" f)                ; returns "ho"
  8992.     (close f)                ; file contains "hi"<NL>
  8993.                         ;               727<NL>
  8994.                         ;        "ho"<NL>
  8995.  
  8996. COMMON LISP COMPATABILITY:
  8997. Common LISP specifies that print operations with a <destination> of NIL,
  8998. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  8999. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  9000. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  9001. XLISP does not allow T as a valid argument for <destination>.
  9002.  
  9003.  
  9004. *print-case*
  9005. ________________________________________________________________________
  9006.  
  9007. type: system variable 
  9008. location: built-in
  9009. source file: xlprin.c
  9010. Common LISP compatible: similar
  9011. supported on: all machines
  9012.  
  9013. SYNTAX
  9014.  
  9015. *print-case*
  9016.  
  9017.  
  9018. DESCRIPTION
  9019.  
  9020. *PRINT-CASE*  is a system  variable  that  allows a user to specify  how
  9021. symbols  are  to  be  printed  by  XLISP.  If  *PRINT-CASE*  is  set  to
  9022. :DOWNCASE,  all  symbols  will be printed in lower case  characters.  If
  9023. *PRINT-CASE*  is set to :UPCASE,  all  symbols  will be printed in upper
  9024. case  characters.  If *PRINT-CASE* is set to anything other than :UPCASE
  9025. or :DOWNCASE, all symbols will be printed in upper case characters.  The
  9026. default value for *PRINT-CASE* is the keyword :UPCASE.
  9027.  
  9028. EXAMPLES
  9029.     (setq *print-case* :downcase)        ; returns :downcase
  9030.     (setq a 'b)                ; returns b
  9031.  
  9032.     (setq *print-case* 'foo)        ; returns FOO
  9033.     (setq a 'b)                ; returns B
  9034.  
  9035.     (setq *print-case* :upcase)        ; returns :UPCASE
  9036.     (setq a 'b)                ; returns B
  9037.  
  9038. COMMON LISP COMPATABILITY:
  9039. Common  LISP  supports  a third  keyword  :CAPITALIZE.  XLISP  does  not
  9040. support  this,  but  this  should  not be a  major  problem.  If  set to
  9041. :CAPITALIZE, XLISP will print all symbols in upper-case characters.
  9042.  
  9043.  
  9044. prog
  9045. ________________________________________________________________________
  9046.  
  9047. type: special form (fsubr)
  9048. location: built-in
  9049. source file: xlcont.c
  9050. Common LISP compatible: yes
  9051. supported on: all machines
  9052.  
  9053. SYNTAX
  9054.  
  9055. (prog  ( [ <binding> ... ]  )  [ <expr> ... ]  )
  9056.     <binding>    -    a variable binding which is can take one of 
  9057.                 <symbol>    or     ( <symbol> <init-expr> )
  9058.     <symbol>    -    a symbol
  9059.     <init-expr>    -    an initialization expression for <symbol>
  9060.     <expr>        -    expressions comprising the body of the loop
  9061.                 which may contain RETURNs, GOs or tags for GO  
  9062.  
  9063. DESCRIPTION
  9064.  
  9065. The PROG special  form is basically a 'block'  construct  (like a PASCAL
  9066. BEGIN / END) that contains symbols (with optional initializations) and a
  9067. block of code  (expressions)  to evaluate.  The PROG form  evaluates its
  9068. initializations in no specified order (as opposed to PROG* which does it
  9069. sequential order).  The first form after the PROG is the <binding> form.
  9070. It contains a series of <symbol>'s or  <binding>'s.  The  <binding> is a
  9071. <symbol> followed by an initialization expression <init-expr>.  If there
  9072. is no <init-expr>, the <symbol> will be initialized to NIL.  There is no
  9073. specification  as to the order of execution  of the bindings or the step
  9074. expressions - except that they happen all together.  If a RETURN form is
  9075. evaluated,  its value  will be  returned.  Otherwise,  NIL is  returned.
  9076. When the PROG is finished  execution,  the <symbol>'s  that were defined
  9077. will no longer exist or retain their values.
  9078.  
  9079. EXAMPLES
  9080.  
  9081.     (prog () (print "hello"))        ; prints  "hello"  returns NIL
  9082.     (prog (i j)                ; PROG with vars I and J
  9083.           (print i) (print j))        ; prints  NIL NIL  returns NIL
  9084.     (prog ((i 1) (j 2))             ; PROG with vars I and J
  9085.           (print i) (print j)         ;
  9086.           (return (+ i j)))            ; prints  1 2      returns 3
  9087.  
  9088.  
  9089. prog*
  9090. ________________________________________________________________________
  9091.  
  9092. type: special form (fsubr)
  9093. location: built-in
  9094. source file: xlcont.c
  9095. Common LISP compatible: yes
  9096. supported on: all machines
  9097.  
  9098. SYNTAX
  9099.  
  9100. (prog*  ( [ <binding> ... ]  )  [ <expr> ... ]  )
  9101.     <binding>    -    a variable binding which is can take one of 
  9102.                 <symbol>     or    ( <symbol> <init-expr> )
  9103.     <symbol>    -    a symbol
  9104.     <init-expr>    -    an initialization expression for <symbol>
  9105.     <expr>        -    expressions comprising the body of the loop
  9106.                 which may contain RETURNs, GOs or tags for GO  
  9107.  
  9108. DESCRIPTION
  9109.  
  9110. The PROG* special form is basically a 'block'  construct  (like a PASCAL
  9111. BEGIN / END) that contains symbols (with optional initializations) and a
  9112. block of code  (expressions)  to evaluate.  The PROG* form evaluates its
  9113. initializations in sequential order (as opposed to PROG which does it in
  9114. no  specified  order).  The first form after the PROG* is the  'binding'
  9115. form.  It contains a series of <symbol>'s or <binding>'s.  The <binding>
  9116. is a <symbol> followed by an initialization  expression <init-expr>.  If
  9117. there is no  <init-expr>,  the <symbol> will be initialized to NIL.  The
  9118. order of  execution of the bindings is  sequential.  If a RETURN form is
  9119. evaluated,  its value  will be  returned.  Otherwise,  NIL is  returned.
  9120. When the PROG* is finished  execution, the <symbol>'s  that were defined
  9121. will no longer exist or retain their values.
  9122.  
  9123. EXAMPLES
  9124.  
  9125.     (prog* (i j)                ; PROG* with vars I and J
  9126.           (print i) (print j))        ; prints  NIL NIL  returns NIL
  9127.     (prog* ((i 1) (j 2))             ; PROG* with vars I and J
  9128.           (print i) (print j)         ;
  9129.           (return (+ i j)))            ; prints  1 2      returns 3
  9130.     (prog* () (print "hello"))        ; prints  "hello"  returns NIL
  9131.  
  9132.     (prog ((i 1) (j (+ i 1)))        ; PROG won't work due to order
  9133.           (print (+ i j)) )            ; error: unbound variable - I
  9134.     (prog* ((i 1) (j (+ i 1)))        ; PROG* will work due to order
  9135.            (print (+ i j)) )        ; prints  3        returns NIL
  9136.  
  9137.  
  9138. prog1
  9139. ________________________________________________________________________
  9140.  
  9141. type: special form (fsubr)
  9142. location: built-in
  9143. source file: xlcont.c
  9144. Common LISP compatible: yes
  9145. supported on: all machines
  9146.  
  9147. SYNTAX
  9148.  
  9149. (prog1  [ <expr1>  <expr2> ... ]  )
  9150.     <exprN>        -    expressions comprising the body of the loop
  9151.  
  9152. DESCRIPTION
  9153.  
  9154. The PROG1 special form is basically a 'block'  construct  (like a PASCAL
  9155. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9156. <expr1>'s value will be returned as the result of PROG1.  If there is no
  9157. <expr1>, NIL is returned.
  9158.  
  9159. EXAMPLES
  9160.  
  9161.     (prog1 (print "hi") (print "ho"))    ; prints "hi" "ho" returns "hi"
  9162.     (prog1)                    ; returns NIL
  9163.     (prog1 'a)                ; returns A
  9164.     (prog1 "hey" (print "ho"))        ; prints "ho"      returns "hey"
  9165.  
  9166. NOTE:
  9167. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9168. tags for GO.
  9169.  
  9170.  
  9171. prog2
  9172. ________________________________________________________________________
  9173.  
  9174. type: special form (fsubr)
  9175. location: built-in
  9176. source file: xlcont.c
  9177. Common LISP compatible: yes
  9178. supported on: all machines
  9179.  
  9180. SYNTAX
  9181.  
  9182. (prog2  [ <expr1>  <expr2> ... ]  )
  9183.     <exprN>        -    expressions comprising the body of the loop
  9184.  
  9185. DESCRIPTION
  9186.  
  9187. The PROG2 special form is basically a 'block'  construct  (like a PASCAL
  9188. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9189. <expr2>'s value will be returned as the result of PROG2.  If there is no
  9190. <expr2>,  <expr1> is returned.  If there is no <expr1>, NIL is returned.
  9191.  
  9192. EXAMPLES
  9193.  
  9194.     (prog2 (print "hi") (print "ho"))    ; prints "hi" "ho" returns "ho"
  9195.     (prog2)                    ; returns NIL
  9196.     (prog2 (print "hi"))            ; prints "hi"      returns "hi"
  9197.     (prog2 (print "ho") "hey")        ; prints "ho"      returns "hey"
  9198.     (prog2 'a 'b 'c)            ; returns B
  9199.  
  9200. NOTE:
  9201. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9202. tags for GO.
  9203.  
  9204.  
  9205. progn
  9206. ________________________________________________________________________
  9207.  
  9208. type: special form (fsubr)
  9209. location: built-in
  9210. source file: xlcont.c
  9211. Common LISP compatible: yes
  9212. supported on: all machines
  9213.  
  9214. SYNTAX
  9215.  
  9216. (progn  [ <expr1>  <expr2> ... ]  )
  9217.     <exprN>        -    expressions comprising the body of the loop
  9218.  
  9219. DESCRIPTION
  9220.  
  9221. The PROGN special form is basically a 'block'  construct  (like a PASCAL
  9222. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9223. The last  <expr>'s  value will be  returned  as the result of PROGN.  If
  9224. there are no <expr>s, NIL is returned.
  9225.  
  9226. EXAMPLES
  9227.  
  9228.     (progn (print "hi") (print "ho"))    ; prints "hi" "ho" returns "ho"
  9229.     (progn)                    ; returns NIL
  9230.     (progn "hey" (print "ho"))        ; prints "ho"      returns "ho"
  9231.     (progn 'a)                ; returns A
  9232.     (progn 'a 'b 'c)            ; returns C
  9233.  
  9234. NOTE:
  9235. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9236. tags for GO.
  9237.  
  9238.  
  9239. progv
  9240. ________________________________________________________________________
  9241.  
  9242. type: special form (fsubr)
  9243. location: built-in
  9244. source file: xlcont.c
  9245. Common LISP compatible: yes
  9246. supported on: all machines
  9247.  
  9248. SYNTAX
  9249.  
  9250. (progv  <symbols> <values> [ <expr1>  <expr2> ... ]  )
  9251.     <symbols>    -    a list comprising symbols to be bound
  9252.     <values>    -    a list comprising values to be bound to symbols
  9253.     <exprN>        -    expressions comprising the body of the loop
  9254.  
  9255. DESCRIPTION
  9256.  
  9257. The PROGV special form is basically a 'block'  construct  (like a PASCAL
  9258. BEGIN / END) that  contains a block of code  (expressions)  to evaluate.
  9259. PROGV is  different  from PROG1,  PROG2 and PROGN in that it  contains a
  9260. pair of lists - <symbols> and <values>.  Before  evaluating  the <exprN>
  9261. expressions,   PROGV  will   dynamically   bind  the   <values>  to  the
  9262. corresponding  <symbols>.  If  there  are  too  many  <symbols>  for the
  9263. <values>, the <symbols> with no corresponding  <values> will be bound to
  9264. NIL.  The  variables  will be unbound after the execution of PROGV.  The
  9265. last  <expr>'s  value will be returned as the result of PROGV.  If there
  9266. are no <expr>s, NIL is returned.
  9267.  
  9268. EXAMPLES
  9269.  
  9270.     (progv '(var) '(2)             ; 
  9271.         (print var) (print "two"))    ; prints 2 "two" returns "two"
  9272.  
  9273.     (setq a "beginning")            ; initialize A
  9274.     (progv '(a) '(during) (print a))    ; prints DURING
  9275.     (print a)                ; prints "beginning"
  9276.  
  9277.     (progv '(no-way) '(no-how) )        ; returns NIL
  9278.     (progv)                    ; error: too few arguments
  9279.  
  9280. NOTE:
  9281. PROGV is different  from PROG (which allows  symbols and  initialization
  9282. forms) in that PROGV allows its <symbols>  and <values> to be evaluated.
  9283. This allows you to pass in forms that generate the  <symbols>  and their
  9284. <values>.
  9285.  
  9286. NOTE:
  9287. PROG1,  PROG2,  PROGN and PROGV do not allow the use of  RETURN or GO or
  9288. tags for GO.
  9289.  
  9290.  
  9291. psetq
  9292. ________________________________________________________________________
  9293.  
  9294. type: special form (fsubr)
  9295. location: built-in
  9296. source file: xlcont.c
  9297. Common LISP compatible: yes
  9298. supported on: all machines
  9299.  
  9300. SYNTAX
  9301.  
  9302. (psetq [ <symbol> <expr> ] ... )
  9303.     <symbol>    -    un-evaluated symbol
  9304.     <expr>        -    value for <symbol>
  9305.  
  9306. DESCRIPTION
  9307.  
  9308. PSETQ sets <expr> as the value of <symbol>.  There can be several  pairs
  9309. of  assignment.  PSETQ  performs  these  assignments  in  parallel - the
  9310. <symbol>'s  are not assigned new values until all the <expr>'s have been
  9311. evaluated.  PSETQ returns the value from the last <expr> as it's result.
  9312.  
  9313. EXAMPLES
  9314.  
  9315.     (psetq a 1)                ; symbol A gets value 1
  9316.     (psetq b '(a b c))            ; symbol B gets value (A B C)
  9317.     (psetq mynum (+ 3 4))            ; symbol MYNUM gets value 7
  9318.  
  9319.     (setq goo 'ber)                ; returns BER
  9320.     (setq num 1)                ; returns 1
  9321.     (psetq goo num num goo)            ; returns BER
  9322.     (print goo)                ; returns 1
  9323.     (print num)                ; returns BER
  9324.  
  9325.  
  9326. putprop
  9327. ________________________________________________________________________
  9328.  
  9329. type: function (subr) 
  9330. location: built-in
  9331. source file: xlbfun.c
  9332. Common LISP compatible: no
  9333. supported on: all machines
  9334.  
  9335. SYNTAX
  9336.  
  9337. (putprop <symbol> <value> <property> )
  9338.     <symbol>    -    the symbol with a property list
  9339.     <value>        -     the value to be assigned to the property
  9340.     <property>    -    the property name being changed/added
  9341.  
  9342. DESCRIPTION
  9343.  
  9344. PUTPROP  sets  the  value  of the  <property>  in the  <symbol>.  If the
  9345. <property> does not exist, the <property> is added to the property list.
  9346. The  <symbol>  must be an existing  symbol.  The <value> may be a single
  9347. value or a list.
  9348.  
  9349. Property  lists are lists  attached to any user defined  variables.  The
  9350. lists are in the form of (name1  val1 name2 val2  ....).  Any  number of
  9351. properties may be attached to a single variable.
  9352.  
  9353. EXAMPLES
  9354.  
  9355.     (setq person 'bobby)            ; create a var with a value
  9356.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  9357.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  9358.     (get person 'last-name)            ; retrieve LAST-NAME - boogie
  9359.     (get person 'job)            ; retrieve JOB - disc-jockey
  9360.     (get person 'height)            ; non-existant - returns NIL
  9361.     (putprop person '(10 20 30) 'stats)    ; add STATS - a list 
  9362.     (get person 'stats)            ;
  9363.  
  9364. NOTE:
  9365. You can set a  property  to the value  NIL.  However,  this NIL value is
  9366. indistinguishable  from the NIL returned when a property does not exist.
  9367.  
  9368. COMMON LISP COMPATIBILITY:
  9369. Common LISP does not have a PUTPROP function.  It uses a SETF to achieve
  9370. this  functionality.  Porting  from  Common LISP to XLISP will work fine
  9371. since XLISP supports the SETF  modifications  of property lists and GET.
  9372. Porting from XLISP to Common LISP will require translating  PUTPROP into
  9373. SETF forms.
  9374.  
  9375. LISP DIALECTS:
  9376. The order of PUTPROP arguments is <symbol>,  <value>,  <property>.  This
  9377. is  different  from  many  other  LISPs  which  normally  use  <symbol>,
  9378. <property>, <value>.  Be careful when porting existing LISP code.
  9379.  
  9380.  
  9381. quote
  9382. ________________________________________________________________________
  9383.  
  9384. type: special form (fsubr)
  9385. location: built-in
  9386. source file: xlcont.c
  9387. Common LISP compatible: yes
  9388. supported on: all machines
  9389.  
  9390. SYNTAX
  9391.  
  9392. (quote <expr> )
  9393.     <expr>        -    an expression
  9394.  
  9395. DESCRIPTION
  9396.  
  9397. QUOTE returns the the <expr> un-evaluated.  
  9398.  
  9399. EXAMPLES
  9400.  
  9401.     my-var                    ; error: unbound variable 
  9402.     (quote my-var)                ; returns MY-VAR
  9403.     my-var                    ; still error: unbound variable
  9404.     (set (quote my-var) 111)        ; give MY-VAR a value - 
  9405.                         ;   make it exist
  9406.     my-var                    ; returns 111
  9407.     (quote my-var)                ; returns MY-VAR
  9408.  
  9409.                         ; SAME AS ABOVE BUT USING THE 
  9410.                         ; READ MACRO FOR QUOTE - '
  9411.     new-var                    ; error: unbound variable
  9412.     'new-var                ; returns NEW-VAR
  9413.     new-var                    ; still error: unbound variable
  9414.     (setq new-var 222)            ; give NEW-VAR a value -
  9415.                         ;   make it exist
  9416.     new-var                    ; returns 222
  9417.     'new-var                ; returns NEW-VAR
  9418.  
  9419. READ MACRO:  
  9420. XLISP  supports  the normal read macro of a single quote as a short-hand
  9421. method of writing the QUOTE function.
  9422.  
  9423.  
  9424. random
  9425. ________________________________________________________________________
  9426.  
  9427. type: function (subr) 
  9428. location: built-in
  9429. source file: xlmath.c
  9430. Common LISP compatible: similar
  9431. supported on: all machines
  9432.  
  9433. SYNTAX
  9434.  
  9435. (random <expr> )
  9436.     <expr>        -    integer number/expression
  9437.  
  9438. DESCRIPTION
  9439.  
  9440. The RANDOM function  generates and returns a random number between 0 and
  9441. <expr> - 1.  If <expr> is  negative,  the  number  range is forced to be
  9442. positive.
  9443.  
  9444. EXAMPLES
  9445.  
  9446.     (random 100)                ; returns 7
  9447.     (random 100)                ; returns 49
  9448.     (random 100)                ; returns 73
  9449.     (random -100)                ; returns 58
  9450.     (random 100.01)                ; error: bad flt.pt. operation 
  9451.  
  9452. COMMON LISP COMPATABILITY:
  9453. Common LISP allows an optional state  parameter,  which is not supported
  9454. in XLISP.  Also, Common LISP allows  floating point numbers, which XLISP
  9455. does not support.
  9456.  
  9457. NOTE:
  9458. This  function is an  extension of the XLISP  system.  It is provided in
  9459. the  MSSTUFF.C  source code file.  If your XLISP  system is built for an
  9460. IBM PC and  compatibles,  this  function  will work.  If your  system is
  9461. built on UNIX or some other  operating  system, it will need the code in
  9462. the corresponding STUFF.C file.
  9463.  
  9464.  
  9465. read
  9466. ________________________________________________________________________
  9467.  
  9468. type: function (subr) 
  9469. location: built-in
  9470. source file: xlfio.c  and  xlread.c
  9471. Common LISP compatible: similar
  9472. supported on: all machines
  9473.  
  9474. SYNTAX
  9475.  
  9476. (read   [ <source>  [ <eof-result> [ <recursive-flag> ] ] ]  )
  9477.     <source>    -    an optional source - must be a file pointer
  9478.                 or stream, the default is *standard-input*
  9479.     <eof-result>    -    an optional expression (default is NIL)
  9480.     <recursive-flag>-    an optional expression ( NIL or non-NIL )
  9481.  
  9482. DESCRIPTION
  9483.  
  9484. The READ function reads an expression from the specified  <source>.  The
  9485. expression read is a 'normal' XLISP expression - not a line.  This means
  9486. that white space is removed - blanks,  empty  lines and  comment  lines.
  9487. Read-macro  expansions  will  occur  (like  QUOTE  instead  of  ').  The
  9488. expression  needs to be an atom  (numeric,  string or symbol) or a valid
  9489. list.  It can span several  lines.  The  expression  read is returned as
  9490. the result.  The  <source>  may be a file pointer or a stream.  If there
  9491. is no <source>,  *STANDARD-INPUT*  is the default.  If an end-of-file is
  9492. encountered  in the  <source>,  then  the  <eof-result>  value  will  be
  9493. returned as the result.
  9494.  
  9495. If you wish to read just  lines or  characters,  refer to  READ-LINE  or
  9496. READ-CHAR.
  9497.  
  9498. The  <recursive-flag>  is intended for use with embedded  calls to READ.
  9499. This is useful in read-macro and read-table  uses.  If  <recursive-flag>
  9500. is non-NIL, the READ does not expect itself to be at a 'top-level',  but
  9501. recursively executing within another READ that is in progress.
  9502.  
  9503. EXAMPLES
  9504.  
  9505.     (setq fp (open "f" :direction :output))    ; set up file
  9506.     (print "hello" fp)            ;
  9507.     (print 12.34 fp)            ;
  9508.     (princ "'(a b" fp)     (terpri fp)    ;    fill with stuff
  9509.     (princ "; comment" fp) (terpri fp)    ;
  9510.     (princ " c d)" fp )            ;
  9511.     (close fp)                ;
  9512.                         ;
  9513.     (setq fp (open "f" :direction :input))    ; now read the file
  9514.     (read fp "done")            ; returns "hello"
  9515.     (read fp "done")            ; returns 12.34
  9516.     (read fp "done")            ; returns (QUOTE (A B C D))
  9517.                         ; note macro expansion of QUOTE
  9518.                         ; note that comment is gone
  9519.     (read fp "done")            ; returns "done"
  9520.     (close fp)
  9521.  
  9522. COMMON LISP COMPATABILITY:
  9523. The XLISP and Common LISP READ  functions  are similar.  They both allow
  9524. for  <source>,  <eof-result>  and  <recursive-flag>.  However, in Common
  9525. LISP, there is an addition  end-of-file error parameter.  This parameter
  9526. occurs  right after  <source>  and  specifies  whether or not to flag an
  9527. error  on   end-of-file.  So,  when  porting,   remember  there  is  one
  9528. additional  argument in Common  LISP's  READ.  You need to be  concerned
  9529. about this if you use more than just a <source>  argument - going either
  9530. from XLISP to Common LISP or vice versa.
  9531.  
  9532. COMMON LISP COMPATABILITY:
  9533. Common LISP specifies that read  operations with a <source> of NIL, will
  9534. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9535. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9536. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9537. T as a valid argument for <source>.
  9538.  
  9539.  
  9540. read-byte
  9541. ________________________________________________________________________
  9542.  
  9543. type: function (subr) 
  9544. location: built-in
  9545. source file: xlfio.c  
  9546. Common LISP compatible: similar
  9547. supported on: all machines
  9548.  
  9549. SYNTAX
  9550.  
  9551. (read-byte  [ <source> ]  )
  9552.     <source>    -    an optional source - must be a file pointer
  9553.                 or stream, the default is *standard-input*
  9554.  
  9555. DESCRIPTION
  9556.  
  9557. The  READ-BYTE  function  reads a single  character  from the  specified
  9558. <source>.  The  character  read is returned as an integer  value for the
  9559. result.  The <source> may be a file pointer or a stream.  If there is no
  9560. <source>,   *STANDARD-INPUT*  is  the  default.  If  an  end-of-file  is
  9561. encountered in the <source>, then NIL will be returned as the result.
  9562.  
  9563. EXAMPLES
  9564.  
  9565.     (setq fp (open "f" :direction :output))    ; set up file
  9566.     (print 12.34 fp)            ;
  9567.     (close fp)                ;
  9568.                         ;
  9569.     (setq fp (open "f" :direction :input))    ; now read the file
  9570.     (read-byte fp)                ; returns 49        "1"
  9571.     (read-byte fp)                ; returns 50        "2"
  9572.     (read-byte fp)                ; returns 46        "."
  9573.     (read-byte fp)                ; returns 51        "3"
  9574.     (read-byte fp)                ; returns 52        "4"
  9575.     (read-byte fp)                ; returns 10        "\n"
  9576.     (read-byte fp)                ; returns NIL        empty
  9577.     (close fp)                ; 
  9578.  
  9579. COMMON LISP COMPATABILITY:
  9580. The XLISP and Common LISP READ-BYTE  functions are compatable for simple
  9581. cases.  They both allow for the  optional  <source>.  However, in Common
  9582. LISP, there are addition  parameters  which occur right after  <source>.
  9583. So,  when  porting  from  Common  LISP  to  XLISP,  remember  there  are
  9584. additional arguments in Common LISP's READ-BYTE.
  9585.  
  9586. COMMON LISP COMPATABILITY:
  9587. Common LISP specifies that read  operations with a <source> of NIL, will
  9588. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9589. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9590. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9591. T as a valid argument for <source>.
  9592.  
  9593.  
  9594. read-char
  9595. ________________________________________________________________________
  9596.  
  9597. type: function (subr) 
  9598. location: built-in
  9599. source file: xlfio.c  
  9600. Common LISP compatible: similar
  9601. supported on: all machines
  9602.  
  9603. SYNTAX
  9604.  
  9605. (read-char  [ <source> ]  )
  9606.     <source>    -    an optional source - must be a file pointer
  9607.                 or stream, the default is *standard-input*
  9608.  
  9609. DESCRIPTION
  9610.  
  9611. The  READ-CHAR  function  reads a single  character  from the  specified
  9612. <source>.  The character  read is returned as a single  character  value
  9613. for the  result.  The  <source>  may be a file  pointer or a stream.  If
  9614. there  is  no  <source>,   *STANDARD-INPUT*   is  the   default.  If  an
  9615. end-of-file is encountered in the <source>, then NIL will be returned as
  9616. the result.
  9617.  
  9618. EXAMPLES
  9619.  
  9620.     (setq fp (open "f" :direction :output))    ; set up file
  9621.     (print 12.34 fp)            ;
  9622.     (close fp)                ;
  9623.                         ;
  9624.     (setq fp (open "f" :direction :input))    ; now read the file
  9625.     (read-char fp)                ; returns #\1
  9626.     (read-char fp)                ; returns #\2
  9627.     (read-char fp)                ; returns #\.
  9628.     (read-char fp)                ; returns #\3
  9629.     (read-char fp)                ; returns #\4
  9630.     (read-char fp)                ; returns #\Newline
  9631.     (read-char fp)                ; returns NIL        empty
  9632.     (close fp)                ; 
  9633.  
  9634. COMMON LISP COMPATABILITY:
  9635. The XLISP and Common LISP READ-CHAR  functions are compatable for simple
  9636. cases.  They both allow for the  optional  <source>.  However, in Common
  9637. LISP, there are addition  parameters  which occur right after  <source>.
  9638. So,  when  porting  from  Common  LISP  to  XLISP,  remember  there  are
  9639. additional arguments in Common LISP's READ-CHAR.
  9640.  
  9641. COMMON LISP COMPATABILITY:
  9642. Common LISP specifies that read  operations with a <source> of NIL, will
  9643. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9644. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9645. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9646. T as a valid argument for <source>.
  9647.  
  9648.  
  9649. read-line
  9650. ________________________________________________________________________
  9651.  
  9652. type: function (subr) 
  9653. location: built-in
  9654. source file: xlfio.c  
  9655. Common LISP compatible: similar
  9656. supported on: all machines
  9657.  
  9658. SYNTAX
  9659.  
  9660. (read-line  [ <source> ]  )
  9661.     <source>    -    an optional source - must be a file pointer
  9662.                 or stream, the default is *standard-input*
  9663.  
  9664. DESCRIPTION
  9665.  
  9666. The READ-LINE function reads a single line from the specified  <source>.
  9667. The  line  read is  returned  as a  string  value  for the  result.  The
  9668. <source>  may be a file  pointer or a stream.  If there is no  <source>,
  9669. *STANDARD-INPUT*  is the default.  If an end-of-file  is encountered  in
  9670. the <source>, then NIL will be returned as the result.
  9671.  
  9672. EXAMPLES
  9673.  
  9674.     (setq fp (open "f" :direction :output))    ; set up file
  9675.     (print "fe fi" fp)            ;
  9676.     (print 12.34 fp)            ;
  9677.     (close fp)                ;
  9678.                         ;
  9679.     (setq fp (open "f" :direction :input))    ; now read the file
  9680.     (read-line fp)                ; returns ""fe fi""    
  9681.     (read-line fp)                ; returns "12.34"
  9682.     (read-line fp)                ; returns NIL
  9683.     (close fp)                ; 
  9684.  
  9685. COMMON LISP COMPATABILITY:
  9686. The XLISP and Common LISP READ-LINE  functions are compatable for simple
  9687. cases.  They both allow for the  optional  <source>.  However, in Common
  9688. LISP, there are addition  parameters  which occur right after  <source>.
  9689. So,  when  porting  from  Common  LISP  to  XLISP,  remember  there  are
  9690. additional arguments in Common LISP's READ-LINE.
  9691.  
  9692. COMMON LISP COMPATABILITY:
  9693. Common LISP specifies that read  operations with a <source> of NIL, will
  9694. come  from   *STANDARD-INPUT*.  XLISP  does  not  read  the  input  from
  9695. *STANDARD-INPUT*  with a <source>  of NIL.  Common  LISP also  specifies
  9696. that a <source> of T will read from *TERMINAL-IO*.  XLISP does not allow
  9697. T as a valid argument for <source>.
  9698.  
  9699.  
  9700. *readtable*
  9701. ________________________________________________________________________
  9702.  
  9703. type: system variable
  9704. location: built-in
  9705. source file: xlread.c
  9706. Common LISP compatible: related
  9707. supported on: all machines
  9708.  
  9709. SYNTAX
  9710.  
  9711. *readtable*
  9712.  
  9713.  
  9714. DESCRIPTION
  9715.  
  9716. The  *READTABLE*  is  a  system  variable  that  contains  XLISP's  data
  9717. structures  relating to the  processing of characters  from the user (or
  9718. files) and read-macro expansions.  The table is 128 entries (0..127) for
  9719. each of the 7-bit ASCII  characters  that XLISP can read.  Each entry in
  9720. the *READTABLE*  array must be one of NIL,  :CONSTITUENT,  :WHITE-SPACE,
  9721. :SESCAPE, :MESCAPE, a :TMACRO dotted pair or a :NMACRO dotted pair.
  9722.  
  9723.         Table entry        Meaning
  9724.         --------------------------------------------------------
  9725.         NIL            Invalid character
  9726.         :CONSTITUENT        The character is valid, as is.
  9727.         :WHITE-SPACE        The character may be skipped over.
  9728.         :SESCAPE        The single escape character ('\');
  9729.         :MESCAPE        The multiple escape character ('|');
  9730.         (:TMACRO . <f> )    A terminating read-macro
  9731.         (:NMACRO . <f> )    A non-terminating read-macro
  9732.  
  9733. In the case of :NMACRO and :TMACRO, the form of the *READTABLE* entry is
  9734. a list like  (:TMACRO .  <function> ) or (:NMACRO .  <function>  ).  The
  9735. <function>  can be a  built-in  read-macro  function  or a user  defined
  9736. lambda expression.  The <function> takes two parameters, an input stream
  9737. specification,   and  an  integer  that  is  the  character  value.  The
  9738. <function>  should  return NIL if the  character is  'white-space'  or a
  9739. value CONSed with NIL to return the value.
  9740.  
  9741. EXAMPLES
  9742.  
  9743.     *readtable*                ; returns the current table
  9744.  
  9745.     (defun look-at (table)            ; define a function to 
  9746.      (dotimes (ch 127)            ;   look in a table
  9747.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  9748.         (case entry             ;   entries with a function
  9749.           (NIL        NIL)        ;
  9750.           (:CONSTITUENT NIL)        ;
  9751.           (:WHITE-SPACE NIL)        ;
  9752.           (:SESCAPE     NIL)        ;
  9753.           (:MESCAPE     NIL)        ;
  9754.           (T      (princ (int-char ch)));
  9755.           )))                ;
  9756.      (terpri))                ;
  9757.                          ;
  9758.     (look-at *readtable*)            ;  prints  "#'(),;`
  9759.  
  9760. CAUTION:
  9761. If you experiment  with  *READTABLE*, it is useful to save the old value
  9762. in a variable, so that you can restore the system state.
  9763.  
  9764.  
  9765. rem
  9766. ________________________________________________________________________
  9767.  
  9768. type: function (subr) 
  9769. location: built-in
  9770. source file: xlmath.c
  9771. Common LISP compatible: similar
  9772. supported on: all machines
  9773.  
  9774. SYNTAX
  9775.  
  9776. (rem <expr1> ... )
  9777.     <exprN>        -    integer number/expression
  9778.  
  9779. DESCRIPTION
  9780.  
  9781. The REM function takes the first pair of expressions and determines what
  9782. is the remainder  from dividing the first by the second  expression.  If
  9783. there  are no other  arguments,  this  value is  returned.  If there are
  9784. additional  arguments, the remainder of the first pair is applied to the
  9785. next  and  then  the next and so on.  In other  words,  (REM A B C D) is
  9786. equivalent to (REM (REM (REM A B) C) D).
  9787.  
  9788. EXAMPLES
  9789.  
  9790.     (rem 1)                    ; returns 1
  9791.     (rem 1 2)                ; returns 1
  9792.     (rem 13 8)                ; returns 5
  9793.     (rem 13 8 3)                ; returns 2
  9794.     (rem 13.5 8)                ; error: bad flt.pt. operation
  9795.  
  9796. COMMON LISP COMPATABILITY:
  9797. Common  LISP only allows two  arguments.  XLISP  supports  an  arbitrary
  9798. number of  arguments.  Also,  Common  LISP  allows  for  floating  point
  9799. expressions where XLISP does not support this.
  9800.  
  9801.  
  9802. remove
  9803. ________________________________________________________________________
  9804.  
  9805. type: function (subr) 
  9806. location: built-in
  9807. source file: xllist.c
  9808. Common LISP compatible: similar
  9809. supported on: all machines
  9810.  
  9811. SYNTAX
  9812.  
  9813. (remove <expr> <list-expr> [ { :test | :test-not } <test> ] )
  9814.     <expr>        -    the expression to remove - an atom or list
  9815.     <list-expr>    -    the list to remove from 
  9816.     <test>        -    optional test function (default is EQL)
  9817.  
  9818. DESCRIPTION
  9819.  
  9820. REMOVE  searches  through  <list-expr>  for <expr>.  If <expr> is found,
  9821. REMOVE  returns  the list with the <expr>  deleted.  All  occurances  of
  9822. <expr> are  deleted.  If <expr> is not found,  then the  <list-expr>  is
  9823. returned  unaltered.  You may  specify  your own test with the :TEST and
  9824. :TEST-NOT keywords followed by the test you which to perform.  Note that
  9825. this  operation  is  non-destructive,  it  does  not  modify  or  affect
  9826. <list-expr> directly - it creates a modified copy.
  9827.  
  9828. EXAMPLES
  9829.  
  9830.     (setq mylist '(a b c d it e f))        ; set up a list
  9831.     (remove 'it mylist)            ; returns (A B C D E F)
  9832.     (print mylist)                ; prints (A B C D IT E F)
  9833.                         ;   note that MYLIST is not
  9834.                         ;   affected 
  9835.     (setq mylist '(a b c b d b))        ; change list to include
  9836.                         ;   duplicates
  9837.     (remove 'b mylist)            ; returns (A C D)
  9838.  
  9839.     (setq alist '( (a) (b) (it) (c)))    ; set up another list
  9840.     (remove '(it) alist)            ; returns ((A) (B) (IT) (C))
  9841.                         ;   the EQ test doesn't work
  9842.                         ;   for lists
  9843.     (remove '(it) alist :test 'equal)    ; returns ((A) (B) (C))
  9844.  
  9845.     (setq slist '( "a" "b" "it" "c"))    ; set up yet another list
  9846.     (remove "it" slist)            ; returns ("a" "b" "c")
  9847.     (remove "it" slist :test-not 'equal)    ; returns ("it") - REMOVE
  9848.                         ;   takes away everything but IT
  9849.  
  9850. NOTE:
  9851. The  REMOVE  function  can work  with a list or  string  as the  <expr>.
  9852. However, the default EQL test does not work with lists or strings,  only
  9853. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  9854. keyword along with EQUAL for <test>.
  9855.  
  9856. COMMON LISP COMPATABILITY:
  9857. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  9858. keywords which Common LISP does.
  9859.  
  9860.  
  9861. remove-if
  9862. ________________________________________________________________________
  9863.  
  9864. type: function (subr) 
  9865. location: built-in
  9866. source file: xllist.c
  9867. Common LISP compatible: similar
  9868. supported on: all machines
  9869.  
  9870. SYNTAX
  9871.  
  9872. (remove-if <test> <list-expr> )
  9873.     <test>        -    the test function to be performed
  9874.     <list-expr>    -    the list to remove from 
  9875.  
  9876. DESCRIPTION
  9877.  
  9878. REMOVE-IF  searches  through  <list-expr>  and removes any elements that
  9879. pass the <test>.  Note that this operation is  non-destructive,  it does
  9880. not modify or affect <list-expr>  directly - it creates a modified copy.
  9881.  
  9882. EXAMPLES
  9883.  
  9884.     (setq mylist '(1 2 3 4 5 6 7 8))    ; set up a list
  9885.     (remove-if 'oddp mylist)        ; returns (2 4 6 8)
  9886.     (remove-if 'evenp mylist)        ; returns (1 3 5 7)
  9887.     (print mylist)                ; prints (1 2 3 4 5 6 7 8)
  9888.                         ;   note that MYLIST is not
  9889.                         ;   affected 
  9890.  
  9891.     (setq mylist '(a nil b nil c))        ; set up a list
  9892.     (remove-if 'null mylist)        ; returns (A B C)
  9893.  
  9894. COMMON LISP COMPATABILITY:
  9895. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  9896. keywords which Common LISP does.
  9897.  
  9898.  
  9899. remove-if-not
  9900. ________________________________________________________________________
  9901.  
  9902. type: function (subr) 
  9903. location: built-in
  9904. source file: xllist.c
  9905. Common LISP compatible: similar
  9906. supported on: all machines
  9907.  
  9908. SYNTAX
  9909.  
  9910. (remove-if-not <test> <list-expr> )
  9911.     <test>        -    the test function to be performed
  9912.     <list-expr>    -    the list to remove from 
  9913.  
  9914. DESCRIPTION
  9915.  
  9916. REMOVE-IF-NOT searches through <list-expr> and removes any elements that
  9917. fail the <test>.  Note that this operation is  non-destructive,  it does
  9918. not modify or affect <list-expr>  directly - it creates a modified copy.
  9919.  
  9920. EXAMPLES
  9921.  
  9922.     (setq mylist '(1 2 3 4 5 6 7 8))    ; set up a list
  9923.     (remove-if-not 'oddp mylist)        ; returns (1 3 5 7)
  9924.     (remove-if-not 'evenp mylist)        ; returns (2 4 6 8)
  9925.     (print mylist)                ; prints (1 2 3 4 5 6 7 8)
  9926.                         ;   note that MYLIST is not
  9927.                         ;   affected 
  9928.  
  9929.     (setq mylist '(a nil b nil c))        ; set up a list
  9930.     (remove-if-not 'null mylist)        ; returns (NIL NIL)
  9931.  
  9932. COMMON LISP COMPATABILITY:
  9933. XLISP does not support  the  :FROM-END,  :START,  :END,  :COUNT and :KEY
  9934. keywords which Common LISP does.
  9935.  
  9936.  
  9937. remprop
  9938. ________________________________________________________________________
  9939.  
  9940. type: function (subr) 
  9941. location: built-in
  9942. source file: xlbfun.c
  9943. Common LISP compatible: no
  9944. supported on: all machines
  9945.  
  9946. SYNTAX
  9947.  
  9948. (remprop <symbol> <property> )
  9949.     <symbol>    -    the symbol with a property list
  9950.     <property>    -    the property name being removed
  9951.  
  9952. DESCRIPTION
  9953.  
  9954. REMPROP removes the <property> from the <symbol>.  The function  returns
  9955. a NIL.  If the <property>  does not exist, there is no error  generated.
  9956. The  <symbol>  must be an  existing  symbol.  Property  lists are  lists
  9957. attached  to any user  defined  variables.  The lists are in the form of
  9958. (name1 val1 name2 val2 ....).  Any number of properties  may be attached
  9959. to a single variable.
  9960.  
  9961. EXAMPLES
  9962.  
  9963.     (setq person 'bobby)            ; create a var with a value
  9964.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  9965.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  9966.     (get person 'last-name)            ; retrieve LAST-NAME - boogie
  9967.     (get person 'job)            ; retrieve JOB - disc-jockey
  9968.     (get person 'height)            ; non-existant - returns NIL
  9969.     (remprop person 'job)            ; remove JOB
  9970.     (remprop person 'height)        ; remove non-existant
  9971.  
  9972. COMMON LISP COMPATIBILITY:
  9973. Common LISP does not have a REMPROP function.  It uses a SETF to achieve
  9974. this  functionality.  Porting  from  Common LISP to XLISP will work fine
  9975. since XLISP supports the SETF  modifications  of property lists and GET.
  9976. Porting from XLISP to Common LISP will require translating  REMPROP into
  9977. SETF forms.
  9978.  
  9979.  
  9980. rest
  9981. ________________________________________________________________________
  9982.  
  9983. type: function (subr) 
  9984. location: built-in
  9985. source file: xlinit.lsp
  9986. Common LISP compatible: yes
  9987. supported on: all machines
  9988.  
  9989. SYNTAX
  9990.  
  9991. (rest <expr> )
  9992.     <expr>        -    a list or list expression
  9993.  
  9994. DESCRIPTION
  9995.  
  9996. REST  returns the  remainder  of a list or list  expression  after first
  9997. element of the list is removed.  If the list is NIL, NIL is returned.
  9998.  
  9999. EXAMPLES
  10000.     (rest '(a b c))                ; returns (B C)
  10001.     (rest '((a b) c d))            ; returns (C D)
  10002.     (rest NIL)                ; returns NIL
  10003.     (rest 'a)                ; error: bad argument type
  10004.     (rest '(a))                ; returns NIL
  10005.  
  10006.     (setq sisters '(virginia vicki cindy))    ; set up variable SISTERS
  10007.     (first sisters)                ; returns VIRGINIA
  10008.     (rest sisters)                ; returns (VICKI CINDY)
  10009.  
  10010. NOTE:
  10011. The REST function is set to the same  code as CDR.  
  10012.  
  10013.  
  10014. &rest
  10015. ________________________________________________________________________
  10016.  
  10017. type: keyword
  10018. location: built-in
  10019. source file: xleval.c
  10020. Common LISP compatible: yes
  10021. supported on: all machines
  10022.  
  10023. SYNTAX
  10024.  
  10025. &rest [ <rest-arg> ]
  10026.     <rest-arg>    -    rest argument symbol
  10027.  
  10028. DESCRIPTION
  10029.  
  10030. In XLISP, there are several times that you define a formal argument list
  10031. for a body of code (like DEFUN,  DEFMACRO,  :ANSWER and LAMBDA).  All of
  10032. the formal  arguments  that are  defined are  required  to appear in the
  10033. invocation  of the  defined  function  or  operation.  If there  are any
  10034. &OPTIONAL  arguments defined, they will be filled in order.  If there is
  10035. a &REST  argument  defined, and all the required  formal  arguments  and
  10036. &OPTIONAL  arguments are filled, any and all further  parameters will be
  10037. passed into the function via the <rarg> argument.  There can be only one
  10038. <rest-arg> argument for &REST.  If there are insufficient parameters for
  10039. any of the &OPTIONAL or &REST  arguments, they will contain NIL.  At the
  10040. end of the  function or  operation  execution,  these local  symbols and
  10041. their values are are removed.
  10042.  
  10043. EXAMPLES
  10044.  
  10045.     (defun foo                 ; define function FOO
  10046.       (a b &optional c d &rest e)        ;   with some of each argument
  10047.       (print a) (print b)             ;
  10048.       (print c) (print d)             ;   print out each
  10049.       (print e))                ;
  10050.     (foo)                    ; error: too few arguments 
  10051.     (foo 1)                    ; error: too few arguments 
  10052.     (foo 1 2)                ; prints 1 2 NIL NIL NIL
  10053.     (foo 1 2 3)                ; prints 1 2 3 NIL NIL
  10054.     (foo 1 2 3 4)                ; prints 1 2 3 4 NIL
  10055.     (foo 1 2 3 4 5)                ; prints 1 2 3 4 (5)
  10056.     (foo 1 2 3 4 5 6 7 8 9)            ; prints 1 2 3 4 (5 6 7 8 9)
  10057.  
  10058.  
  10059.     (defun my-add                 ; define function MY-ADD
  10060.       (num1 &rest num-list &aux sum)    ;   with 1 arg, rest, 1 aux var
  10061.       (setq sum num1)            ;   clear SUM
  10062.       (dotimes (i (length num-list) )    ;   loop through rest list
  10063.          (setq sum (+ sum (car num-list)))  ;      add the number to sum
  10064.          (setq num-list (cdr num-list)))    ;      and remove num from list
  10065.       sum)                    ;   return sum when finished
  10066.     (my-add 1 2 3 4)            ; returns 10
  10067.     (my-add 5 5 5 5 5)            ; returns 25
  10068.  
  10069.  
  10070. restore
  10071. ________________________________________________________________________
  10072.  
  10073. type: function (subr)  
  10074. location: built-in
  10075. source file: xldmem.c  xlimage.c
  10076. Common LISP compatible: no
  10077. supported on: all machines
  10078.  
  10079. SYNTAX
  10080.  
  10081. (restore <file> )
  10082.     <file>        -    a string or symbol for the name of the file 
  10083.  
  10084. DESCRIPTION
  10085.  
  10086. The RESTORE  function  restores  the  previously  saved XLISP  workspace
  10087. (system state) from the specified file.  The <file> may be a string or a
  10088. symbol.  If the  <file>  does not  include a '.wks'  suffix,  it will be
  10089. extended to be called  <file>.wks.  If successful,  RESTORE will print a
  10090. message saying
  10091.  
  10092.     [ returning to the top level ]
  10093.  
  10094. and will not return any value.  If RESTORE  fails, it will  return  NIL.
  10095. There can be several saved workspaces.  These workspaces can be restored
  10096. as often as desired.
  10097.  
  10098. EXAMPLES
  10099.     (defun myfoo (fee fi)             ; create a function
  10100.         (+ fee fi))
  10101.     (setq myvar 5)                ; set MYVAR to value 5
  10102.     myvar                    ; returns 5
  10103.     (save 'farp)                ; save workspace in FARP.wks
  10104.  
  10105.     (setq myvar "garp")            ; change MYVAR to "garp"
  10106.     myvar                    ; returns "garp"
  10107.  
  10108.     (restore 'farp)                ; restore workspace
  10109.     myvar                    ; returns 5
  10110.  
  10111. FILE NAMES:
  10112. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  10113. automatically made uppercase.  In using XLISP, this means you don't have
  10114. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  10115. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  10116. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  10117. if you do a (open 'foo-file :direction :output), this will create a file
  10118. named  "FOO-FILE"  because  XLISP  uppercases  its symbols.  If you do a
  10119. (open  "foo-file"  :direction  :output),  this will  create a file named
  10120. "foo-file"  because UNIX doesn't uppercase its file names.  Another case
  10121. is if you do (save 'world), this will create the file  "WORLD.wks".  So,
  10122. if you are having  trouble  with opening and  accessing  files, check to
  10123. make sure the file name is in the proper case.
  10124.  
  10125.  
  10126. return
  10127. ________________________________________________________________________
  10128.  
  10129. type: special form (fsubr)
  10130. location: built-in
  10131. source file: xlcont.c
  10132. Common LISP compatible: yes
  10133. supported on: all machines
  10134.  
  10135. SYNTAX
  10136.  
  10137. (return  [ <expr> ] )
  10138.     <expr>        -    an expression
  10139.  
  10140. DESCRIPTION
  10141.  
  10142. The RETURN  special  form  allows the  return of an  arbitrary  value at
  10143. arbitrary  times within 'block'  constructs  (DO, DO*, DOLIST,  DOTIMES,
  10144. LOOP, PROG and PROG*).  The <expr> will be returned by the outer 'block'
  10145. construct.  A NIL will be returned  by the outer  'block'  construct  if
  10146. there is no <expr>  specified.  If RETURN is used without being within a
  10147. valid 'block'  construct, an error is generated:  "error:  no target for
  10148. RETURN".
  10149.  
  10150. EXAMPLES
  10151.  
  10152.     (prog (i)                 ; PROG form
  10153.       (print i) (RETURN "foo") (print j))    ; prints  NIL     returns "foo"
  10154.  
  10155.     (dotimes (i 10)             ;
  10156.       (if (eql i 5) (RETURN 20)         ;
  10157.               (princ i)))        ; prints  01234      returns 20
  10158.  
  10159.     (prog1 (print "hi") (RETURN "foo"))    ; prints  "hi"
  10160.                         ; error: no target for RETURN
  10161.  
  10162.     (return 9)                ; error: no target for RETURN 
  10163.  
  10164.  
  10165. return-from
  10166. ________________________________________________________________________
  10167.  
  10168. type: special form (fsubr)
  10169. location: built-in
  10170. source file: xlcont.c
  10171. Common LISP compatible: yes
  10172. supported on: all machines
  10173.  
  10174. SYNTAX
  10175.  
  10176. (return-from  <name> [ <expr> ] )
  10177.     <name>        -    an unevaluated symbol for the block name
  10178.     <expr>        -    an expression
  10179.  
  10180. DESCRIPTION
  10181.  
  10182. The RETURN-FROM  special form allows the return of an arbitrary value at
  10183. arbitrary  times  within  a  'named-block'   construct  (BLOCK)  of  the
  10184. specified  <name>.  The <expr> will be returned by the BLOCK  construct.
  10185. A NIL will be  returned  by the  BLOCK  construct  if there is no <expr>
  10186. specified.  If  RETURN-FROM  is used without  being within a valid BLOCK
  10187. construct, an error is generated:  "error:  no target for RETURN".
  10188.  
  10189. EXAMPLES
  10190.  
  10191.     (block out                 ; outer BLOCK
  10192.        (print "outer")            ; 
  10193.        (block in                 ; inner BLOCK
  10194.         (print "inner")            ;
  10195.         (return-from out "all done")    ;
  10196.         (print "won't get here")    ;
  10197.        )                    ;
  10198.     )                    ; prints "outer"
  10199.                         ; prints "inner"
  10200.                         ; returns "all done"
  10201.  
  10202.     (return-from nobody 9)            ; error: no target for RETURN 
  10203.  
  10204.  
  10205. reverse
  10206. ________________________________________________________________________
  10207.  
  10208. type: function (subr) 
  10209. location: built-in
  10210. source file: xllist.c
  10211. Common LISP compatible: yes
  10212. supported on: all machines
  10213.  
  10214. SYNTAX
  10215.  
  10216. (reverse <list-expr> )
  10217.     <list-expr>    -    a list or list expression
  10218.  
  10219. DESCRIPTION
  10220.  
  10221. The REVERSE function reverses the <list-expr>.  The reversed list is the
  10222. returned value.  The reversal  process only occurs on the 'top-level' of
  10223. the <list-expr>.  If there are nested  sub-lists, these are left intact.
  10224.  
  10225. EXAMPLES
  10226.  
  10227.     (reverse NIL)                ; returns NIL
  10228.     (reverse 'a)                ; error: bad argument type 
  10229.     (reverse '(a))                ; returns (A)
  10230.     (reverse '(a b c))            ; returns (C B A)
  10231.     (reverse '((a b) (c d) (e f)))        ; returns ((E F) (C D) (A B))
  10232.     (reverse (list (+ 1 2) (+ 3 4)))    ; returns (7 3)
  10233.  
  10234.  
  10235. room
  10236. ________________________________________________________________________
  10237.  
  10238. type: function (subr) 
  10239. location: built-in
  10240. source file: xldmem.c
  10241. Common LISP compatible: yes
  10242. supported on: all machines
  10243.  
  10244. SYNTAX
  10245.  
  10246. (room [ <info> ] )
  10247.     <info>        -    an optional, unused expression 
  10248.  
  10249. DESCRIPTION
  10250.  
  10251. The  ROOM   function   prints   the   current   memory   statistics   to
  10252. *STANDARD-OUTPUT*.  NIL  is  always  returned.  The  message  shows  the
  10253. statistics  for total  NODES,  current  FREE  NODES,  current  number of
  10254. allocated memory  SEGMENTS, node size of the ALLOCATEd  memory segments,
  10255. TOTAL memory in bytes and total number of garbage  COLLECTIONS that have
  10256. occured since this session of XLISP started.
  10257.  
  10258. EXAMPLES
  10259.  
  10260.     (room)                    ; prints  Nodes:       4000
  10261.                         ;      Free nodes:  1723
  10262.                         ;      Segments:    4
  10263.                         ;         Allocate:    1000
  10264.                         ;      Total:       52566
  10265.                         ;      Collections: 8
  10266.                         ; returns NIL
  10267.  
  10268. COMMON LISP COMPATABILITY:
  10269. In Common LISP, the <info>  argument  controls the amount of information
  10270. that is printed.
  10271.  
  10272. COMMON LISP COMPATABILITY:
  10273. The  form  of  and   information   provided   by  the  ROOM   output  is
  10274. implementation dependent.  For portability, you should not count on this
  10275. information or form.
  10276.  
  10277.  
  10278. rplaca
  10279. ________________________________________________________________________
  10280.  
  10281. type: function (subr) 
  10282. location: built-in
  10283. source file: xllist.c
  10284. Common LISP compatible: yes
  10285. supported on: all machines
  10286.  
  10287. SYNTAX
  10288.  
  10289. (rplaca <list> <expr> )
  10290.     <list>        -    the list to DESTRUCTIVELY modify
  10291.     <expr>        -    the expression to replace CAR of <list>
  10292.  
  10293. DESCRIPTION
  10294.  
  10295. RPLACA destructively modifies the CAR of <list> and replaces it with the
  10296. <expr>.  The destructive  aspect of this operation means that the actual
  10297. symbol  value  is used in the  list-modifying  operations  - not a copy.
  10298. <list>  must  evaluate to a valid list.  An atom or NIL for <list>  will
  10299. result in an error.
  10300.  
  10301. EXAMPLES
  10302.  
  10303.     (setq a '(1 2 3))            ; make A with value (1 2 3)
  10304.     (setq b '(1 2 3))            ; make B with value (1 2 3)
  10305.     (setq c a)                ; make C point to A's value 
  10306.     (rplaca a 'new)                ; returns (NEW 2 3)
  10307.     (print a)                ; prints (NEW 2 3)
  10308.                         ; NOTE THAT A IS MODIFIED!
  10309.     (print b)                ; prints (1 2 3)
  10310.                         ; note that B is not modified
  10311.     (print c)                ; prints (NEW 2 3)
  10312.                         ; NOTE THAT C IS MODIFIED TOO!
  10313.  
  10314.     (setq a '(1 2 3))            ; reset A to value (1 2 3)
  10315.     (rplaca a '(the sub list))        ; returns ((THE SUB LIST) 2 3)
  10316.     (rplaca '(1 2 3) 'more)            ; returns (MORE 2 3)
  10317.  
  10318.     (rplaca 'a 'b)                ; error: bad argument type 
  10319.      (rplaca NIL 'b)                ; error: bad argument type
  10320.  
  10321.  
  10322. rplacd
  10323. ________________________________________________________________________
  10324.  
  10325. type: function (subr) 
  10326. location: built-in
  10327. source file: xllist.c
  10328. Common LISP compatible: yes
  10329. supported on: all machines
  10330.  
  10331. SYNTAX
  10332.  
  10333. (rplacd <list> <expr> )
  10334.     <list>        -    the list to DESTRUCTIVELY modify
  10335.     <expr>        -    the expression to replace the CDR of <list>
  10336.  
  10337. DESCRIPTION
  10338.  
  10339. RPLACD destructively modifies the CDR of <list> and replaces it with the
  10340. <expr>.  The destructive  aspect of this operation means that the actual
  10341. symbol  value  is used in the  list-modifying  operations  - not a copy.
  10342. <list>  must  evaluate to a valid list.  An atom or NIL for <list>  will
  10343. result in an error.
  10344.  
  10345. EXAMPLES
  10346.  
  10347.     (setq a '(1 2 3))            ; set up A with (1 2 3)
  10348.     (rplacd a 'new)                ; returns (1 . NEW)
  10349.     (print a)                ; prints (1 . NEW)
  10350.                         ; NOTE THAT A IS MODIFIED!
  10351.                         ; 
  10352.     (rplacd a '(a new list))        ; returns (1 A NEW LIST)
  10353.     (rplacd '(1 2 3) '(more))        ; returns (1 MORE)
  10354.     (rplacd 'a 'b)                ; error: bad argument type
  10355.     (rplacd NIL 'b)                ; error: bad argument type
  10356.  
  10357.  
  10358. save
  10359. ________________________________________________________________________
  10360.  
  10361. type: function (subr)  
  10362. location: built-in
  10363. source file: xldmem.c  xlimage.c
  10364. Common LISP compatible: no
  10365. supported on: all machines
  10366.  
  10367. SYNTAX
  10368.  
  10369. (save <file> )
  10370.     <file>        -    a string or symbol for the name of the file 
  10371.  
  10372. DESCRIPTION
  10373.  
  10374. The SAVE function saves the current XLISP  workspace  (system  state) to
  10375. the  specified  file.  The  <file>  may be a string or a symbol.  If the
  10376. <file>  does not  include a '.wks'  suffix,  it will be  extended  to be
  10377. called <file>.wks.  The function returns T if the workspace was properly
  10378. created  and  saved, NIL is  returned  otherwise.  There can be  several
  10379. saved workspaces.  These workspaces can be restored as often as desired.
  10380.  
  10381. EXAMPLES
  10382.     (defun myfoo (fee fi)             ; create a function
  10383.         (+ fee fi))
  10384.     (setq myvar 5)                ; set MYVAR to value 5
  10385.     myvar                    ; returns 5
  10386.     (save 'farp)                ; save workspace in FARP.wks
  10387.  
  10388.     (setq myvar "garp")            ; change MYVAR to "garp"
  10389.     myvar                    ; returns "garp"
  10390.  
  10391.     (restore 'farp)                ; restore workspace
  10392.     myvar                    ; returns 5
  10393.  
  10394. BUG:
  10395. The SAVE  function  generates a system error if the <file> being created
  10396. already exists.  This <file> will be modified and will not be restorable
  10397. after restarting XLISP.
  10398.  
  10399. NOTE:
  10400. The saved workspace size is implementation  dependent, but can be fairly
  10401. large.
  10402.  
  10403. FILE NAMES:
  10404. In the PC and DOS world, all file names and extensions  ("FOO.BAT")  are
  10405. automatically made uppercase.  In using XLISP, this means you don't have
  10406. to  worry  about  whether  the  name  is  "foo.bat",  "FOO.BAT"  or even
  10407. "FoO.bAt" - they will all work.  However, in other file systems (UNIX in
  10408. particular),  uppercase and lowercase do make a difference.  So, in UNIX
  10409. if you do a (open 'foo-file :direction :output), this will create a file
  10410. named  "FOO-FILE"  because  XLISP  uppercases  its symbols.  If you do a
  10411. (open  "foo-file"  :direction  :output),  this will  create a file named
  10412. "foo-file"  because UNIX doesn't uppercase its file names.  Another case
  10413. is if you do (save 'world), this will create the file  "WORLD.wks".  So,
  10414. if you are having  trouble  with opening and  accessing  files, check to
  10415. make sure the file name is in the proper case.
  10416.  
  10417. COMMON LISP COMPATABILITY:
  10418. The SAVE function is similar in use to the SAVE-WORLD function in Common
  10419. LISP.  The primarily difference is that SAVE-WORLD allows you to restart
  10420. everything  since it  creates  an  executable  file.  The SAVE  function
  10421. requires  you to start  XLISP up first and then do a RESTORE.  Depending
  10422. on the  operating  system that you are using, it is possible  to write a
  10423. SAVE-WORLD equivalent using SAVE, RESTORE and SYSTEM functions.
  10424.  
  10425.  
  10426. savefun
  10427. ________________________________________________________________________
  10428.  
  10429. type: defined macro (closure)  
  10430. location: extension
  10431. source file: init.lsp
  10432. Common LISP compatible: no
  10433. supported on: all machines
  10434.  
  10435. SYNTAX
  10436.  
  10437. (savefun <function> )
  10438.     <function>    -    the name of the function or macro to be saved
  10439.  
  10440. DESCRIPTION
  10441.  
  10442. The SAVEFUN macro saves the specified  function or macro to a file.  The
  10443. file will be called  <function>.lsp.  The macro  returns  the file  name
  10444. that was created.  An error will occur if the  <function>  parameter  is
  10445. not a function or macro.
  10446.  
  10447. EXAMPLES
  10448.     (defun myfoo (fee fi)             ; create a function
  10449.         (+ fee fi))
  10450.     (savefun myfoo)                ; saves MYFOO to "MYFOO.lsp"
  10451.     (savefun savefun)            ; saves SAVEFUN to "SAVEFUN.lsp"
  10452.     (savefun 'a)                ; error: bad argument type
  10453.  
  10454. NOTE:
  10455. The SAVEFUN macro is defined in the INIT.LSP  file.  If SAVEFUN does not
  10456. exist in your XLISP system, you might be having a problem with INIT.LSP.
  10457. Before you start XLISP, look in the directory you are currently  in, and
  10458. check to see if there is an INIT.LSP.  Another  thing to try is to put a
  10459. PRINT message in the INIT.LSP  file and make sure that it is printed out
  10460. when XLISP starts running.
  10461.  
  10462.  
  10463. second
  10464. ________________________________________________________________________
  10465.  
  10466. type: function (subr) 
  10467. location: built-in
  10468. source file: xlinit.c
  10469. Common LISP compatible: yes
  10470. supported on: all machines
  10471.  
  10472. SYNTAX
  10473.  
  10474. (second <expr> )
  10475.     <expr>        -    a list or list expression
  10476.  
  10477. DESCRIPTION
  10478.  
  10479. SECOND returns the second element of a list or list  expression.  If the
  10480. list is NIL, NIL is returned.
  10481.  
  10482. EXAMPLES
  10483.     (second '(1 2 3))            ; returns 2
  10484.     (second NIL)                ; returns NIL
  10485.  
  10486.     (setq carol '(a b c))            ; set up variable CAROL
  10487.     (first carol)                ; returns A
  10488.     (second carol)                ; returns B
  10489.     (rest carol)                ; returns (B C)
  10490.  
  10491.     (setq children '(amanda ben))        ; set up variable CHILDREN
  10492.     (second children)            ; returns BEN
  10493.  
  10494. NOTE:
  10495. This  function is set to the same  code as CADR.  
  10496.  
  10497.  
  10498. self
  10499. ________________________________________________________________________
  10500.  
  10501. type: symbol
  10502. location: built-in
  10503. source file: xlobj.c
  10504. Common LISP compatible: no
  10505. supported on: all machines
  10506.  
  10507. SYNTAX
  10508.  
  10509. self
  10510.  
  10511. DESCRIPTION
  10512.  
  10513. SELF evaluates to the current object when used within a message context.
  10514.  
  10515. EXAMPLES
  10516.     (setq my-class                 ; create MY-CLASS with STATE
  10517.         (send class :new '(state)))    ;
  10518.     (send my-class :answer :isnew '()    ; set up initialization
  10519.         '((setq state nil) SELF))    ;     returning SELF 
  10520.     (send my-class :answer :set-it '(value)    ; create :SET-IT message
  10521.         '((setq state value)))        ;
  10522.     (setq my-obj (send my-class :new))    ; create MY-OBJ of MY-CLASS
  10523.     (send my-obj :set-it 5)            ; STATE is set to 5
  10524.  
  10525. CONTEXT: 
  10526. SELF does not exist  except  within  the  context  of a method  and it's
  10527. execution.
  10528.  
  10529. NOTE:
  10530. In the previous  example,  there is a SELF in the line that  creates the
  10531. :SET-IT  message.  What this does is to return  the  object  as the last
  10532. operation when you do an :ISNEW.
  10533.  
  10534.  
  10535. send
  10536. ________________________________________________________________________
  10537.  
  10538. type: function (subr)
  10539. location: built-in
  10540. source file: xlobj.c
  10541. Common LISP compatible: no
  10542. supported on: all machines
  10543.  
  10544. SYNTAX
  10545.  
  10546. (send <object> <message> [<args>] )
  10547.     <object>    -    an object 
  10548.     <message>    -    message selector for object
  10549.     <arg>        -    parameter sent to object method
  10550.  
  10551. DESCRIPTION
  10552.  
  10553. The  SEND  function  is the  mechanism  used to send a  <message>  to an
  10554. <object>.  The <message> is the message  selector symbol that is used to
  10555. select a particular action (method) from the object.
  10556.  
  10557. EXAMPLES
  10558.     (setq myclass (send class :new '(var)))    ; create MYCLASS with VAR
  10559.     (send myclass :answer :isnew '()    ; set up initialization
  10560.         '((setq var nil) self))
  10561.     (send myclass :answer :set-it '(value)    ; create :SET-IT message
  10562.         '((setq var value)))    
  10563.     (setq my-obj (send myclass :new))    ; create MY-OBJ of MYCLASS
  10564.     (send my-obj :set-it 5)            ; VAR is set to 5
  10565.  
  10566. BUILT-IN METHODS:
  10567. The built in methods in XLISP include:
  10568.  
  10569.         <message>    operation
  10570.         -------------------------------------------------------
  10571.         :ANSWER        Add a method to an object.
  10572.         :CLASS        Return the object's class.
  10573.         :ISNEW        Run initialization code on object.
  10574.         :NEW        Create a new object (instance or class).
  10575.         :SHOW        Show the internal state of the object.
  10576.  
  10577. MESSAGE STRUCTURE:
  10578. The normal XLISP  convention  for a <message> is to have a valid  symbol
  10579. preceeded  by a  colon  like  :ISNEW  or  :MY-MESSAGE.  However,  it  is
  10580. possible  to define a  <message>  that is a symbol  without a colon, but
  10581. this makes the code less readable.
  10582.  
  10583.  
  10584. send-super
  10585. ________________________________________________________________________
  10586.  
  10587. type: function (subr)
  10588. location: built-in
  10589. source file: xlobj.c
  10590. Common LISP compatible: no
  10591. supported on: all machines
  10592.  
  10593. SYNTAX
  10594.  
  10595. (send-super <message> [<args>])
  10596.     <message>    -    the message selector
  10597.     <args>        -    the optional message arguments
  10598.  
  10599. DESCRIPTION
  10600.  
  10601. The  SEND-SUPER  function  sends the specified  arguments  <args> to the
  10602. <message>  specified  method  of the  superclass.  It is  necessary  for
  10603. SEND-SUPER  to be executed  from within a method  being  performed on an
  10604. object.  It  will   return  the  result  of  sending  the   message.  If
  10605. SEND-SUPER is performed  outside of a method an error  "error:  not in a
  10606. method" will result.
  10607.  
  10608. EXAMPLES
  10609.     (setq a-class (send class :new '()))    ; create A-CLASS 
  10610.     (send a-class :answer :show '()        ; set up special SHOW method
  10611.         '((print "nobody here") self))    ;
  10612.     (setq an-obj (send a-class :new))    ; create AN-OBJ of A-CLASS
  10613.     (send an-obj :show)            ; prints "nobody here"
  10614.     (send a-class :answer :myshow '()    ; set up MYSHOW method which
  10615.         '((send-super :show )))        ;     calls :SHOW in superclass
  10616.     (send an-obj :myshow)            ; prints Object is ............
  10617.  
  10618.  
  10619. :sescape
  10620. ________________________________________________________________________
  10621.  
  10622. type: keyword
  10623. location: built-in
  10624. source file: xlread.c
  10625. Common LISP compatible: no
  10626. supported on: all machines
  10627.  
  10628. SYNTAX
  10629.  
  10630. :sescape
  10631.  
  10632.  
  10633. DESCRIPTION
  10634.  
  10635. :SESCAPE is an entry that is used in the  *READTABLE*.  *READTABLE* is a
  10636. system  variable that contains  XLISP's data structures  relating to the
  10637. processing  of  characters  from  the  user (or  files)  and  read-macro
  10638. expansions.  The  existance  of the  :SESCAPE  keyword  means  that  the
  10639. specified  character  is to be used as a single  escape  character.  The
  10640. system defines that the the vertical bar character \ is the only defined
  10641. :SESCAPE character.
  10642.  
  10643. EXAMPLES
  10644.  
  10645.     (defun look-at (table)            ; define a function to 
  10646.      (dotimes (ch 127)            ;   look in a table
  10647.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  10648.         (case entry             ;   entries with a function
  10649.           (:SESCAPE             ;
  10650.               (princ (int-char ch)))    ;
  10651.           (T        NIL))))        ;
  10652.      (terpri))                ;
  10653.     (look-at *readtable*)            ;  prints  \ 
  10654.  
  10655. CAUTION:
  10656. If you experiment  with  *READTABLE*, it is useful to save the old value
  10657. in a variable, so that you can restore the system state.
  10658.  
  10659.  
  10660. set
  10661. ________________________________________________________________________
  10662.  
  10663. type: function (subr) 
  10664. location: built-in
  10665. source file: xlbfun.c
  10666. Common LISP compatible: yes
  10667. supported on: all machines
  10668.  
  10669. SYNTAX
  10670.  
  10671. (set <symbol> <expr> )
  10672.     <symbol>    -    expression that evaluates to a symbol name
  10673.                 (if expression is quoted, no evaluation occurs)
  10674.     <expr>        -    an expression - which will be the new value
  10675.  
  10676. DESCRIPTION
  10677.  
  10678. SET  evaluates  <symbol> and sets <expr> as it's value.  If the <symbol>
  10679. value is quoted (via the QUOTE  special form or  read-macro  expansion),
  10680. the  <symbol>  is not  evaluated.  SET returns  the value from <expr> as
  10681. it's result.
  10682.  
  10683. EXAMPLES
  10684.  
  10685.     (set 'a 2)                ; sets symbol A to value 2
  10686.     (set 'value a)                ; sets symbol VALUE to value 2
  10687.     (print value)                ; show the value - prints 2
  10688.     (set 'name 'myvar)            ; set symbol NAME to value MYVAR
  10689.     (set name 12345)            ; set symbol which is the value
  10690.                         ;     of NAME (MYVAR) to 12345
  10691.     (print name)                ; prints MYVAR    
  10692.     (print myvar)                ; prints 12345
  10693.  
  10694.     (set notsymbol 1)            ; error: unbound variable
  10695.     (set name notvalue)            ; error: unbound variable
  10696.  
  10697.  
  10698. setf
  10699. ________________________________________________________________________
  10700.  
  10701. type: special form (fsubr)
  10702. location: built-in
  10703. source file: xlcont.c
  10704. Common LISP compatible: yes
  10705. supported on: all machines
  10706.  
  10707. SYNTAX
  10708.  
  10709. (setf [ <place1> <expr1> ... ] )
  10710.     <placeN>    -    a field specifier which may be one of:
  10711.                 <symbol>        (car <expr> )
  10712.                 (cdr <expr> )        (nth <n> <expr> )
  10713.                 (aref <expr> <n> )    (get <symb> <property> )
  10714.                 (symbol-value <symb> )    (symbol-plist <symb> )
  10715.     <exprN>        -    an expression - which will be the new value
  10716.  
  10717. DESCRIPTION
  10718.  
  10719. SETF  evaluates the field <placeN> and sets <exprN> as it's value.  This
  10720. is a  generalized  tool that allows you to set the value of the  various
  10721. data types of the system.  SETF  returns the value from  <exprN> as it's
  10722. result.  The specific action of SETF depends on the <placeN> field.
  10723.  
  10724. EXAMPLES
  10725.  
  10726.                         ; SETF SYMBOL
  10727.     (setf a 123)                ; set a symbol A to value 123    
  10728.  
  10729.                         ; SETF SYMBOL-VALUE
  10730.     (setq x 'y)                ; make symbol X with value Y
  10731.     (setf (symbol-value x) 'z)        ; set symbol that X contains (Y)
  10732.                         ;   to value Z
  10733.     
  10734.                         ; SETF LIST ELEMENTS
  10735.     (setq mylist '(a b c d))        ; MYLIST with value (A B C D)
  10736.     (setf (car mylist) 'x)            ; change CAR of MYLIST to X
  10737.                         ;   MYLIST now is (X B C D)
  10738.     (setf (cdr mylist) '(y z da-end))    ; change CDR of MYLIST to 
  10739.                         ;   (Y Z DA-END) so that 
  10740.                         ;   MYLIST now is (X Y Z DA-END)
  10741.     (setf (nth 3 mylist) 'here-i-am)    ; change 3rd of MYLIST to 
  10742.                         ;   HERE-I-AM so that MYLIST
  10743.                         ;   now is (X Y Z HERE-I-AM)
  10744.  
  10745.                         ; SETF AREF
  10746.     (setq myarray (make-array 5))        ; make MYARRAY
  10747.     (aref myarray 2)            ; get value of element 2 = NIL
  10748.     (setf (aref myarray 2) 'new-value)    ; set value of element 2 to 
  10749.                         ;   value NEW-VALUE
  10750.     (print myarray)                ; prints 
  10751.                         ;   #(NIL NIL NEW-VALUE NIL NIL)
  10752.  
  10753.                         ; SETF PROPERTIES
  10754.     (setq person 'joe-bob)            ; make PERSON with value JOE-BOB
  10755.     (putprop person 'critic 'profession)    ; set PROFESSION property to 
  10756.                         ;   value CRITIC
  10757.     (setf (get person 'profession)         ; change PROFESSION to value
  10758.            'texas-critic)            ;   TEXAS-CRITIC
  10759.     (setf (get person 'home) 'texas)    ; add property HOME with 
  10760.                         ;   value TEXAS
  10761.     (symbol-plist person)            ; returns property list:
  10762.                         ;   (HOME TEXAS 
  10763.                         ;    PROFESSION TEXAS-CRITIC)
  10764.     (setf (symbol-plist person)         ; change the property list 
  10765.          '(home on-the-range         ;
  10766.            profession movie-critic))    ;
  10767.     (get person 'profession)        ; now returns MOVIE-CRITIC
  10768.     (get person 'home)            ; now returns ON-THE-RANGE
  10769.  
  10770. OPERATIONS:
  10771.     <placeN>        SETF action
  10772.     -------------------------------------------------------------------
  10773.     <symbol>                Sets the value of  <symbol> to the value
  10774.                 of  <exprN>.  This  is  equivalent  to a
  10775.                 (SETQ <symbol> <exprN> ).
  10776.  
  10777.     (car <expr> )           Sets the  first  element  of the  <expr>
  10778.                 list to <exprN>.  <expr> must be a list.
  10779.                 This is equivalent  to a (RPLACA  <expr>
  10780.                 <exprN> ) except  that SETF will  return
  10781.                 <exprN>  as the  value.  (cdr  <expr>  )
  10782.                 Sets  the  tail of the  <expr>  list  to
  10783.                 <exprN>.  <expr>  must  be a list.  This
  10784.                 is  equivalent   to  a  (RPLACD   <expr>
  10785.                 <exprN> ) except  that SETF will  return
  10786.                 <exprN> as the value.
  10787.  
  10788.     (nth <n> <expr> )       Sets the  <n>th  element  of the  <expr>
  10789.                 list to <exprN>.  <expr> must be a list.
  10790.                 This  allows  you  to  set an  arbitrary
  10791.                 element of a list to an arbitrary value.
  10792.                 Note that the list is numbered  from the
  10793.                 0th element (0, 1, 2, 3, ...).
  10794.  
  10795.     (aref <expr> <n> )      Sets the  <n>th  element  of the  <expr>
  10796.                 array  to  <exprN>.  <expr>  must  be an
  10797.                 array.  This   allows   you  to  set  an
  10798.                 arbitrary  element  of an  array  to  an
  10799.                 arbitrary  value.  Note that the list is
  10800.                 numbered  from the 0th element (0, 1, 2,
  10801.                 3,  ...).  Note  also  that  this is the
  10802.                 intended  way to  set  the  value  of an
  10803.                 array element.
  10804.  
  10805.     (get <sym> <prop> )     Sets the  <prop>  of <sym> to the  value
  10806.                 <exprN>.  If <sym>  does  not  have  the
  10807.                 <prop>,  one  will be  created.  This is
  10808.                 equivalent  to  (PUTPROP  <sym>  <exprN>
  10809.                 <prop> ).
  10810.  
  10811.     (symbol-value <symbol>) Sets  the  symbol's   value  to  contain
  10812.                 <exprN>.  <symbol> is an expression that
  10813.                 must  evaluate  to a valid  symbol  - it
  10814.                 doesn't  have to exist  before the SETF,
  10815.                 it just has to be a valid  symbol.  This
  10816.                 is equivalent to (SET  <symbol>  <exprN>
  10817.                 ).
  10818.  
  10819.     (symbol-plist <symbol>) Sets the  property  list of  <symbol> to
  10820.                 <exprN>.  This  allows you to change (or
  10821.                 destroy) the entire  property  list of a
  10822.                 <symbol> at one time.
  10823.  
  10824.  
  10825. set-macro-character
  10826. ________________________________________________________________________
  10827.  
  10828. type: defined function (closure) 
  10829. location: extension
  10830. source file: init.lsp
  10831. Common LISP compatible: related
  10832. supported on: all machines
  10833.  
  10834. SYNTAX
  10835.  
  10836. (set-macro-character <char-num> <function>  [ <termflag> ] )
  10837.     <char-num>    -    an integer expression
  10838.     <function>    -    a function definition
  10839.     <termflag>    -    an expression - NIL or non-NIL
  10840.  
  10841. DESCRIPTION
  10842.  
  10843. The SET-MACRO-CHARACTER function installs the code that will be executed
  10844. when the specified  character  <char-num>  is  encountered  by the XLISP
  10845. reader.  The  <function> is placed in the  *READTABLE*  system  variable
  10846. which  contains  the  reader  table  array.  The  table  is 128  entries
  10847. (0..127)  for each of the 7-bit  ASCII  characters  that XLISP can read.
  10848. Each  entry in the  table  must be one of NIL,  :CONSTITUENT,  :SESCAPE,
  10849. :MESCAPE,  :WHITE-SPACE, a :TMACRO dotted pair or a :NMACRO dotted pair.
  10850. The SET-MACRO-CHARACTER function only allows you to put in a terminating
  10851. read-macro  function (:TMACRO) or a non-terminating  read-macro-function
  10852. (:NMACRO).  If  the   <termflag>  is  present  and  non-NIL,   then  the
  10853. <function> will be put in *READTABLE* as a :TMACRO entry.  If <termflag>
  10854. is not present or NIL, then  <function>  will be put in *READTABLE* as a
  10855. :NMACRO entry.  The <function> can be a built-in  read-macro function or
  10856. a user  defined  defun  symbol or a lambda  expression.  The  <function>
  10857. takes two parameters, an input stream specification, and an integer that
  10858. is  the  character  value.  The  <function>  should  return  NIL  if the
  10859. character  is  'white-space'  or a value  CONSed  with NIL to return the
  10860. value.  The function SET-MACRO-CHARACTER always returns T.
  10861.  
  10862. EXAMPLES
  10863.  
  10864.     (print "hi") % comment            ; prints  "hi"  and gives
  10865.                         ; error: unbound variable - %
  10866.                         ; because percent is viewed 
  10867.                         ; as a variable
  10868.                         ;
  10869.     (setq semi (get-macro-character #\;))    ; get semi-colon code
  10870.                         ;    
  10871.     (SET-MACRO-CHARACTER #\% semi T)    ; set % to work as a comment
  10872.                         ;
  10873.     (print "hi") % comment            ; prints  "hi" and no error
  10874.                         ; because % is now a comment
  10875.                         ; character in *READTABLE*
  10876.  
  10877. NOTE:
  10878. In the normal XLISP system the following characters have code associated
  10879. with them in the *READTABLE*:
  10880.  
  10881.         " # ' ( ) , ; `
  10882.  
  10883. NOTE:
  10884. The functions GET-MACRO-CHARACTER and SET-MACRO-CHARACTER are created in
  10885. the INIT.LSP file.  If they do not exist in your XLISP system, you might
  10886. be having a problem with  INIT.LSP.  Before you start XLISP, look in the
  10887. directory  you  are  currently  in,  and  check  to see if  there  is an
  10888. INIT.LSP.
  10889.  
  10890. COMMON LISP COMPATABILITY:
  10891. The SET-MACRO-CHARACTER  function is somewhat related to the Common LISP
  10892. SET-DISPATCH-MACRO-CHARACTER function.
  10893.  
  10894.  
  10895. setq
  10896. ________________________________________________________________________
  10897.  
  10898. type: special form (fsubr)
  10899. location: built-in
  10900. source file: xlcont.c
  10901. Common LISP compatible: yes
  10902. supported on: all machines
  10903.  
  10904. SYNTAX
  10905.  
  10906. (setq [ <symbol1> <expr1> ] ... )
  10907.     <symbolN>    -    un-evaluated symbol
  10908.     <exprN>        -    value for <symbolN>
  10909.  
  10910. DESCRIPTION
  10911.  
  10912. SETQ sets <expr> as the value of  <symbol>.  SETQ returns the value from
  10913. <expr> as it's result.
  10914.  
  10915. EXAMPLES
  10916.  
  10917.     (setq a 1)                ; symbol A gets value 1
  10918.     (setq b '(a b c))            ; symbol B gets value (A B C)
  10919.     (setq mynum (+ 3 4))            ; symbol MYNUM gets value 7
  10920.  
  10921.  
  10922. :show
  10923. ________________________________________________________________________
  10924.  
  10925. type: message selector
  10926. location: built-in
  10927. source file: xlobj.c
  10928. Common LISP compatible: no
  10929. supported on: all machines
  10930.  
  10931. SYNTAX
  10932.  
  10933. (send <object> :show)
  10934.     <object>    -    an existing object
  10935.  
  10936. DESCRIPTION
  10937.  
  10938. The :SHOW  message  selector  attempts to find the 'show'  method in the
  10939. specified   <object>'s  class.  Since  the  :SHOW  message  selector  is
  10940. built-in  in the root  class  (CLASS),  this is  always a valid  message
  10941. selector.  The object must already exist.
  10942.  
  10943. EXAMPLES
  10944.     (setq my-class                 ; create MY-CLASS with STATE
  10945.         (send class :new '(state)))    ;
  10946.     (send my-class :answer :isnew '()    ; set up initialization
  10947.         '((setq state nil) self))
  10948.     (send my-class :answer :set-it '(value)    ; create :SET-IT message
  10949.         '((setq state value)))    
  10950.     (setq my-obj (send my-class :new))    ; create MY-OBJ of MY-CLASS
  10951.     (send my-obj :show)            ; returns object state including
  10952.                         ;   STATE = NIL
  10953.     (send my-obj :set-it 5)            ; STATE is set to 5
  10954.     (send new-obj :show)            ; error: unbound variable
  10955.  
  10956.  
  10957. sin
  10958. ________________________________________________________________________
  10959.  
  10960. type: function (subr) 
  10961. location: built-in
  10962. source file: xlmath.c
  10963. Common LISP compatible: similar
  10964. supported on: all machines
  10965.  
  10966. SYNTAX
  10967.  
  10968. (sin <expr> )
  10969.     <expr>        -    floating point number/expression
  10970.  
  10971. DESCRIPTION
  10972.  
  10973. The SIN  function  returns  the sine of the  <expr>.  The  <expr>  is in
  10974. radians.
  10975.  
  10976. EXAMPLES
  10977.  
  10978.     (sin 0.0)                ; returns 0
  10979.     (sin .5)                ; returns 0.479426
  10980.     (sin 1.0)                ; returns 0.841471
  10981.     (sin (/ 3.14159 2))            ; returns 1
  10982.     (sin 3.14159)                ; returns 2.65359e-06
  10983.     (sin 0)                    ; error: bad integer operation
  10984.     (sin 1.)                ; error: bad integer operation
  10985.  
  10986. COMMON LISP COMPATABILITY:
  10987. Common LISP allows for integer numbers, which XLISP does not support for
  10988. SIN.
  10989.  
  10990.  
  10991. sort
  10992. ________________________________________________________________________
  10993.  
  10994. type: function (subr) 
  10995. location: built-in
  10996. source file: xllist.c
  10997. Common LISP compatible: similar
  10998. supported on: all machines
  10999.  
  11000. SYNTAX
  11001.  
  11002. (sort <list> <test> )
  11003.     <list>        -    a list containing elements to be sorted
  11004.     <test>        -    the test to use for the sort
  11005.  
  11006. DESCRIPTION
  11007.  
  11008. The SORT  function  sorts the <list> using the <test> to order the list.
  11009. The SORT function is destructive and modifies the <list>.
  11010.  
  11011. EXAMPLES
  11012.  
  11013.     (setq a '(3 1 4 1 5 9 6 7))        ; returns (3 1 4 1 5 9 6 7)
  11014.     (sort a '<)                ; returns (1 1 3 4 5 6 7 9)
  11015.     (print a)                ; returns (1 1 3 4 5 6 7 9)
  11016.                         ; notice that A is modified
  11017.     (sort a '> )                ; returns (9 7 6 5 4 3 1 1)
  11018.  
  11019.     (sort '("a" "bar" "foo") 'string> )    ; returns ("foo" "bar" "a")
  11020.  
  11021. BUG:
  11022. XLISP returns the proper  value, but  improperly  modifies the symbol or
  11023. actual <list>.
  11024.  
  11025. COMMON LISP COMPATABILITY:
  11026. Common LISP allows for a :KEY keyword (which allows a specified function
  11027. to be run  before  the  ordering  takes  place),  which  XLISP  does not
  11028. support.
  11029.  
  11030.  
  11031. sqrt
  11032. ________________________________________________________________________
  11033.  
  11034. type: function (subr) 
  11035. location: built-in
  11036. source file: xlmath.c
  11037. Common LISP compatible: similar
  11038. supported on: all machines
  11039.  
  11040. SYNTAX
  11041.  
  11042. (sqrt <expr> )
  11043.     <expr>        -    floating point number/expression
  11044.  
  11045. DESCRIPTION
  11046.  
  11047. The SQRT function  calculates the square root of <expr> and returns this
  11048. result.
  11049.  
  11050. EXAMPLES
  11051.  
  11052.     (sqrt 1.0)                ; returns 1
  11053.     (sqrt 2.0)                ; returns 1.41421
  11054.     (sqrt 3.0)                ; returns 1.73205
  11055.     (sqrt 4.0)                ; returns 2
  11056.     (sqrt 5.0)                ; returns 2.23607
  11057.     (sqrt -1.0)                ; error: sqrt of a neg. number 
  11058.     (sqrt 2)                ; error: bad integer operation
  11059.  
  11060. COMMON LISP COMPATABILITY:
  11061. Common LISP allows for integer numbers, which XLISP does not support for
  11062. SQRT.
  11063.  
  11064.  
  11065. *standard-input*
  11066. ________________________________________________________________________
  11067.  
  11068. type: system variable 
  11069. location: built-in
  11070. source file: xlinit.c 
  11071. Common LISP compatible: yes
  11072. supported on: all machines
  11073.  
  11074. SYNTAX
  11075.  
  11076. *standard-input*
  11077.  
  11078.  
  11079. DESCRIPTION
  11080.  
  11081. *STANDARD-INPUT*  is a system variable that contains a file pointer that
  11082. points to the file where all normal  input from the  programmer  or user
  11083. comes  from.  The  default  file  for  *STANDARD-INPUT*  is  the  system
  11084. standard input device - normally the system keyboard.
  11085.  
  11086. EXAMPLES
  11087.     *standard-input*            ; returns #<File-Stream: #2442e>
  11088.  
  11089. NOTE:
  11090. Be careful when modifying the  *STANDARD-INPUT*.  If you do not save the
  11091. old file pointer, you will not be able to return to normal operation and
  11092. will  need to exit  XLISP.  If the  file or  source  that you  have  set
  11093. *STANDARD-INPUT*  to does not  reset  *STANDARD-INPUT*  to its  previous
  11094. value, you will never get control back to the keyboard.
  11095.  
  11096.  
  11097. *standard-output*
  11098. ________________________________________________________________________
  11099.  
  11100. type: system variable 
  11101. location: built-in
  11102. source file: xlinit.c
  11103. Common LISP compatible: yes
  11104. supported on: all machines
  11105.  
  11106. SYNTAX
  11107.  
  11108. *standard-output*
  11109.  
  11110.  
  11111. DESCRIPTION
  11112.  
  11113. *STANDARD-OUTPUT* is a system variable that contains a file pointer that
  11114. points to the file where all normal  printing  and  messages  from XLISP
  11115. will go.  The default file for  *STANDARD-OUTPUT* is the system standard
  11116. output device - normally the screen display/crt.
  11117.  
  11118. EXAMPLES
  11119.     *standard-output*            ; returns #<File-Stream: #24406>
  11120.     (setq old-so *standard-output*)        ; save the file pointer
  11121.     (setq fp (open "f" :direction :output))    ; open a new output file
  11122.     (setq *standard-output* fp)        ; change where output goes
  11123.                         ;
  11124.     (+ 2 2)                    ; you won't see any messages
  11125.                         ; just the echo of input line
  11126.                         ;
  11127.     (setq *standard-output* old-so)        ; restore standard output
  11128.     (close fp)                ; close file
  11129.  
  11130. NOTE:
  11131. Be careful when modifying the *STANDARD-OUTPUT*, you will not be able to
  11132. see what you are  doing.  If you do not save the old file  pointer,  you
  11133. will not be able to return to  normal  operation  and will  need to exit
  11134. XLISP.
  11135.  
  11136.  
  11137. strcat
  11138. ________________________________________________________________________
  11139.  
  11140. type: function (subr) 
  11141. location: built-in
  11142. source file: xlstr.c
  11143. Common LISP compatible: no
  11144. supported on: all machines
  11145.  
  11146. SYNTAX
  11147.  
  11148. (strcat [ <string1> ... ] )
  11149.     <stringN>    -    a string expression
  11150.  
  11151. DESCRIPTION
  11152.  
  11153. The STRCAT function  returns the  concatenation  of a sequence of string
  11154. expressions.  If there are no strings, an empty string is returned.
  11155.  
  11156. EXAMPLES
  11157.  
  11158.     (strcat)                ; returns ""
  11159.     (strcat "a")                ; returns "a"
  11160.     (strcat "a" "b")            ; returns "ab"
  11161.     (strcat "ab" "cd" "ef")            ; returns "abcdef"
  11162.     (strcat "f" "ire tr" "uck")        ; returns "fire truck"
  11163.     (strcat 1 2)                ; error: bad argument type
  11164.  
  11165.  
  11166. streamp
  11167. ________________________________________________________________________
  11168.  
  11169. type: predicate function (subr)
  11170. location: built-in
  11171. source file: xlbfun.c
  11172. Common LISP compatible: yes
  11173. supported on: all machines
  11174.  
  11175. SYNTAX
  11176.  
  11177. (streamp <expr> )
  11178.     <expr>        -    the expression to check
  11179.  
  11180. DESCRIPTION
  11181.  
  11182. The STREAMP predicate checks if an <expr> is a stream.  T is returned if
  11183. <expr> is a stream, NIL is returned otherwise.
  11184.  
  11185. EXAMPLES
  11186.  
  11187.     (streamp *standard-input*)        ; returns T - stream
  11188.     (streamp *debug-io*)            ; returns T - stream
  11189.     (streamp (make-string-output-stream))    ; returns T - stream
  11190.     (setq a *standard-output*)        ;
  11191.     (streamp a)                ; returns T - evaluates to stream
  11192.  
  11193.     (streamp "a")                ; returns NIL - string
  11194.     (streamp #\a)                ; returns NIL - character
  11195.     (streamp '(a b c))            ; returns NIL - list
  11196.     (streamp 1)                ; returns NIL - integer
  11197.     (streamp 1.2)                ; returns NIL - float
  11198.     (streamp '*debug-io*)            ; returns NIL - symbol
  11199.     (streamp 'a)                ; returns NIL - symbol
  11200.     (streamp #(0 1 2))            ; returns NIL - array 
  11201.     (streamp NIL)                ; returns NIL - NIL
  11202.  
  11203.  
  11204. string
  11205. ________________________________________________________________________
  11206.  
  11207. type: function (subr) 
  11208. location: built-in
  11209. source file: xlstr.c
  11210. Common LISP compatible: yes
  11211. supported on: all machines
  11212.  
  11213. SYNTAX
  11214.  
  11215. (string <expr> )
  11216.     <expr>        -    a string, symbol or character expression
  11217.  
  11218. DESCRIPTION
  11219.  
  11220. The STRING function  forces the <expr> to be a string.  If the <expr> is
  11221. a  string,  it is  returned,  as is.  If the  <expr> is a  character,  a
  11222. one-character string is returned.  If the <expr> is a symbol, the symbol
  11223. is turned into a string.
  11224.  
  11225.  
  11226. EXAMPLES
  11227.  
  11228.     (string 'foo)                ; returns "FOO"
  11229.     (string 'x)                ; returns "X"
  11230.     (string "abcdef")            ; returns "abcdef"    
  11231.     (string #\a)                ; returns "a"
  11232.     (string #\A)                ; returns "A"
  11233.     (string #\Newline)            ; returns "\n"
  11234.  
  11235.  
  11236. string/=
  11237. ________________________________________________________________________
  11238.  
  11239. type: function (subr) 
  11240. location: built-in
  11241. source file: xlstr.c
  11242. Common LISP compatible: yes
  11243. supported on: all machines
  11244.  
  11245. SYNTAX
  11246.  
  11247. (string/= <string1> <string2> [ <key> <offset> ] ... )
  11248.     <string1>    -    a string expression
  11249.     <string2>    -    a string expression
  11250.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11251.     <offset>    -    an optional integer expression (for a keyword)
  11252.  
  11253. DESCRIPTION
  11254.  
  11255. The STRING/=  (string-NOT-EQUAL) function takes two string arguments.  A
  11256. non-NIL  value is  returned  if  <string1>  is not  equal to  <string2>,
  11257. otherwise  NIL is returned.  The non-NIL  value  returned is the integer
  11258. index  of  the  first   character  of  <string1>  which  is  CHAR/=  the
  11259. corresponding character of <string2>.  This test is case sensitive - the
  11260. character #\a is different (and of greater ASCII value) than #\A.
  11261.  
  11262. The keyword  arguments allow for accessing  substrings  within <string1>
  11263. and <string2>.  The keyword  arguments each require the keyword (:START1
  11264. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11265. keyword  first and the  integer  second.  The pairs may be in any order.
  11266. The start  keywords  specify the  starting  offset of the  substring.  A
  11267. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11268. keywords  specify the ending offset of the substring.  A value of 3 ends
  11269. the string after the 3rd character (an offset of 3 characters).
  11270.  
  11271. EXAMPLES
  11272.  
  11273.     (string/= "a" "b")            ; returns 0
  11274.     (string/= "a" "a")            ; returns NIL
  11275.     (string/= "a" "A")            ; returns 0
  11276.     (string/= "A" "a")            ; returns 0
  11277.     (string/= "abc" "abc ")            ; returns 3
  11278.  
  11279.     (string/= "J Smith" "K Smith"         ; strip off the first chars 
  11280.            :start1 1 :start2 1)        ; returns NIL
  11281.     (string/= "abc" "123456789"         ; leave just the first 3 chars 
  11282.            :end2 3 :end1 3)        ; returns 0
  11283.  
  11284. NOTE:
  11285. Be sure that the STRING/=  function is properly  typed in.  The '/' is a
  11286. forward  slash.  It is possible to  mistakenly  type a '\'  (backslash).
  11287. This is especially  easy because the  character  mechanism is '#\a'.  If
  11288. you do use the backslash, no error will be reported because backslash is
  11289. the single escape character and the LISP reader will evaluate 'STRING\='
  11290. as  'STRING='.  No error will be reported,  but the sense of the test is
  11291. reversed.
  11292.  
  11293.  
  11294. string<
  11295. ________________________________________________________________________
  11296.  
  11297. type: function (subr) 
  11298. location: built-in
  11299. source file: xlstr.c
  11300. Common LISP compatible: yes
  11301. supported on: all machines
  11302.  
  11303. SYNTAX
  11304.  
  11305. (string< <string1> <string2> [ <key> <offset> ] ... )
  11306.     <string1>    -    a string expression
  11307.     <string2>    -    a string expression
  11308.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11309.     <offset>    -    an optional integer expression (for a keyword)
  11310.  
  11311. DESCRIPTION
  11312.  
  11313. The STRING<  (string-LESS-THAN)  function takes two string arguments.  A
  11314. non-NIL  value is returned if  <string1>  is less than  <string2>  in an
  11315. ASCII  ordering,  otherwise NIL is returned.  The non-NIL value returned
  11316. is the integer index of the first  character of <string1> which is CHAR<
  11317. the corresponding character of <string2>.  This test is case sensitive -
  11318. the character #\a is different (and of greater ASCII value) than #\A.
  11319.  
  11320. The keyword  arguments allow for accessing  substrings  within <string1>
  11321. and <string2>.  The keyword  arguments each require the keyword (:START1
  11322. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11323. keyword  first and the  integer  second.  The pairs may be in any order.
  11324. The start  keywords  specify the  starting  offset of the  substring.  A
  11325. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11326. keywords  specify the ending offset of the substring.  A value of 3 ends
  11327. the string after the 3rd character (an offset of 3 characters).
  11328.  
  11329. EXAMPLES
  11330.  
  11331.     (string< "a" "b")            ; returns 0
  11332.     (string< "a" "a")            ; returns NIL
  11333.     (string< "a" "A")            ; returns NIL
  11334.     (string< "A" "a")            ; returns 0
  11335.     (string< "abc" "abc ")            ; returns 3
  11336.     (string< "1234567" "1234qrst")        ; returns 4
  11337.  
  11338.     (string< "J Smith" "K Smith"         ; strip off the first chars 
  11339.           :start1 1 :start2 1)        ; returns NIL
  11340.  
  11341.  
  11342. string<=
  11343. ________________________________________________________________________
  11344.  
  11345. type: function (subr) 
  11346. location: built-in
  11347. source file: xlstr.c
  11348. Common LISP compatible: yes
  11349. supported on: all machines
  11350.  
  11351. SYNTAX
  11352.  
  11353. (string<= <string1> <string2> [ <key> <offset> ] ... )
  11354.     <string1>    -    a string expression
  11355.     <string2>    -    a string expression
  11356.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11357.     <offset>    -    an optional integer expression (for a keyword)
  11358.  
  11359. DESCRIPTION
  11360.  
  11361. The  STRING<=  (string-LESS-THAN-OR-EQUAL)  function  takes  two  string
  11362. arguments.  A non-NIL  value is returned  if  <string1>  is less than or
  11363. equal to <string2> in an ASCII ordering, otherwise NIL is returned.  The
  11364. non-NIL  value  returned is the integer index of the first  character of
  11365. <string1>  which is CHAR<= the  corresponding  character  of  <string2>.
  11366. This test is case  sensitive - the  character  #\a is different  (and of
  11367. greater ASCII value) than #\A.
  11368.  
  11369. The keyword  arguments allow for accessing  substrings  within <string1>
  11370. and <string2>.  The keyword  arguments each require the keyword (:START1
  11371. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11372. keyword  first and the  integer  second.  The pairs may be in any order.
  11373. The start  keywords  specify the  starting  offset of the  substring.  A
  11374. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11375. keywords  specify the ending offset of the substring.  A value of 3 ends
  11376. the string after the 3rd character (an offset of 3 characters).
  11377.  
  11378. EXAMPLES
  11379.  
  11380.     (string<= "a" "b")            ; returns 0
  11381.     (string<= "a" "a")            ; returns 1
  11382.     (string<= "a" "A")            ; returns NIL
  11383.     (string<= "A" "a")            ; returns 0
  11384.     (string<= "abc" "abc ")            ; returns 3
  11385.     (string<= "1234567" "1234qrst")        ; returns 4
  11386.  
  11387.     (string<= "J Smith" "K Smith"         ; strip off the first chars 
  11388.           :start1 1 :start2 1)        ; returns 7
  11389.  
  11390.  
  11391. string=
  11392. ________________________________________________________________________
  11393.  
  11394. type: function (subr) 
  11395. location: built-in
  11396. source file: xlstr.c
  11397. Common LISP compatible: yes
  11398. supported on: all machines
  11399.  
  11400. SYNTAX
  11401.  
  11402. (string= <string1> <string2> [ <key> <offset> ] ... )
  11403.     <string1>    -    a string expression
  11404.     <string2>    -    a string expression
  11405.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11406.     <offset>    -    an optional integer expression (for a keyword)
  11407.  
  11408. DESCRIPTION
  11409.  
  11410. The STRING=  (string-EQUALITY)  function takes two string arguments.  It
  11411. checks  to see if the  string  arguments  have  the  same  values.  T is
  11412. returned  if  <string1>  is  equal  to  <string2>.  This  test  is  case
  11413. sensitive - the character #\a is different  (and of greater ASCII value)
  11414. than #\A.
  11415.  
  11416. The keyword  arguments allow for accessing  substrings  within <string1>
  11417. and <string2>.  The keyword  arguments each require the keyword (:START1
  11418. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11419. keyword  first and the  integer  second.  The pairs may be in any order.
  11420. The start  keywords  specify the  starting  offset of the  substring.  A
  11421. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11422. keywords  specify the ending offset of the substring.  A value of 3 ends
  11423. the string after the 3rd character (an offset of 3 characters).
  11424.  
  11425. EXAMPLES
  11426.  
  11427.     (string= "a" "b")            ; returns NIL
  11428.     (string= "a" "a")            ; returns T
  11429.     (string= "a" "A")            ; returns NIL
  11430.     (string= "A" "a")            ; returns NIL
  11431.     (string= "abc" "abc ")            ; returns NIL
  11432.  
  11433.     (string= "J Smith" "K Smith"         ; strip off the first chars 
  11434.            :start1 1 :start2 1)        ; returns T
  11435.     (string= "abc" "123456789"         ; leave just the first 3 chars 
  11436.            :end2 3 :end1 3)        ; returns NIL
  11437.  
  11438.  
  11439. string>
  11440. ________________________________________________________________________
  11441.  
  11442. type: function (subr) 
  11443. location: built-in
  11444. source file: xlstr.c
  11445. Common LISP compatible: yes
  11446. supported on: all machines
  11447.  
  11448. SYNTAX
  11449.  
  11450. (string> <string1> <string2> [ <key> <offset> ] ... )
  11451.     <string1>    -    a string expression
  11452.     <string2>    -    a string expression
  11453.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11454.     <offset>    -    an optional integer expression (for a keyword)
  11455.  
  11456. DESCRIPTION
  11457.  
  11458. The STRING>  (string-GREATER-THAN)  function takes two string arguments.
  11459. A non-NIL value is returned if <string1> is greater than <string2> in an
  11460. ASCII  ordering,  otherwise NIL is returned.  The non-NIL value returned
  11461. is the integer index of the first  character of <string1> which is CHAR>
  11462. the corresponding character of <string2>.  This test is case sensitive -
  11463. the character #\a is different (and of greater ASCII value) than #\A.
  11464.  
  11465. The keyword  arguments allow for accessing  substrings  within <string1>
  11466. and <string2>.  The keyword  arguments each require the keyword (:START1
  11467. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11468. keyword  first and the  integer  second.  The pairs may be in any order.
  11469. The start  keywords  specify the  starting  offset of the  substring.  A
  11470. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11471. keywords  specify the ending offset of the substring.  A value of 3 ends
  11472. the string after the 3rd character (an offset of 3 characters).
  11473.  
  11474. EXAMPLES
  11475.  
  11476.     (string> "a" "b")            ; returns NIL
  11477.     (string> "a" "a")            ; returns NIL
  11478.     (string> "a" "A")            ; returns 0
  11479.     (string> "A" "a")            ; returns NIL
  11480.     (string> "abc" "abc ")            ; returns NIL
  11481.     (string> "1234qrst" "12345678")        ; returns 4
  11482.  
  11483.     (string> "J Smith" "K Jones"         ; strip off the first chars 
  11484.           :start1 1 :start2 1)        ; returns 2
  11485.  
  11486.  
  11487. string>=
  11488. ________________________________________________________________________
  11489.  
  11490. type: function (subr) 
  11491. location: built-in
  11492. source file: xlstr.c
  11493. Common LISP compatible: yes
  11494. supported on: all machines
  11495.  
  11496. SYNTAX
  11497.  
  11498. (string>= <string1> <string2> [ <key> <offset> ] ... )
  11499.     <string1>    -    a string expression
  11500.     <string2>    -    a string expression
  11501.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11502.     <offset>    -    an optional integer expression (for a keyword)
  11503.  
  11504. DESCRIPTION
  11505.  
  11506. The STRING>=  (string-GREATER-THAN-OR-EQUAL)  function  takes two string
  11507. arguments.  A non-NIL  value is returned if <string1> is greater than or
  11508. equal to <string2> in an ASCII ordering, otherwise NIL is returned.  The
  11509. non-NIL  value  returned is the integer index of the first  character of
  11510. <string1>  which is CHAR>= the  corresponding  character  of  <string2>.
  11511. This test is case  sensitive - the  character  #\a is different  (and of
  11512. greater ASCII value) than #\A.
  11513.  
  11514. The keyword  arguments allow for accessing  substrings  within <string1>
  11515. and <string2>.  The keyword  arguments each require the keyword (:START1
  11516. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11517. keyword  first and the  integer  second.  The pairs may be in any order.
  11518. The start  keywords  specify the  starting  offset of the  substring.  A
  11519. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11520. keywords  specify the ending offset of the substring.  A value of 3 ends
  11521. the string after the 3rd character (an offset of 3 characters).
  11522.  
  11523. EXAMPLES
  11524.  
  11525.     (string>= "a" "b")            ; returns NIL
  11526.     (string>= "a" "a")            ; returns 1
  11527.     (string>= "a" "A")            ; returns 0
  11528.     (string>= "A" "a")            ; returns NIL
  11529.     (string>= "abc" "abc ")            ; returns NIL
  11530.     (string>= "1234qrst" "12345678")    ; returns 4
  11531.  
  11532.     (string>= "J Smith" "K Jones"         ; strip off the first chars 
  11533.           :start1 1 :start2 1)        ; returns 2
  11534.  
  11535.  
  11536. stringp
  11537. ________________________________________________________________________
  11538.  
  11539. type: predicate function (subr)
  11540. location: built-in
  11541. source file: xlbfun.c
  11542. Common LISP compatible: yes
  11543. supported on: all machines
  11544.  
  11545. SYNTAX
  11546.  
  11547. (stringp <expr> )
  11548.     <expr>        -    the expression to check
  11549.  
  11550. DESCRIPTION
  11551.  
  11552. The STRINGP predicate checks if an <expr> is a string.  T is returned if
  11553. <expr> is a string, NIL is returned otherwise.
  11554.  
  11555. EXAMPLES
  11556.  
  11557.     (stringp "a")                ; returns T - string
  11558.     (setq a "hi there"            ; 
  11559.     (stringp a)                ; returns T - evaluates to string
  11560.  
  11561.     (stringp #\a)                ; returns NIL - character
  11562.     (stringp '(a b c))            ; returns NIL - list
  11563.     (stringp 1)                ; returns NIL - integer
  11564.     (stringp 1.2)                ; returns NIL - float
  11565.     (stringp 'a)                ; returns NIL - symbol
  11566.     (stringp #(0 1 2))            ; returns NIL - array 
  11567.     (stringp NIL)                ; returns NIL - NIL
  11568.  
  11569.  
  11570. string-downcase
  11571. ________________________________________________________________________
  11572.  
  11573. type: function (subr) 
  11574. location: built-in
  11575. source file: xlstr.c
  11576. Common LISP compatible: yes
  11577. supported on: all machines
  11578.  
  11579. SYNTAX
  11580.  
  11581. (string-downcase <string> [ { :start | :end } <offset> ] ... )
  11582.     <string>    -    a string expression
  11583.     <offset>    -    an optional integer expression (for a keyword)
  11584.  
  11585. DESCRIPTION
  11586.  
  11587. The  STRING-DOWNCASE  function takes a string argument and returns a new
  11588. string that has been made lower case.
  11589.  
  11590. The keyword  arguments allow for accessing  substrings  within <string>.
  11591. The  keyword  arguments  require a keyword  (:START or :END) first and a
  11592. single  integer  expression  second.  The :START  keyword  specifies the
  11593. starting offset for the STRING-DOWNCASE  operation on <string>.  A value
  11594. of 0 starts the string at the  beginning  (no offset).  The :END keyword
  11595. specifies the end offset for the operation on <string>.
  11596.  
  11597. EXAMPLES
  11598.  
  11599.     (string-downcase "ABcd+-12&[")        ; returns "abcd+-&["
  11600.     (string-downcase "ABCDEFGH"         ;
  11601.              :start 2 :end 4)    ; returns "ABcdEFGH"
  11602.  
  11603.     (setq mystr "ABcdEFgh")            ; set up variable
  11604.     (string-downcase mystr)            ; returns "abcdefgh"
  11605.     (print mystr)                ; prints  "ABcdEFgh"
  11606.  
  11607.  
  11608. string-equal
  11609. ________________________________________________________________________
  11610.  
  11611. type: function (subr) 
  11612. location: built-in
  11613. source file: xlstr.c
  11614. Common LISP compatible: yes
  11615. supported on: all machines
  11616.  
  11617. SYNTAX
  11618.  
  11619. (string-equal <string1> <string2> [ <key> <offset> ] ... )
  11620.     <string1>    -    a string expression
  11621.     <string2>    -    a string expression
  11622.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11623.     <offset>    -    an optional integer expression (for a keyword)
  11624.  
  11625. DESCRIPTION
  11626.  
  11627. The STRING-EQUAL  function takes two string arguments.  It checks to see
  11628. if  the  string  arguments  have  the  same  values.  T is  returned  if
  11629. <string1> is equal to <string2>.  This test is not case  sensitive - the
  11630. character #\a is considered to be the same as #\A.
  11631.  
  11632. The keyword  arguments allow for accessing  substrings  within <string1>
  11633. and <string2>.  The keyword  arguments each require the keyword (:START1
  11634. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11635. keyword  first and the  integer  second.  The pairs may be in any order.
  11636. The start  keywords  specify the  starting  offset of the  substring.  A
  11637. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11638. keywords  specify the ending offset of the substring.  A value of 3 ends
  11639. the string after the 3rd character (an offset of 3 characters).
  11640.  
  11641. EXAMPLES
  11642.  
  11643.     (string-equal "a" "b")            ; returns NIL
  11644.     (string-equal "a" "a")            ; returns T
  11645.     (string-equal "a" "A")            ; returns T
  11646.     (string-equal "A" "a")            ; returns T
  11647.     (string-equal "abc" "abc ")        ; returns NIL
  11648.  
  11649.     (string-equal "J Smith" "K Smith"     ; strip off the first chars 
  11650.            :start1 1 :start2 1)        ; returns T
  11651.     (string-equal "abc" "123456789"     ; leave just the first 3 chars 
  11652.            :end2 3 :end1 3)        ; returns NIL
  11653.  
  11654. NOTE:
  11655. The STRING-EQUAL function is listed in the documentation that comes with
  11656. XLISP as  STRING-EQUALP.  It  functions  properly  in the XLISP  code as
  11657. STRING-EQUAL.
  11658.  
  11659.  
  11660. string-greaterp
  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-greaterp <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-GREATERP  function  takes two  string  arguments.  A non-NIL
  11680. value is returned if  <string1>  is greater than  <string2>  in an ASCII
  11681. ordering,  otherwise NIL is returned.  The non-NIL value returned is the
  11682. integer index of the first character of <string1> which is CHAR-GREATERP
  11683. the  corresponding  character  of  <string2>.  This  test  is  not  case
  11684. sensitive - 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-greaterp "a" "b")        ; returns NIL
  11698.     (string-greaterp "a" "a")        ; returns NIL
  11699.     (string-greaterp "a" "A")        ; returns NIL
  11700.     (string-greaterp "A" "a")        ; returns NIL
  11701.     (string-greaterp "abc" "abc ")        ; returns NIL
  11702.     (string-greaterp "1234qrst" "12345678")    ; returns 4
  11703.  
  11704.     (string-greaterp "J Smith" "K Jones"     ; strip off the first chars 
  11705.           :start1 1 :start2 1)        ; returns 2
  11706.  
  11707.  
  11708. string-left-trim
  11709. ________________________________________________________________________
  11710.  
  11711. type: function (subr) 
  11712. location: built-in
  11713. source file: xlstr.c
  11714. Common LISP compatible: similar
  11715. supported on: all machines
  11716.  
  11717. SYNTAX
  11718.  
  11719. (string-left-trim <trim-stuff> <string> )
  11720.     <trim-stuff>    -    a string expression
  11721.     <string>    -    a string expression
  11722.  
  11723. DESCRIPTION
  11724.  
  11725. The  STRING-LEFT-TRIM  function  takes the  <trim-stuff>  characters and
  11726. removes  them  from  the  left  end of the  <string>.  The  <trim-stuff>
  11727. characters  are an  un-ordered  set of characters to be removed - so any
  11728. character that occurs in  <trim-stuff>  is removed if it appears in left
  11729. portion of <string>.  A new string is created and returned as the result
  11730. of this function.
  11731.  
  11732. EXAMPLES
  11733.  
  11734.     (string-left-trim "." "....foo....")    ; returns "foo...."
  11735.     (string-left-trim "<>" "<<<<bar>>>>")    ; returns "bar>>>>"
  11736.     (string-left-trim "(.)" "..(12.34)..")    ; returns "12.34).."
  11737.  
  11738. COMMON LISP COMPATABILITY:
  11739. Common LISP also  supports a list of characters as a valid  <trim-stuff>
  11740. argument.  An  example  of  this  is:  (STRING-TRIM  '(#\Tab  #\Newline)
  11741. mystring).  XLISP does not support this  non-string  parameter.  Porting
  11742. from XLISP will be no problem,  but  modifications  will be necessary if
  11743. porting from Common LISP code which uses a list of characters.
  11744.  
  11745.  
  11746. string-lessp
  11747. ________________________________________________________________________
  11748.  
  11749. type: predicate function (subr) 
  11750. location: built-in
  11751. source file: xlstr.c
  11752. Common LISP compatible: yes
  11753. supported on: all machines
  11754.  
  11755. SYNTAX
  11756.  
  11757. (string-lessp <string1> <string2> [ <key> <offset> ] ... )
  11758.     <string1>    -    a string expression
  11759.     <string2>    -    a string expression
  11760.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11761.     <offset>    -    an optional integer expression (for a keyword)
  11762.  
  11763. DESCRIPTION
  11764.  
  11765. The STRING-LESSP  function takes two string  arguments.  A non-NIL value
  11766. is returned if  <string1> is less than  <string2> in an ASCII  ordering,
  11767. otherwise  NIL is returned.  The non-NIL  value  returned is the integer
  11768. index of the  first  character  of  <string1>  which is  CHAR-LESSP  the
  11769. corresponding character of <string2>.  This test is not case sensitive -
  11770. the character #\a is considered to be the same as #\A.
  11771.  
  11772. The keyword  arguments allow for accessing  substrings  within <string1>
  11773. and <string2>.  The keyword  arguments each require the keyword (:START1
  11774. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11775. keyword  first and the  integer  second.  The pairs may be in any order.
  11776. The start  keywords  specify the  starting  offset of the  substring.  A
  11777. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11778. keywords  specify the ending offset of the substring.  A value of 3 ends
  11779. the string after the 3rd character (an offset of 3 characters).
  11780.  
  11781. EXAMPLES
  11782.  
  11783.     (string-lessp "a" "b")            ; returns 0
  11784.     (string-lessp "a" "a")            ; returns NIL
  11785.     (string-lessp "a" "A")            ; returns NIL
  11786.     (string-lessp "A" "a")            ; returns NIL
  11787.     (string-lessp "abc" "abc ")        ; returns 3
  11788.     (string-lessp "1234567" "1234qrst")    ; returns 4
  11789.  
  11790.     (string-lessp "J Smith" "K Smith"     ; strip off the first chars 
  11791.           :start1 1 :start2 1)        ; returns NIL
  11792.  
  11793.  
  11794. string-not-equal
  11795. ________________________________________________________________________
  11796.  
  11797. type: function (subr) 
  11798. location: built-in
  11799. source file: xlstr.c
  11800. Common LISP compatible: yes
  11801. supported on: all machines
  11802.  
  11803. SYNTAX
  11804.  
  11805. (string-not-equal <string1> <string2> [ <key> <offset> ] ... )
  11806.     <string1>    -    a string expression
  11807.     <string2>    -    a string expression
  11808.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11809.     <offset>    -    an optional integer expression (for a keyword)
  11810.  
  11811. DESCRIPTION
  11812.  
  11813. The  STRING-NOT-EQUAL  function  takes two string  arguments.  A non-NIL
  11814. value is returned if <string1> is not equal to <string2>,  otherwise NIL
  11815. is  returned.  The non-NIL  value  returned is the integer  index of the
  11816. first character of <string1> which is CHAR-NOT-EQUAL  the  corresponding
  11817. character of <string2>.  This test is not case sensitive - the character
  11818. #\a is considered to be the same as #\A.
  11819.  
  11820. The keyword  arguments allow for accessing  substrings  within <string1>
  11821. and <string2>.  The keyword  arguments each require the keyword (:START1
  11822. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11823. keyword  first and the  integer  second.  The pairs may be in any order.
  11824. The start  keywords  specify the  starting  offset of the  substring.  A
  11825. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11826. keywords  specify the ending offset of the substring.  A value of 3 ends
  11827. the string after the 3rd character (an offset of 3 characters).
  11828.  
  11829. EXAMPLES
  11830.  
  11831.     (string-not-equal "a" "b")        ; returns 0
  11832.     (string-not-equal "a" "a")        ; returns NIL
  11833.     (string-not-equal "a" "A")        ; returns NIL
  11834.     (string-not-equal "A" "a")        ; returns NIL
  11835.     (string-not-equal "abc" "abc ")        ; returns 3
  11836.  
  11837.     (string-not-equal "J Smith" "K Smith"     ; strip off the first chars 
  11838.            :start1 1 :start2 1)        ; returns NIL
  11839.     (string-not-equal "abc" "123456789"     ; leave just the first 3 chars 
  11840.            :end2 3 :end1 3)        ; returns 0
  11841.  
  11842. NOTE:
  11843. The STRING-NOT-EQUAL  function is listed in the documentation that comes
  11844. with XLISP as  STRING-NOT-EQUALP.  It  functions  properly  in the XLISP
  11845. code as STRING-NOT-EQUAL.
  11846.  
  11847.  
  11848. string-not-greaterp
  11849. ________________________________________________________________________
  11850.  
  11851. type: predicate function (subr) 
  11852. location: built-in
  11853. source file: xlstr.c
  11854. Common LISP compatible: yes
  11855. supported on: all machines
  11856.  
  11857. SYNTAX
  11858.  
  11859. (string-not-greaterp <string1> <string2> [ <key> <offset> ] ... )
  11860.     <string1>    -    a string expression
  11861.     <string2>    -    a string expression
  11862.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11863.     <offset>    -    an optional integer expression (for a keyword)
  11864.  
  11865. DESCRIPTION
  11866.  
  11867. The STRING-NOT-GREATERP  function takes two string arguments.  A non-NIL
  11868. value is returned if <string1> is less than or equal to <string2>  in an
  11869. ASCII  ordering,  otherwise NIL is returned.  The non-NIL value returned
  11870. is the  integer  index of the  first  character  of  <string1>  which is
  11871. CHAR-NOT-GREATERP  the corresponding  character of <string2>.  This test
  11872. is not case  sensitive - the  character #\a is considered to be the same
  11873. as #\A.
  11874.  
  11875. The keyword  arguments allow for accessing  substrings  within <string1>
  11876. and <string2>.  The keyword  arguments each require the keyword (:START1
  11877. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11878. keyword  first and the  integer  second.  The pairs may be in any order.
  11879. The start  keywords  specify the  starting  offset of the  substring.  A
  11880. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11881. keywords  specify the ending offset of the substring.  A value of 3 ends
  11882. the string after the 3rd character (an offset of 3 characters).
  11883.  
  11884. EXAMPLES
  11885.  
  11886.     (string-not-greaterp "a" "b")        ; returns 0
  11887.     (string-not-greaterp "b" "a")        ; returns NIL
  11888.     (string-not-greaterp "a" "a")        ; returns 1
  11889.     (string-not-greaterp "a" "A")        ; returns 1
  11890.     (string-not-greaterp "A" "a")        ; returns 1
  11891.     (string-not-greaterp "abc" "abc ")    ; returns 3
  11892.     (string-not-greaterp "12345" "1234qr")    ; returns 4
  11893.  
  11894.     (string-not-greaterp "J Smith" "K Smith"; strip off the first chars 
  11895.           :start1 1 :start2 1)        ; returns 7
  11896.  
  11897.  
  11898. string-not-lessp
  11899. ________________________________________________________________________
  11900.  
  11901. type: predicate function (subr) 
  11902. location: built-in
  11903. source file: xlstr.c
  11904. Common LISP compatible: yes
  11905. supported on: all machines
  11906.  
  11907. SYNTAX
  11908.  
  11909. (string-not-lessp <string1> <string2> [ <key> <offset> ] ... )
  11910.     <string1>    -    a string expression
  11911.     <string2>    -    a string expression
  11912.     <key>        -    a keyword (one of :START1 :START2 :END1 :END2 )
  11913.     <offset>    -    an optional integer expression (for a keyword)
  11914.  
  11915. DESCRIPTION
  11916.  
  11917. The  STRING-NOT-LESSP  function  takes two string  arguments.  A non-NIL
  11918. value is returned if <string1> is greater than or equal to  <string2> in
  11919. an  ASCII  ordering,  otherwise  NIL  is  returned.  The  non-NIL  value
  11920. returned is the integer index of the first character of <string1>  which
  11921. is CHAR-NOT-LESSP  the corresponding  character of <string2>.  This test
  11922. is not case  sensitive - the  character #\a is considered to be the same
  11923. as #\A.
  11924.  
  11925. The keyword  arguments allow for accessing  substrings  within <string1>
  11926. and <string2>.  The keyword  arguments each require the keyword (:START1
  11927. :END1 :START2 :END2) and a single integer  expression as a pair with the
  11928. keyword  first and the  integer  second.  The pairs may be in any order.
  11929. The start  keywords  specify the  starting  offset of the  substring.  A
  11930. value of 0 starts  the  string at the  beginning  (no  offset).  The end
  11931. keywords  specify the ending offset of the substring.  A value of 3 ends
  11932. the string after the 3rd character (an offset of 3 characters).
  11933.  
  11934. EXAMPLES
  11935.  
  11936.     (string-not-lessp "a" "b")        ; returns NIL
  11937.     (string-not-lessp "a" "a")        ; returns 1
  11938.     (string-not-lessp "a" "A")        ; returns 1
  11939.     (string-not-lessp "A" "a")        ; returns 1
  11940.     (string-not-lessp "abc" "abc ")        ; returns NIL
  11941.     (string-not-lessp "1234qr" "123456")    ; returns 4
  11942.  
  11943.     (string-not-lessp "J Smith" "K Jones"     ; strip off the first chars 
  11944.           :start1 1 :start2 1)        ; returns 2
  11945.  
  11946.  
  11947. string-right-trim
  11948. ________________________________________________________________________
  11949.  
  11950. type: function (subr) 
  11951. location: built-in
  11952. source file: xlstr.c
  11953. Common LISP compatible: similar
  11954. supported on: all machines
  11955.  
  11956. SYNTAX
  11957.  
  11958. (string-right-trim <trim-stuff> <string> )
  11959.     <trim-stuff>    -    a string expression
  11960.     <string>    -    a string expression
  11961.  
  11962. DESCRIPTION
  11963.  
  11964. The  STRING-RIGHT-TRIM  function takes the  <trim-stuff>  characters and
  11965. removes  them  from the  right  end of the  <string>.  The  <trim-stuff>
  11966. characters  are an  un-ordered  set of characters to be removed - so any
  11967. character that occurs in  <trim-stuff> is removed if it appears in right
  11968. portion of <string>.  A new string is created and returned as the result
  11969. of this function.
  11970.  
  11971. EXAMPLES
  11972.  
  11973.     (string-right-trim "." "....foo....")    ; returns "....foo"
  11974.     (string-right-trim "<>" "<<<<bar>>>>")    ; returns "<<<<bar"
  11975.     (string-right-trim "(.)" "..(12.34)..")    ; returns "..(12.34"
  11976.  
  11977. COMMON LISP COMPATABILITY:
  11978. Common LISP also  supports a list of characters as a valid  <trim-stuff>
  11979. argument.  An  example  of  this  is:  (STRING-TRIM  '(#\Tab  #\Newline)
  11980. mystring).  XLISP does not support this  non-string  parameter.  Porting
  11981. from XLISP will be no problem,  but  modifications  will be necessary if
  11982. porting from Common LISP code which uses a list of characters.
  11983.  
  11984.  
  11985. string-trim
  11986. ________________________________________________________________________
  11987.  
  11988. type: function (subr) 
  11989. location: built-in
  11990. source file: xlstr.c
  11991. Common LISP compatible: similar
  11992. supported on: all machines
  11993.  
  11994. SYNTAX
  11995.  
  11996. (string-trim <trim-stuff> <string> )
  11997.     <trim-stuff>    -    a string expression
  11998.     <string>    -    a string expression
  11999.  
  12000. DESCRIPTION
  12001.  
  12002. The STRING-TRIM  function takes the <trim-stuff>  characters and removes
  12003. them from both ends of the <string>.  The <trim-stuff> characters are an
  12004. un-ordered  set of  characters  to be  removed - so any  character  that
  12005. occurs in  <trim-stuff>  is  removed if it appears  in  <string>.  A new
  12006. string is created and returned as the result of this function.
  12007.  
  12008. EXAMPLES
  12009.  
  12010.     (string-trim "." "....foo....")        ; returns "foo"
  12011.     (string-trim "<>" "<<<<bar>>>>")    ; returns "bar"
  12012.     (string-trim "(.)" "..(12.34)..")    ; returns "12.34"
  12013.  
  12014. COMMON LISP COMPATABILITY:
  12015. Common LISP also  supports a list of characters as a valid  <trim-stuff>
  12016. argument.  An  example  of  this  is:  (STRING-TRIM  '(#\Tab  #\Newline)
  12017. mystring).  XLISP does not support this  non-string  parameter.  Porting
  12018. from XLISP will be no problem,  but  modifications  will be necessary if
  12019. porting from Common LISP code which uses a list of characters.
  12020.  
  12021.  
  12022. string-upcase
  12023. ________________________________________________________________________
  12024.  
  12025. type: function (subr) 
  12026. location: built-in
  12027. source file: xlstr.c
  12028. Common LISP compatible: yes
  12029. supported on: all machines
  12030.  
  12031. SYNTAX
  12032.  
  12033. (string-upcase <string> [ { :start | :end } <offset> ] ... )
  12034.     <string>    -    a string expression
  12035.     <offset>    -    an optional integer expression (for a keyword)
  12036.  
  12037. DESCRIPTION
  12038.  
  12039. The  STRING-UPCASE  function  takes a string  argument and returns a new
  12040. string that has been made upper case.
  12041.  
  12042. The keyword  arguments allow for accessing  substrings  within <string>.
  12043. The  keyword  arguments  require a keyword  (:START or :END) first and a
  12044. single  integer  expression  second.  The :START  keyword  specifies the
  12045. starting offset for the STRING-UPCASE operation on <string>.  A value of
  12046. 0 starts  the string at the  beginning  (no  offset).  The :END  keyword
  12047. specifies the end offset for the operation on <string>.
  12048.  
  12049. EXAMPLES
  12050.  
  12051.     (string-upcase "ABcd+-12&[")        ; returns "ABCD+-&["
  12052.     (string-upcase "abcdefgh"         ;
  12053.              :start 2 :end 4)    ; returns "abCDefgh"
  12054.  
  12055.     (setq mystr "ABcdEFgh")            ; set up variable
  12056.     (string-upcase mystr)            ; returns "ABCDEFGH"
  12057.     (print mystr)                ; prints  "ABcdEFgh"
  12058.  
  12059.  
  12060. sublis
  12061. ________________________________________________________________________
  12062.  
  12063. type: function (subr) 
  12064. location: built-in
  12065. source file: xllist.c
  12066. Common LISP compatible: similar
  12067. supported on: all machines
  12068.  
  12069. SYNTAX
  12070.  
  12071. (sublis <a-list> <expr> [ { :test | :test-not } <test> ] )
  12072.     <expr>        -    the expression to substitute within - an atom 
  12073.                 or list
  12074.     <a-list>    -    the association list to search
  12075.     <test>        -    optional test function (default is EQL)
  12076.  
  12077. DESCRIPTION
  12078.  
  12079. SUBLIS  searches  through an <expr> and replaces each of the elements in
  12080. the <expr> that match the CAR of the  elements of the  association  list
  12081. <a-list>  with the CDR of elements of the <a-list>.  The <expr> with the
  12082. substitutions  (if any) is returned.  You may specify your own test with
  12083. the  :TEST and  :TEST-NOT  keywords  followed  by the test you  which to
  12084. perform.  The SUBLIS  function is normally  used with a dotted pair (A .
  12085. B) association  list.  It is possible to use a normal list pair (A B) or
  12086. a list of the form (A (B C)).
  12087.  
  12088. EXAMPLES
  12089.  
  12090.     (sublis '( (a . b))   '(a a))        ; returns (B B)
  12091.     (sublis '( (a b))     '(a a))        ; returns ((B) (B))
  12092.     (sublis '( (a (b c))) '(a a))        ; returns (((B C)) ((B C)))
  12093.  
  12094.     (setq newlist '( (a . 1)         ; set up an association list
  12095.              (b . 2)         ;
  12096.              (c . 3) ))        ;
  12097.     (sublis newlist '(a b c d e f b a c))    ; returns (1 2 3 D E F 2 1 3)
  12098.     (sublis newlist 'a)            ; returns 1
  12099.  
  12100.     (setq mylist '((a my-a) (b his-b)     ; set up a non-dotted pair
  12101.                (c her-c) (d end)))    ;   assoc list
  12102.     (sublis mylist '(a b c d e f g))    ; returns ((MY-A) (HIS-B) 
  12103.                         ;          (HER-C) (END) E F G)
  12104.     (sublis mylist 'a)            ; returns (MY-A)
  12105.  
  12106.     (setq numlist '((1 . a) (2 . b)) )    ; set up a new assoc list
  12107.     (defun mytest (x y) (princ ": ")     ; set up my own test function
  12108.                 (princ x)         ;   with 2 parameters
  12109.                 (princ " ")     ;   to see what SUBLIS does
  12110.                 (princ y) (terpri)    ;
  12111.                 T)            ;   always return TRUE
  12112.     (sublis numlist '(3 1) :test mytest)    ; prints     : (3 1) 1
  12113.                         ;   returns A
  12114.                         ;   because the entire list
  12115.                         ;   succeeds with the test
  12116.                         ;   and so (1 . A) produces
  12117.                         ;   the returned value
  12118.     (sublis numlist '(1) :test-not mytest)    ; prints     : (1) 1
  12119.                         ;        : (1) 2
  12120.                         ;        : 1 1
  12121.                         ;        : 1 2
  12122.                         ;        : NIL 1
  12123.                         ;        : NIL 2
  12124.                         ;   returns (1)
  12125.                         ;   because SUBLIS tried to
  12126.                         ;   match every list/sublist
  12127.                         ;   against each entry in the
  12128.                         ;   assoc. list and failed
  12129.                         ;   because of the :TEST-NOT
  12130.                         ;   and so returned the 
  12131.                         ;   original list unaltered
  12132.  
  12133. NOTE:
  12134. The  SUBLIS  function  can work  with a list or  string  as the  <expr>.
  12135. However, the default EQL test does not work with lists or strings,  only
  12136. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  12137. keyword along with EQUAL for <test>.
  12138.  
  12139. COMMON LISP COMPATABILITY:
  12140. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  12141. function  that is  applied  to each  element  of  <a-list>  before it is
  12142. tested.  XLISP does not support this.
  12143.  
  12144.  
  12145. subseq
  12146. ________________________________________________________________________
  12147.  
  12148. type: function (subr) 
  12149. location: built-in
  12150. source file: xlstr.c
  12151. Common LISP compatible: similar
  12152. supported on: all machines
  12153.  
  12154. SYNTAX
  12155.  
  12156. (subseq <string> <start> [ <end> ] )
  12157.     <string>    -    a string expression
  12158.     <start>        -    an integer expression
  12159.     <end>        -    an integer expression
  12160.  
  12161. DESCRIPTION
  12162.  
  12163. The SUBSEQ function extracts a substring from <string> starting with the
  12164. <start> offset and ending with the <end> offset.  The <start> offset has
  12165. a origin or 0.  The substring is returned.
  12166.  
  12167. EXAMPLES
  12168.  
  12169.     (subseq "12345678" 0)            ; returns "12345678"
  12170.     (subseq "12345678" 2)            ; returns "345678"
  12171.     (subseq "12345678" 2 4)            ; returns "34"
  12172.     (subseq "1234" 3)            ; returns "4"
  12173.  
  12174.     (subseq "1234" 4)            ; returns ""
  12175.     (subseq "1234" 4 2)            ; returns ""
  12176.     (subseq "1234" 5)            ; error: string index out of 
  12177.                         ;      bounds - 5
  12178.  
  12179. COMMON LISP COMPATABILITY:
  12180. The SUBSEQ in Common LISP is intended  to return a portion of a sequence
  12181. -  a   SUBSEQuence.  This   function   operates  on  lists  and  vectors
  12182. (one-dimensional  arrays of data) - basically ordered data.  Strings are
  12183. just one of the valid types  operated on by SUBSEQ in Common  LISP.  The
  12184. XLISP SUBSEQ function only operates on strings.
  12185.  
  12186.  
  12187. subst
  12188. ________________________________________________________________________
  12189.  
  12190. type: function (subr) 
  12191. location: built-in
  12192. source file: xllist.c
  12193. Common LISP compatible: similar
  12194. supported on: all machines
  12195.  
  12196. SYNTAX
  12197.  
  12198. (subst <new-expr> <old-expr> <expr> [ { :test | :test-not } <test> ] )
  12199.     <old-expr>    -    the expression to search for 
  12200.     <new-expr>    -    the expression to replace <old-expr> with
  12201.     <expr>        -    the expression to substitute within - atom/list
  12202.     <test>        -    optional test function (default is EQL)
  12203.  
  12204. DESCRIPTION
  12205.  
  12206. SUBST  searches  through an <expr> and replaces  each of the  <old-expr>
  12207. elements  with the  <new-expr>.  The <expr> with the  substitutions  (if
  12208. any) is  returned.  You may  specify  your own test  with the  :TEST and
  12209. :TEST-NOT keywords followed by the test you which to perform.
  12210.  
  12211. EXAMPLES
  12212.  
  12213.     (subst 'new 'old '(old mid dif))    ; returns (NEW MID DIF)
  12214.     (subst '(a) 'old '(old mid dif))    ; returns ((A) MID DIF)
  12215.     (subst "a" 'old '(old mid dif))        ; returns ("a" MID DIF)
  12216.  
  12217.     (defun mytest (x y) (princ x)(princ " "); define a test function
  12218.                 (princ y)(terpri)    ;   that prints the arguments 
  12219.                 T )             ;   and always returns TRUE
  12220.     (subst 'a 'b '(a b c d) :test 'mytest)    ; prints (A B C D) B   returns A
  12221.     (subst 'a 'b '(a b) :test-not 'mytest)    ; prints (A B) B
  12222.                         ;     A B
  12223.                         ;     (B) B
  12224.                         ;     B B
  12225.                         ;     NIL B     returns (A B)
  12226.  
  12227. NOTE:
  12228. The  SUBST  function  can  work  with a list or  string  as the  <expr>.
  12229. However, the default EQL test does not work with lists or strings,  only
  12230. symbols  and  numbers.  To make  this  work,  you need to use the  :TEST
  12231. keyword along with EQUAL for <test>.
  12232.  
  12233. COMMON LISP COMPATABILITY:
  12234. Common  LISP  supports  the use of the :KEY  keyword  which  specifies a
  12235. function  that is applied to each element of <expr> before it is tested.
  12236. XLISP does not support this.
  12237.  
  12238.  
  12239. symbol-name
  12240. ________________________________________________________________________
  12241.  
  12242. type: function (subr) 
  12243. location: built-in
  12244. source file: xlbfun.c
  12245. Common LISP compatible: yes
  12246. supported on: all machines
  12247.  
  12248. SYNTAX
  12249.  
  12250. (symbol-name <symbol> )
  12251.     <symbol>    -    an expression that evaluates to a symbol name 
  12252.  
  12253. DESCRIPTION
  12254.  
  12255. The SYMBOL-NAME  function takes the <symbol>  expression and returns the
  12256. printable string of the <symbol>.  If the <symbol> had not existed, then
  12257. it will be created and INTERNed into the system symbol table *OBARRAY* -
  12258. but with it's value unbound and an empty property list.
  12259.  
  12260. EXAMPLES
  12261.  
  12262.     (symbol-name 'foo)            ; returns "FOO"
  12263.     (symbol-name 'gleep)            ; returns "GLEEP"
  12264.  
  12265.     (setq my-symbol 'flop)            ; define MY-SYMBOL
  12266.     (symbol-name my-symbol)            ; returns "FLOP"
  12267.  
  12268.  
  12269. symbol-plist
  12270. ________________________________________________________________________
  12271.  
  12272. type: function (subr) 
  12273. location: built-in
  12274. source file: xlbfun.c
  12275. Common LISP compatible: yes
  12276. supported on: all machines
  12277.  
  12278. SYNTAX
  12279.  
  12280. (symbol-plist <symbol> )
  12281.     <symbol>    -    the symbol name with a property list
  12282.  
  12283. DESCRIPTION
  12284.  
  12285. SYMBOL-PLIST  returns the actual  property  list from the <symbol>.  The
  12286. <symbol> must be an existing,  bound  variable,  but it does not need to
  12287. have anything in it's property list.
  12288.  
  12289. Property  lists are lists  attached to any user defined  variables.  The
  12290. lists are in the form of (name1  val1 name2 val2  ....).  Any  number of
  12291. properties may be attached to a single variable.
  12292.  
  12293. EXAMPLES
  12294.  
  12295.     (setq person 'bobby)            ; create a var with a value
  12296.     (putprop person 'boogie 'last-name)    ; add a LAST-NAME property
  12297.     (putprop person 'disc-jockey 'job)    ; add a JOB property
  12298.     (putprop person '(10 20 30) 'stats)    ; add a STATS list
  12299.     (symbol-plist person)            ; returns the property list:
  12300.                         ; (STATS (10 20 30)
  12301.                         ;  JOB DISC-JOCKEY
  12302.                         ;  LAST-NAME BOOGIE)
  12303.  
  12304.  
  12305. symbol-value
  12306. ________________________________________________________________________
  12307.  
  12308. type: function (subr) 
  12309. location: built-in
  12310. source file: xlbfun.c
  12311. Common LISP compatible: yes
  12312. supported on: all machines
  12313.  
  12314. SYNTAX
  12315.  
  12316. (symbol-value <symbol> )
  12317.     <symbol>    -    an expression that evaluates to a symbol name 
  12318.  
  12319. DESCRIPTION
  12320.  
  12321. The SYMBOL-VALUE  function takes the <symbol> expression and returns the
  12322. current value of the <symbol>.
  12323.  
  12324. If the <symbol>  had not existed,  then it will be created and  INTERNed
  12325. into the system symbol table *OBARRAY* - but with it's value unbound and
  12326. an  empty  property  list.  In this  case of a  previously  non-existant
  12327. <symbol>,  since it has no bound  value,  the  SYMBOL-VALUE  will  still
  12328. report an error due to an unbound variable.
  12329.  
  12330. EXAMPLES
  12331.  
  12332.     (setq myvar 55)                ; set MYVAR to value 55
  12333.     (symbol-value 'myvar)            ; returns 55
  12334.  
  12335.     (symbol-value 'floop)            ; error: unbound variable 
  12336.  
  12337.     (setq my-symbol 'a)            ; set MY-SYMBOL to A
  12338.     (setq a '(contents of symbol a))    ; set A to value -
  12339.                         ;   (CONTENTS OF SYMBOL A)
  12340.     (symbol-value my-symbol)        ; returns (CONTENTS OF SYMBOL A)
  12341.  
  12342.  
  12343. symbolp
  12344. ________________________________________________________________________
  12345.  
  12346. type: predicate function (subr)
  12347. location: built-in
  12348. source file: xllist.c
  12349. Common LISP compatible: yes
  12350. supported on: all machines
  12351.  
  12352. SYNTAX
  12353.  
  12354. (symbolp <expr> )
  12355.     <expr>        -    the expression to check
  12356.  
  12357. DESCRIPTION
  12358.  
  12359. The  SYMBOLP  predicate  checks  if an <expr>  is a valid  symbol.  T is
  12360. returned  if <expr> is a symbol, NIL is  returned  otherwise.  An <expr>
  12361. that evaluates to an integer, function (subr or otherwise), and so on is
  12362. not a symbol.  However, the quoted  (un-evaluated) name of these objects
  12363. (like 'MYARRAY) is a valid symbol.
  12364.  
  12365. EXAMPLES
  12366.  
  12367.     (symbolp (make-symbol "a"))        ; returns T - symbol
  12368.     (symbolp 'a)                ; returns T - symbol
  12369.  
  12370.     (symbolp #(1 2 3))            ; returns NIL - array
  12371.     (symbolp (lambda (x) (print x)))    ; returns NIL - closure 
  12372.     (symbolp *standard-output*)        ; returns NIL - stream
  12373.     (symbolp 1.2)                ; returns NIL - float
  12374.     (symbolp 2)                ; returns NIL - integer
  12375.     (symbolp object)            ; returns NIL - object
  12376.     (symbolp "hi")                ; returns NIL - string
  12377.  
  12378.     (symbolp #'car)                ; returns NIL - subr 
  12379.     (symbolp 'car)                ; returns T - it is a symbol now
  12380.     (symbolp '2)                ; returns NIL - not a symbol
  12381.  
  12382.  
  12383. system
  12384. ________________________________________________________________________
  12385.  
  12386. type: function (subr) 
  12387. location: system extenstion
  12388. source file: msstuff.c and osdefs.h and osptrs.h
  12389. Common LISP compatible: no
  12390. supported on: MS-DOS compatibles
  12391.  
  12392. SYNTAX
  12393.  
  12394. (system <command> )
  12395.     <command>    -    the OS command string to be executed
  12396.  
  12397. DESCRIPTION
  12398.  
  12399. The SYSTEM  function  will send the <command>  string to the  underlying
  12400. operating  system for execution.  After  execution of the <command>, the
  12401. SYSTEM function will return a T result if the <command> was  successful.
  12402. If the  <command>  was not  successful,  the numeric  error code will be
  12403. returned.  Any output from the  <command>  execution  will not be put in
  12404. the transcript file.
  12405.  
  12406. EXAMPLES
  12407.  
  12408.     (system "dir")                ; do a PC directory listing
  12409.     (system "mycmd")            ; execute a special command
  12410.  
  12411. NOTE:
  12412. This  function is an  extension of the XLISP  system.  It is provided in
  12413. the  MSSTUFF.C  source code file.  If your XLISP  system is built for an
  12414. IBM PC and  compatibles or generic  MS-DOS, this function will work.  If
  12415. your  system  is built on UNIX or some  other  operating  system,  it is
  12416. unlikely  that  these   functions   will  work  unless  you  extend  the
  12417. appropriate  STUFF.C file (which may be called something  different like
  12418. UNIXSTUFF.C).  The source that could be put in the  appropriate  STUFF.C
  12419. file for this extension to work on a UNIX style system is:
  12420.  
  12421.     /* xsystem - execute a system command */
  12422.     LVAL xsystem()
  12423.     {
  12424.         char *cmd="COMMAND";
  12425.         if (moreargs())
  12426.         cmd = (char *)getstring(xlgastring());
  12427.         xllastarg();
  12428.         return (system(cmd) == 0 ? true : cvfixnum((FIXTYPE)errno));
  12429.     }
  12430.  
  12431. The source that gets added to the OSDEFS.H file is:
  12432.  
  12433.     extern LVAL xsystem();
  12434.  
  12435. The source that gets added to the OSPTRS.H file is:
  12436.  
  12437.     {    "SYSTEM",    S,    xsystem    },
  12438.  
  12439.  
  12440. t
  12441. ________________________________________________________________________
  12442.  
  12443. type: system constant
  12444. location: built-in
  12445. source file: xlinit.c
  12446. Common LISP compatible: yes
  12447. supported on: all machines
  12448.  
  12449. SYNTAX
  12450.  
  12451. t
  12452.  
  12453. DESCRIPTION
  12454.  
  12455. The T constant is built into XLISP.  It represents True - as oppossed to
  12456. false (NIL).
  12457.  
  12458. EXAMPLES
  12459.     (setq myvar T)                ; set MYVAR to True
  12460.     (setq myvar 'T)                ; T and 'T both evaluate to T
  12461.     (if t (print "this will print")        ; if/then/else
  12462.           (print "this won't print"))
  12463.  
  12464. NOTE:
  12465. Be careful  with the T value.  It is  possible to do a SETQ on T and set
  12466. it to other values (like NIL).  Some operations will still return proper
  12467. T or NIL values, but the system will be in a bad state.
  12468.  
  12469.  
  12470. tagbody
  12471. ________________________________________________________________________
  12472.  
  12473. type: special form (fsubr)
  12474. location: built-in
  12475. source file: xlcont.c
  12476. Common LISP compatible: yes
  12477. supported on: all machines
  12478.  
  12479. SYNTAX
  12480.  
  12481. (tagbody  [ <expr> ... ]  )
  12482.     <expr>        -    expressions comprising the body of the block
  12483.                 which may contain GOs or tags for GO  
  12484.  
  12485. DESCRIPTION
  12486.  
  12487. The TAGBODY special form is basically a 'block'  construct that contains
  12488. a block of code  (expressions)  to evaluate.  After the execution of the
  12489. TAGBODY  <expr>'s,  NIL is  returned.  The TAGBODY  special  form allows
  12490. 'go-to' style branching within the 'block'  construct via the GO special
  12491. form.  To  allow  this,  each  <expr>  may  be  a  tag  or a  form.  The
  12492. tag-symbol  is the 'label' and must exist  somewhere  within the 'block'
  12493. that the GO occurs within.
  12494.  
  12495. EXAMPLES
  12496.  
  12497.     (tagbody                ; build the 'block'
  12498.        start (print "begin")        ; tag - start
  12499.           (GO end)            ; 
  12500.          (print "hello")        ; won't ever be reached
  12501.        end   (print "done"))        ; tag - END
  12502.                         ; prints  "begin" "done"
  12503.                         ;   returns NIL
  12504.  
  12505.  
  12506. tan
  12507. ________________________________________________________________________
  12508.  
  12509. type: function (subr) 
  12510. location: built-in
  12511. source file: xlmath.c
  12512. Common LISP compatible: similar
  12513. supported on: all machines
  12514.  
  12515. SYNTAX
  12516.  
  12517. (tan <expr> )
  12518.     <expr>        -    floating point number/expression
  12519.  
  12520. DESCRIPTION
  12521.  
  12522. The TAN  function  calculates  the tangent of the <expr> and returns the
  12523. result.  The <expr> is in radians.
  12524.  
  12525. EXAMPLES
  12526.  
  12527.     (tan 0.0)                ; returns 0
  12528.     (tan 1.0)                ; returns 1.55741
  12529.     (tan (/ 3.14159 2))            ; returns 753696
  12530.     (tan 2.0)                ; returns -2.18504
  12531.     (tan 3.0)                ; returns -0.142547
  12532.     (tan 3.14159)                ; returns -2.65359e-06
  12533.     (tan 4.5)                ; returns 4.63733
  12534.  
  12535.  
  12536. COMMON LISP COMPATABILITY:
  12537. Common LISP allows for integer numbers, which XLISP does not support for
  12538. TAN.
  12539.  
  12540.  
  12541. terpri
  12542. ________________________________________________________________________
  12543.  
  12544. type: function (subr) 
  12545. location: built-in
  12546. source file: xlfio.c  and  xlprin.c
  12547. Common LISP compatible: yes
  12548. supported on: all machines
  12549.  
  12550. SYNTAX
  12551.  
  12552. (terpri  [ <destination> ] )
  12553.     <destination>    -    an optional destination - must be a file pointer
  12554.                 or stream, the default is *standard-output*
  12555.  
  12556. DESCRIPTION
  12557.  
  12558. The TERPRI  function  prints a new-line to the specified  <destination>.
  12559. This will  terminate  the current print line for  <destination>.  NIL is
  12560. always returned as the result.  The  <destination> may be a file pointer
  12561. or a  stream.  If there is no  <destination>,  *STANDARD-OUTPUT*  is the
  12562. default.
  12563.  
  12564. EXAMPLES
  12565.  
  12566.     (terpri)                ; prints  <NL>
  12567.  
  12568.     (setq f (open "pr" :direction :output )); create a file
  12569.     (princ "hi" f)                ; returns "hi"
  12570.     (princ 727 f)                ; returns 727
  12571.     (princ "ho" f)                ; returns "ho"
  12572.     (terpri f)                ; returns NIL
  12573.     (close f)                ; file contains hi727ho\n
  12574.  
  12575. COMMON LISP COMPATABILITY:
  12576. Common LISP specifies that print operations with a <destination> of NIL,
  12577. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  12578. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  12579. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  12580. XLISP does not allow T as a valid argument for <destination>.
  12581.  
  12582.  
  12583. third
  12584. ________________________________________________________________________
  12585.  
  12586. type: function (subr) 
  12587. location: built-in
  12588. source file: xlinit.c
  12589. Common LISP compatible: yes
  12590. supported on: all machines
  12591.  
  12592. SYNTAX
  12593.  
  12594. (third <expr> )
  12595.     <expr>        -    a list or list expression
  12596.  
  12597. DESCRIPTION
  12598.  
  12599. THIRD  returns the third  element of a list or list  expression.  If the
  12600. list is NIL, NIL is returned.
  12601.  
  12602. EXAMPLES
  12603.     (third '(1 2 3 4))            ; returns 3
  12604.     (third NIL)                ; returns NIL
  12605.  
  12606.     (setq kids '(junie vickie cindy chris))    ; set up variable KIDS
  12607.     (first kids)                ; returns JUNIE
  12608.     (second kids)                ; returns VICKIE
  12609.     (third kids)                ; returns CINDY
  12610.     (fourth kids)                ; returns CHRIS
  12611.     (rest kids)                ; returns (VICKIE CINDY CHRIS)
  12612.  
  12613. NOTE:
  12614. This  function is set to the same  code as CADDR.  
  12615.  
  12616.  
  12617. throw
  12618. ________________________________________________________________________
  12619.  
  12620. type: special form (fsubr)
  12621. location: built-in
  12622. source file: xlcont.c and xljump.c
  12623. Common LISP compatible: yes
  12624. supported on: all machines
  12625.  
  12626. SYNTAX
  12627.  
  12628. (throw  <tag-symbol>  [ <expr> ]  )
  12629.     <tag-symbol>    -    an expression that evaluates to a symbol
  12630.     <expr>        -    an optional expression to be returned
  12631.  
  12632. DESCRIPTION
  12633.  
  12634. The CATCH and THROW  special  forms allow for non-local  exits and traps
  12635. without going through the intermediate evaluations and function returns.
  12636. The  <expr>  in THROW  specifies  what  value is to be  returned  by the
  12637. corresponding  CATCH.  If there is no <expr>, a NIL is  returned  to the
  12638. corresponding  CATCH.  If a THROW  is  evaluated  with no  corresponding
  12639. CATCH, an error is  generated  - "error:  no target for  THROW".  If, in
  12640. the  calling  process,  more  than  one  CATCH  is set up for  the  same
  12641. <tag-symbol>, the most recently  evaluated  <tag-symbol> will be the one
  12642. that does the actual catching.
  12643.  
  12644. EXAMPLES
  12645.  
  12646.     (catch 'mytag)                ; returns NIL    - no THROW
  12647.     (catch 'mytag (+ 1 (+ 2 3)))        ; returns 6     - no THROW
  12648.     (catch 'mytag (+ 1 (throw 'mytag)))    ; returns NIL    - caught it
  12649.     (catch 'mytag (+ 1 (throw 'mytag 55)))    ; returns 55    - caught it
  12650.     (catch 'mytag (throw 'foo))        ; error: no target for THROW
  12651.  
  12652.     (defun in (x)                 ; define IN
  12653.        (if (numberp x) (+ x x)        ;   if number THEN double
  12654.                    (throw 'math 42)))    ;             ELSE throw 42
  12655.     (defun out (x)                ; define OUT
  12656.       (princ "<") (princ  (* (in x) 2))    ;   double via multiply
  12657.       (princ ">"))                ;
  12658.     (defun main (x)                ; define MAIN
  12659.       (catch 'math (out x)))        ;   with CATCH
  12660.     (in 5)                    ; returns 10
  12661.     (out 5)                    ; prints  <20>   returns ">"
  12662.     (main 5)                ; prints  <20>   returns ">"
  12663.     (main 'a)                ; prints  <     returns 42
  12664.  
  12665. NOTE:
  12666. Although  CATCH  and  THROW  will  accept a  <tag-symbol>  that is not a
  12667. symbol, it will not find this  improper  <tag-symbol>.  An error will be
  12668. generated - "error:  no target for THROW".
  12669.  
  12670.  
  12671. :tmacro
  12672. ________________________________________________________________________
  12673.  
  12674. type: keyword
  12675. location: built-in
  12676. source file: xlread.c
  12677. Common LISP compatible: no
  12678. supported on: all machines
  12679.  
  12680. SYNTAX
  12681.  
  12682. (:tmacro . <function> )
  12683.     <function>    -    a function
  12684.  
  12685. DESCRIPTION
  12686.  
  12687. :TMACRO is an entry that is used in the  *READTABLE*.  *READTABLE*  is a
  12688. system  variable that contains  XLISP's data structures  relating to the
  12689. processing  of  characters  from  the  user (or  files)  and  read-macro
  12690. expansions.  The  existance  of  the  :TMACRO  keyword  means  that  the
  12691. specified  character is a terminal read macro.  For :TMACRO, the form of
  12692. the  *READTABLE*  entry is a dotted pair like (:TMACRO .  <function>  ).
  12693. The <function> can be a built-in  read-macro  function or a user defined
  12694. lambda expression.  The <function> takes two parameters, an input stream
  12695. specification,   and  an  integer  that  is  the  character  value.  The
  12696. <function>  should  return NIL if the  character is  'white-space'  or a
  12697. value CONSed with NIL to return the value.  The <function> will probably
  12698. read additional characters from the input stream.
  12699.  
  12700. EXAMPLES
  12701.  
  12702.     (defun look-at (table)            ; define a function to 
  12703.      (dotimes (ch 127)            ;   look in a table
  12704.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  12705.             (if (and (consp entry)        ;   :TMACRO entries
  12706.                      (equal (car entry)     ;
  12707.                     ':TMACRO))    ;
  12708.               (princ (int-char ch)))))    ;
  12709.      (terpri))                ;
  12710.                          ;
  12711.     (look-at *readtable*)            ;  prints "'(),;`
  12712.  
  12713. NOTE:
  12714. The system defines that the following are :TMACRO characters:
  12715.  
  12716.     \ " ` , ( ) ;
  12717.  
  12718. CAUTION:
  12719. If you experiment  with  *READTABLE*, it is useful to save the old value
  12720. in a variable, so that you can restore the system state.
  12721.  
  12722.  
  12723. top-level
  12724. ________________________________________________________________________
  12725.  
  12726. type: function (subr) 
  12727. location: built-in
  12728. source file: xlbfun.c  and  xldbug.c
  12729. Common LISP compatible: no
  12730. supported on: all machines
  12731.  
  12732. SYNTAX
  12733.  
  12734. (top-level)
  12735.  
  12736.  
  12737. DESCRIPTION
  12738.  
  12739. The  TOP-LEVEL  function  aborts to the top level of XLISP.  This may be
  12740. from within several levels of the break loop.  This is valid for BREAKs,
  12741. ERRORs and CERRORs  (continuable  errors).  If  TOP-LEVEL  is  evaluated
  12742. while not in a break  loop, a  message  is  printed - "[ back to the top
  12743. level ]".  This  message  does not cause  XLISP to go into a break loop.
  12744. TOP-LEVEL never actually returns a value.
  12745.  
  12746. EXAMPLES
  12747.  
  12748.     (top-level)                ; [ back to the top level ]
  12749.  
  12750.     (break "out")                ; break: out        (1st)
  12751.     (break "twice")                ; break: twice        (2nd)
  12752.     (top-level)                ; to exit out of break loop 
  12753.  
  12754. KEYSTROKE EQUIVALENT:
  12755. In the IBM PC and MS-DOS  versions of XLISP, a CTRL-c key  sequence  has
  12756. the same  effect as doing a  (TOP-LEVEL).  On a  Macintosh,  this can be
  12757. accomplished by a pull-down menu or a COMMAND-t.
  12758.  
  12759.  
  12760. trace
  12761. ________________________________________________________________________
  12762.  
  12763. type: special form (fsubr)
  12764. location: built-in
  12765. source file: xlcont.c
  12766. Common LISP compatible: similar
  12767. supported on: all machines
  12768.  
  12769. SYNTAX
  12770.  
  12771. (trace  <function> ... )
  12772.     <function>    -    an unquoted function
  12773.  
  12774. DESCRIPTION
  12775.  
  12776. The TRACE  special form allows the tracing of user or system  functions.
  12777. TRACE returns a list  containing  the current set of functions  that are
  12778. being traced.  The <function> does not have to be currently  defined, it
  12779. can be created as part of the  execution.  The trace output  consists of
  12780. entry and exit  information.  At entry and exit of a traced  <function>,
  12781. lines will be printed of the form:
  12782.  
  12783.     Entering: <function>, Argument list: <arg-list>  
  12784.         .
  12785.         .
  12786.         .
  12787.     Exiting: <function>, Value: <ret-value>
  12788.  
  12789. EXAMPLES
  12790.  
  12791.     (defun foo (x) (print (car x)))        ; define FOO
  12792.     (trace 'foo)                ; returns (FOO)
  12793.     (trace 'car)                ; returns (CAR FOO)
  12794.     (foo '(a))                ; Entering: FOO, Argument list: ((A))
  12795.                         ;  Entering: CAR, Argument list: ((A))
  12796.                         ;  Exiting: CAR, Value: A
  12797.                         ; A
  12798.                         ; Exiting: FOO, Value: A
  12799.                         ; returns A
  12800.  
  12801. COMMON LISP COMPATABILITY:
  12802. The XLISP TRACE  function  does not support any keyword  options,  which
  12803. Common LISP allows.
  12804.  
  12805.  
  12806. *tracelimit*
  12807. ________________________________________________________________________
  12808.  
  12809. type: system variable
  12810. location: built-in
  12811. source file: xlinit.c  and  xldbug.c
  12812. Common LISP compatible: no
  12813. supported on: all machines
  12814.  
  12815. SYNTAX
  12816.  
  12817. *tracelimit*
  12818.  
  12819.  
  12820. DESCRIPTION
  12821.  
  12822. *TRACELIMIT*  is a system  variable  that  controls  the number of forms
  12823. printed on entry to the break loop.  If *TRACELIMIT* is an integer, then
  12824. the  integer is the  maximum  number of forms that will be  printed.  If
  12825. *TRACELIMIT*  is NIL or a  non-integer,  then all of the  forms  will be
  12826. printed.  Note that  *TRACENABLE*  needs to be set to a non-NIL value to
  12827. enable the  printing  of  back-trace  information  on entry to the break
  12828. loop.
  12829.  
  12830. EXAMPLES
  12831.  
  12832.     (defun foo (x) (fee x))            ; define FOO
  12833.     (defun fee (y) (break))            ; define FEE
  12834.     (setq *tracenable* T)            ; enable the back trace
  12835.     (setq *tracelimit* NIL)            ; show all the entries
  12836.     (foo 5)                    ; break: **BREAK**
  12837.                         ; prints  Function:.....BREAK..
  12838.                         ;      Function:.....FEE....
  12839.                         ;      Arguments:
  12840.                         ;        5
  12841.                         ;      Function:.....FOO....
  12842.                         ;       Arguments:
  12843.                         ;        5
  12844.     (clean-up)                ; from break loop
  12845.     (setq *tracelimit* 2)            ; show only 2 entries
  12846.     (foo 5)                    ; break: **BREAK**
  12847.                         ; prints  Function:.....BREAK..
  12848.                         ;      Function:.....FEE....
  12849.                         ;      Arguments:
  12850.                         ;        5
  12851.     (clean-up)                ; from break loop
  12852.  
  12853. NOTE:
  12854. *TRACENABLE* and *TRACELIMIT* have to do with back trace  information at
  12855. entry to a break loop and have nothing to do with TRACE and UNTRACE.
  12856.  
  12857.  
  12858. *tracelist*
  12859. ________________________________________________________________________
  12860.  
  12861. type: system variable
  12862. location: built-in
  12863. source file: xlinit.c  and  xleval.c
  12864. Common LISP compatible: no
  12865. supported on: all machines
  12866.  
  12867. SYNTAX
  12868.  
  12869. *tracelist*
  12870.  
  12871.  
  12872. DESCRIPTION
  12873.  
  12874. *TRACELIST*  is a system  variable  that  contains a list of the current
  12875. functions being traced.
  12876.  
  12877. EXAMPLES
  12878.  
  12879.     (defun foo (x) (print (car x)))        ; define FOO
  12880.     (trace foo)                ; returns (FOO)
  12881.     (trace car)                ; returns (CAR FOO)
  12882.     (print *tracelist*)            ; prints  (CAR FOO)
  12883.     (untrace foo)                ; returns (CAR)
  12884.     (untrace car)                ; returns NIL
  12885.     (print *tracelist*)            ; prints  NIL
  12886.  
  12887.  
  12888. *tracenable*
  12889. ________________________________________________________________________
  12890.  
  12891. type: system variable
  12892. location: built-in
  12893. source file: xlinit.c  and  xldbug.c
  12894. Common LISP compatible: no
  12895. supported on: all machines
  12896.  
  12897. SYNTAX
  12898.  
  12899. *tracenable*
  12900.  
  12901.  
  12902. DESCRIPTION
  12903.  
  12904. *TRACENABLE* is a system variable that controls whether or not the break
  12905. loop prints any back trace  information  on entry to the break loop.  If
  12906. *TRACENABLE* is NIL, then there will be no information  printed on entry
  12907. to the break loop.  If *TRACENABLE* is non-NIL, then information will be
  12908. printed.  The INIT.LSP  initialization  file sets  *TRACENABLE*  to NIL,
  12909. which suppresses the printing.
  12910.  
  12911. EXAMPLES
  12912.  
  12913.     (defun foo (x) (fee x))            ; define FOO
  12914.     (defun fee (y) (break))            ; define FEE
  12915.     (setq *tracenable* T)            ; enable the back trace
  12916.     (setq *tracelimit* NIL)            ; show all the entries
  12917.     (foo 5)                    ; break: **BREAK**
  12918.                         ; prints  Function:.....BREAK..
  12919.                         ;      Function:.....FEE....
  12920.                         ;      Arguments:
  12921.                         ;        5
  12922.                         ;      Function:.....FOO....
  12923.                         ;       Arguments:
  12924.                         ;        5
  12925.     (clean-up)                ; from break loop
  12926.     (setq *tracelimit* 2)            ; show only 2 entries
  12927.     (foo 5)                    ; break: **BREAK**
  12928.                         ; prints  Function:.....BREAK..
  12929.                         ;      Function:.....FEE....
  12930.                         ;      Arguments:
  12931.                         ;        5
  12932.     (clean-up)                ; from break loop
  12933.  
  12934. NOTE:
  12935. *TRACENABLE* and *TRACELIMIT* have to do with back trace  information at
  12936. entry to a break loop and have nothing to do with TRACE and UNTRACE.
  12937.  
  12938.  
  12939. *trace-output*
  12940. ________________________________________________________________________
  12941.  
  12942. type: system variable 
  12943. location: built-in
  12944. source file: xlinit.c  xlio.c
  12945. Common LISP compatible: yes
  12946. supported on: all machines
  12947.  
  12948. SYNTAX
  12949.  
  12950. *trace-output*
  12951.  
  12952.  
  12953. DESCRIPTION
  12954.  
  12955. *TRACE-OUTPUT*  is a system  variable  that contains a file pointer that
  12956. points to the file where all trace output goes to.  The default file for
  12957. *TRACE-OUTPUT*  is the  system  standard  error  device -  normally  the
  12958. screen.
  12959.  
  12960. EXAMPLES
  12961.     *trace-output*                ; returns #<File-Stream: #243de>
  12962.  
  12963. NOTE:
  12964. *TRACE-OUTPUT*, *DEBUG-IO* and *ERROR-OUTPUT* are normally all set to the 
  12965. same file stream - STDERR.
  12966.  
  12967.  
  12968. truncate
  12969. ________________________________________________________________________
  12970.  
  12971. type: function (subr) 
  12972. location: built-in
  12973. source file: xlmath.c
  12974. Common LISP compatible: similar
  12975. supported on: all machines
  12976.  
  12977. SYNTAX
  12978.  
  12979. (truncate <expr> )
  12980.     <expr>        -    integer or floating point number/expression
  12981.  
  12982. DESCRIPTION
  12983.  
  12984. The TRUNCATE  function  takes the <expr> and  truncates it to an integer
  12985. value and returns this result.
  12986.  
  12987. EXAMPLES
  12988.  
  12989.     (truncate 123.456)            ; returns 123
  12990.     (truncate -1.49)            ; returns -1
  12991.     (truncate -1.59)            ; returns -1
  12992.     (truncate 123)                ; returns 123
  12993.     (truncate 123.999)            ; returns 123
  12994.  
  12995. COMMON LISP COMPATABILITY:
  12996. Common LISP allows an optional division  parameter, which XLISP does not
  12997. support.
  12998.  
  12999.  
  13000. type-of
  13001. ________________________________________________________________________
  13002.  
  13003. type: function (subr)
  13004. location: built-in
  13005. source file: xlsys.c
  13006. Common LISP compatible: similar
  13007. supported on: all machines
  13008.  
  13009. SYNTAX
  13010.  
  13011. (type-of <expr> )
  13012.     <expr>        -    an expression to check
  13013.  
  13014. DESCRIPTION
  13015.  
  13016. The TYPE-OF function returns the type of the expression.
  13017.  
  13018. EXAMPLES
  13019.  
  13020.     (type-of NIL)                ; returns NIL        
  13021.     (type-of '#(1 2 3))            ; returns ARRAY    
  13022.     (type-of (lambda (x) (print x)))    ; returns CLOSURE
  13023.     (type-of '(a b))            ; returns CONS        
  13024.     (type-of #'savefun)            ; returns CLOSURE
  13025.     (type-of '(a . b))            ; returns CONS        
  13026.     (type-of *standard-output*)        ; returns FILE-STREAM
  13027.     (type-of 1.2)                ; returns FLONUM    
  13028.     (type-of #'do)                ; returns FSUBR        
  13029.     (type-of 1)                ; returns FIXNUM    
  13030.     (type-of object)            ; returns OBJECT    
  13031.     (type-of "str")                ; returns STRING    
  13032.     (type-of #'car)                ; returns SUBR        
  13033.     (type-of 'a)                ; returns SYMBOL    
  13034.     (type-of #\a)                ; returns CHARACTER
  13035.     (type-of (make-string-input-stream "a")); returns UNNAMED-STREAM
  13036.  
  13037. COMMON LISP COMPATABILITY:
  13038. The XLISP and Common LISP  TYPE-OF  functions  are  basically  the same.
  13039. Differences between the two can occur in what the types are called (like
  13040. CHARACTER in XLISP and STANDARD-CHAR in Common LISP).  Also, Common LISP
  13041. can give additional  information - for strings, it returns a list of the
  13042. form (SIMPLE-STRING 32) where the number 32 is the string size.
  13043.  
  13044.  
  13045. *unbound*
  13046. ________________________________________________________________________
  13047.  
  13048. type: system constant
  13049. location: built-in
  13050. source file: xlinit.c  and  xlsym.c
  13051. Common LISP compatible: no
  13052. supported on: all machines
  13053.  
  13054. SYNTAX
  13055.  
  13056. *unbound*
  13057.  
  13058.  
  13059. DESCRIPTION
  13060.  
  13061. *UNBOUND* is a system  constant  that is used to indicate  when a symbol
  13062. has no value.  *UNBOUND* is set to the value *UNBOUND*.  This means that
  13063. the system thinks the symbol *UNBOUND* has no value.
  13064.  
  13065. EXAMPLES
  13066.     *unbound*                ; error: unbound variable
  13067.     (setq a 5)                ; returns 5
  13068.     a                    ; returns 5
  13069.     (setq a '*unbound*)            ; returns *UNBOUND*
  13070.     a                    ; error: unbound variable
  13071.  
  13072. unless
  13073. ________________________________________________________________________
  13074.  
  13075. type: special form (fsubr)
  13076. location: built-in
  13077. source file: xlcont.c
  13078. Common LISP compatible: yes
  13079. supported on: all machines
  13080.  
  13081. SYNTAX
  13082.  
  13083. (unless <test> [ <expr> ... ] )
  13084.     <test>        -    an expression - NIL or non-NIL
  13085.     <expr>        -    expressions comprising a body of code
  13086.  
  13087. DESCRIPTION
  13088.  
  13089. The UNLESS macro executes the <expr> forms if <test>  evaluates to a NIL
  13090. value.  If <test> is NIL, the value of the last  <expr> is  returned  as
  13091. the result.  If <test> is non-NIL,  NIL is returned  with none of <expr>
  13092. evaluated.
  13093.  
  13094. EXAMPLES
  13095.  
  13096.     (unless NIL)                ; returns NIL
  13097.     (unless T)                ; returns NIL
  13098.     (unless NIL (print "hi") 'foo)        ; prints  "hi"    returns FOO
  13099.     (unless (listp "a")             ;
  13100.           (print "not a list"))        ; prints  "not a list"
  13101.                         ; returns "not a list"
  13102.  
  13103.  
  13104. untrace
  13105. ________________________________________________________________________
  13106.  
  13107. type: special form (fsubr)
  13108. location: built-in
  13109. source file: xlcont.c
  13110. Common LISP compatible: similar
  13111. supported on: all machines
  13112.  
  13113. SYNTAX
  13114.  
  13115. (untrace  <function> ... )
  13116.     <function>    -    a function name 
  13117.  
  13118. DESCRIPTION
  13119.  
  13120. The UNTRACE  special form removes  <function>  from the current  list of
  13121. traced  functions.  UNTRACE returns a list containing the current set of
  13122. functions that are being traced.  If the <function> does currently exist
  13123. or is  currently be traced,  there will be no error  reported.  If there
  13124. are no functions being traced, a NIL is returned.
  13125.  
  13126. EXAMPLES
  13127.  
  13128.     (defun foo (x) (print (car x)))        ; define FOO
  13129.     (trace 'foo)                ; returns (FOO)
  13130.     (foo '(a))                ; Entering: FOO, Argument list: ((A))
  13131.                         ; A
  13132.                         ; Exiting: FOO, Value: A
  13133.                         ; returns A
  13134.     (untrace 'foo)                ; returns NIL
  13135.     (untrace 'glip)                ; returns NIL
  13136.     (foo '(a))                ; prints  A   and returns  A
  13137.  
  13138. COMMON LISP COMPATABILITY:
  13139. The XLISP UNTRACE  function  does not support any options,  which Common
  13140. LISP allows.
  13141.  
  13142.  
  13143. upper-case-p
  13144. ________________________________________________________________________
  13145.  
  13146. type: predicate function (subr) 
  13147. location: built-in
  13148. source file: xlstr.c 
  13149. Common LISP compatible: yes
  13150. versions: all machines
  13151.  
  13152. SYNTAX
  13153.  
  13154. (upper-case-p <char> )
  13155.     <char>        -    a character expression
  13156.  
  13157. DESCRIPTION
  13158.  
  13159. The UPPER-CASE-P  predicate checks if the <char>  expression is an upper
  13160. case  character.  If <char> is upper case a T is  returned,  otherwise a
  13161. NIL is returned.  Upper case characters are 'A' (ASCII decimal value 65)
  13162. through 'Z' (ASCII decimal value 90).
  13163.  
  13164. EXAMPLES
  13165.  
  13166.     (upper-case-p #\A)            ; returns T
  13167.     (upper-case-p #\a)            ; returns NIL
  13168.     (upper-case-p #\1)            ; returns NIL
  13169.     (upper-case-p #\[)            ; returns NIL
  13170.  
  13171.  
  13172. unwind-protect
  13173. ________________________________________________________________________
  13174.  
  13175. type: special form (fsubr)
  13176. location: built-in
  13177. source file: xlcont.c
  13178. Common LISP compatible: yes
  13179. supported on: all machines
  13180.  
  13181. SYNTAX
  13182.  
  13183. (unwind-protect <protect-form> <clean-up-form> ... )
  13184.     <protect-form>    -    a form that is to be protected
  13185.     <clean-up-form>    -    a sequence forms to execute after <protect-form>
  13186.  
  13187. DESCRIPTION
  13188.  
  13189. The UNWIND-PROTECT  special form allows the protecting (trapping) of all
  13190. forms of exit  from the  <protect-form>.  The  exits  that  are  trapped
  13191. include  errors,  THROW,  RETURN  and GO.  The  <clean-up-form>  will be
  13192. executed  in all cases - when there is an exit from  <protect-form>  and
  13193. when the form does not have exit.  UNWIND-PROTECT will return the result
  13194. from the <protect-form>, not from the <clean-up-form>s.  Errors or exits
  13195. that occur in the  <clean-up-form> are not protected.  It is possible to
  13196. trap these with another UNWIND-PROTECT.
  13197.  
  13198. EXAMPLES
  13199.  
  13200.     (unwind-protect             ;
  13201.         (+ 2 2)             ; protected form
  13202.         (print "an exit"))        ; clean up form
  13203.                         ; prints "an exit"
  13204.                         ; returns 4
  13205.  
  13206.     (nodebug)                ; to turn off break loop traps
  13207.     (unwind-protect             ;
  13208.         (+ 1 "2")            ; protected form
  13209.         (print "something happened"))    ; clean up form
  13210.                         ; error: bad argument type - "2"
  13211.                         ; prints "something happened"
  13212.     
  13213.     (catch 'mytag                 ; 
  13214.       (unwind-protect             ; 
  13215.           (throw 'mytag)             ; protected form
  13216.         (print "an exit") ) )        ; clean up form
  13217.                         ; prints "an exit"
  13218.  
  13219.     (nodebug)                ; to turn off break loop traps
  13220.     (unwind-protect             ;
  13221.         (throw 'notag)             ; protected form
  13222.         (print "an exit"))        ; clean up form
  13223.                         ; error: no target for THROW
  13224.                         ; prints "an exit"
  13225.  
  13226.     (prog ()                 ; 
  13227.         (print "start")            ;
  13228.         (unwind-protect         ;
  13229.             (go end)         ; protected form
  13230.             (print "an exit"))    ; clean-up form
  13231.       end     (print "end") )            ; prints "start"
  13232.                         ; prints "an exit"
  13233.                         ; prints "end"
  13234.  
  13235.     (prog ()                 ; 
  13236.         (print "start")            ;
  13237.         (unwind-protect         ;
  13238.             (return "I'm done")    ; protected form
  13239.             (print "but first"))    ; clean-up form
  13240.          (print "won't get here") )    ; prints "start"
  13241.                         ; prints "but first"
  13242.                         ; returns "I'm done"
  13243.  
  13244.  
  13245. vector
  13246. ________________________________________________________________________
  13247.  
  13248. type: function (subr)
  13249. location: built-in
  13250. source file: xlbfun.c
  13251. Common LISP compatible: yes
  13252. supported on: all machines
  13253.  
  13254. SYNTAX
  13255.  
  13256. (vector [ <expr> ... ] )
  13257.     <expr>        -    an expression
  13258.  
  13259. DESCRIPTION
  13260.  
  13261. The VECTOR function creates an initialized  vector and returns it as the
  13262. result.  VECTOR is  essentially  a fast  method to do a  one-dimensional
  13263. MAKE-ARRAY with initial data in the vector.
  13264.  
  13265. EXAMPLES
  13266.  
  13267.     (vector 'a 'b 'c)            ; returns #(A B C)
  13268.     (vector '(a b) '(c d))            ; returns #((A B) (C D))
  13269.     (vector)                ; returns #()
  13270.     (vector NIL)                ; returns #(NIL)
  13271.     (vector 'a () 4 "s")            ; returns #(A NIL 4 "s")
  13272.  
  13273.  
  13274. when
  13275. ________________________________________________________________________
  13276.  
  13277. type: special form (fsubr)
  13278. location: built-in
  13279. source file: xlcont.c
  13280. Common LISP compatible: yes
  13281. supported on: all machines
  13282.  
  13283. SYNTAX
  13284.  
  13285. (when  <test> [ <expr> ... ] )
  13286.     <test>        -    an expression - NIL or non-NIL
  13287.     <expr>        -    expressions comprising a body of code
  13288.  
  13289. DESCRIPTION
  13290.  
  13291. The WHEN  macro  executes  the  <expr>  forms if <test>  evaluates  to a
  13292. non-NIL  value.  If <test> is  non-NIL,  the value of the last <expr> is
  13293. returned as the result.  If <test> is NIL, NIL is returned  with none of
  13294. <expr> evaluated.
  13295.  
  13296. EXAMPLES
  13297.  
  13298.     (when NIL)                ; returns NIL
  13299.     (when T)                ; returns T
  13300.     (when T (print "hi") 'foo)        ; prints  "hi"    returns FOO
  13301.     (when (listp '(a))             ;
  13302.           (print "a list"))            ; prints  "a list"
  13303.                         ; returns "a list"
  13304.  
  13305.  
  13306. :white-space
  13307. ________________________________________________________________________
  13308.  
  13309. type: keyword
  13310. location: built-in
  13311. source file: xlread.c
  13312. Common LISP compatible: no
  13313. supported on: all machines
  13314.  
  13315. SYNTAX
  13316.  
  13317. :white-space
  13318.  
  13319.  
  13320. DESCRIPTION
  13321.  
  13322. :WHITE-SPACE  is an entry that is used in the  *READTABLE*.  *READTABLE*
  13323. is a system variable that contains  XLISP's data structures  relating to
  13324. the  processing of  characters  from the user (or files) and  read-macro
  13325. expansions.  The existance of the  :WHITE-SPACE  keyword  means that the
  13326. specified  character may be skipped over.  The system  defines that tab,
  13327. space, return and line-feed are :WHITE-SPACE characters.
  13328.  
  13329. EXAMPLES
  13330.  
  13331.     (defun look-at (table)            ; define a function to 
  13332.      (dotimes (ch 127)            ;   look in a table
  13333.       (prog ( (entry (aref table ch)) )    ;   and print out any      
  13334.         (case entry             ;   entries with a function
  13335.           (NIL        NIL)        ;
  13336.           (:CONSTITUENT NIL)        ;
  13337.           (:WHITE-SPACE (print ch))        ;
  13338.           (T        NIL))))        ;
  13339.      (terpri))                ;
  13340.     (look-at *readtable*)            ;  prints  9         tab
  13341.                         ;          10         newline
  13342.                         ;          12         formfeed
  13343.                         ;          13         return
  13344.                         ;          32        space
  13345.  
  13346. CAUTION:
  13347. If you experiment  with  *READTABLE*, it is useful to save the old value
  13348. in a variable, so that you can restore the system state.
  13349.  
  13350.  
  13351. write-byte
  13352. ________________________________________________________________________
  13353.  
  13354. type: function (subr) 
  13355. location: built-in
  13356. source file: xlfio.c
  13357. Common LISP compatible: yes
  13358. supported on: all machines
  13359.  
  13360. SYNTAX
  13361.  
  13362. (write-byte  <expr>  [ <destination> ] )
  13363.     <expr>        -    an integer expression
  13364.     <destination>    -    an optional destination - must be a file pointer
  13365.                 or stream, the default is *standard-output*
  13366.  
  13367. DESCRIPTION
  13368.  
  13369. The  WRITE-BYTE  function  writes  the  <expr>  as a single  byte to the
  13370. specified  <destination>.  Only the <expr> byte is  written.  The <expr>
  13371. must be an integer  expression.  The <expr> is returned  as the  result.
  13372. The  <destination>  may be a file  pointer  or a stream.  If there is no
  13373. <destination>, *STANDARD-OUTPUT* is the default.
  13374.  
  13375. EXAMPLES
  13376.  
  13377.     (write-byte 67)                ; prints  C    returns 67
  13378.     
  13379.     (setq fp (open "t" :direction :output))    ; create file 
  13380.     (write-byte 65 fp)            ; returns 65
  13381.     (write-byte 66 fp)            ; returns 66
  13382.     (write-byte 10 fp)            ; returns 10
  13383.     (close fp)                ; returns NIL
  13384.     (read (open "t" :direction :input))    ; returns AB
  13385.  
  13386. COMMON LISP COMPATABILITY:
  13387. Common LISP specifies that print operations with a <destination> of NIL,
  13388. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  13389. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  13390. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  13391. XLISP does not allow T as a valid argument for <destination>.
  13392.  
  13393.  
  13394. write-char
  13395. ________________________________________________________________________
  13396.  
  13397. type: function (subr) 
  13398. location: built-in
  13399. source file: xlfio.c
  13400. Common LISP compatible: yes
  13401. supported on: all machines
  13402.  
  13403. SYNTAX
  13404.  
  13405. (write-char  <char-expr>  [ <destination> ] )
  13406.     <char-expr>    -    a character expression
  13407.     <destination>    -    an optional destination - must be a file pointer
  13408.                 or stream, the default is *standard-output*
  13409.  
  13410. DESCRIPTION
  13411.  
  13412. The  WRITE-CHAR   function  writes  the  <char-expr>  to  the  specified
  13413. <destination>.  Only the <char-expr> is written.  The  <char-expr>  must
  13414. be a character  expression.  The  <char-expr> is returned as the result.
  13415. The  <destination>  may be a file  pointer  or a stream.  If there is no
  13416. <destination>, *STANDARD-OUTPUT* is the default.
  13417.  
  13418. EXAMPLES
  13419.  
  13420.     (write-char #\C)            ; prints  C    
  13421.     
  13422.     (setq fp (open "t" :direction :output))    ; create file 
  13423.     (write-char #\A fp)            ; returns #\A
  13424.     (write-char #\B fp)            ; returns #\B
  13425.     (write-char #\Newline fp)        ; returns #\Newline
  13426.     (close fp)                ; returns NIL
  13427.     (read (open "t" :direction :input))    ; returns AB
  13428.  
  13429.  
  13430. COMMON LISP COMPATABILITY:
  13431. Common LISP specifies that print operations with a <destination> of NIL,
  13432. will  go to  *STANDARD-OUTPUT*.  XLISP  does  not  send  the  output  to
  13433. *STANDARD-OUTPUT*   with  a  <destination>  of  NIL.  Common  LISP  also
  13434. specifies  that a  <destination>  of T will be  sent  to  *TERMINAL-IO*.
  13435. XLISP does not allow T as a valid argument for <destination>.
  13436.  
  13437.  
  13438. zerop
  13439. ________________________________________________________________________
  13440.  
  13441. type: predicate function (subr)
  13442. location: built-in
  13443. source file: xlmath.c
  13444. Common LISP compatible: yes
  13445. supported on: all machines
  13446.  
  13447. SYNTAX
  13448.  
  13449. (zerop <expr> )
  13450.     <expr>        -    the numeric expression to check
  13451.  
  13452. DESCRIPTION
  13453.  
  13454. The ZEROP  predicate  checks to see if the number  <expr> is zero.  T is
  13455. returned  if the  number  is  zero,  NIL is  returned  otherwise.  A bad
  13456. argument  type  error  is  generated  if the  <expr>  is  not a  numeric
  13457. expression.
  13458.  
  13459. EXAMPLES
  13460.  
  13461.     (zerop 0)                ; returns T
  13462.     (zerop 0.0)                ; returns T
  13463.     (zerop 99999.9)                ; returns NIL
  13464.     (zerop -0.000000000002)            ; returns NIL
  13465.  
  13466.     (zerop 'a)                ; error: bad argument type
  13467.     (setq a 0)                ; set value of A to 0
  13468.     (zerop a)                ; returns T
  13469.  
  13470.  
  13471.