home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / lisp / lispnews / text0157.txt < prev    next >
Encoding:
Text File  |  1985-11-10  |  4.1 KB  |  206 lines

  1.  The new functions contributed by the bair group dealing with symbol
  2. creation have been changed from fexprs to exprs (lambdas) and lexprs.
  3.  
  4. The new documentation follows:
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.      The functions described below are an alternative to the
  13. gensym  facility.   They  generate  new symbols by attaching
  14. counter numbers to the ends of the symbols' names.  An exam-
  15. ple follows of how the functions are used.
  16.  
  17.  
  18.     ____________________________________________________
  19.  
  20.     -> (initsym 'joe '(john 5))     ; initializing new symbol counters
  21.     (joe0 john5)
  22.     -> (newsym 'john)               ; create a new symbol
  23.     john6
  24.     -> (newsym 'chuck)              ; symbol need not be initsym'ed
  25.     chuck0
  26.     -> (oldsym 'john)               ; get current symbol
  27.     john6
  28.     -> (allsym 'john)               ; get all symbols between 0 and counter
  29.     (john0 john1 john2 john3 john4 john5 john6)
  30.     -> (allsym '(john 5))           ; get all symbols between 5 and counter
  31.     (john5 john6)
  32.     -> (remsym 'joe '(john 4))      ; remob all interned symbols
  33.                                     ; associated with joe and from
  34.                                     ; john4 to the current john
  35.                                     ; symbol--returns symbols with symbol counters
  36.                                     ; before doing remsym
  37.     (joe0 john6)
  38.     -> (symstat 'joe 'john)
  39.     ((joe nil) (john 3))
  40.     ____________________________________________________
  41.  
  42.  
  43.  
  44.  
  45. (initsym 'g_arg1 ...)
  46.  
  47.      WHERE:   g_argi is a  list  (n_counteri  s_argi)  or  a
  48.               string  s_argi  (which  is  equivalent  to  (0
  49.               s_argi)).
  50.  
  51.      RETURNS: a list of interned identifiers using the  sym-
  52.               bol  counters  n_counteri, i.e., the result of
  53.               concatenating s_argi to n_counteri.
  54.  
  55.      EXAMPLE: (initsym 'joe '(john 5)) ==> (joe0 john5)
  56.  
  57.      NOTE: See also newsym, oldsym, allsym, remsym, and sym-
  58.            stat functions.
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. (newsym 's_arg)
  79.  
  80.      RETURNS: an interned identifier formed by concatenating
  81.               the  name  s_arg  to  the  symbol  counter for
  82.               s_arg.  The symbol counter is  stored  on  the
  83.               property list of s_arg under symctr.  If there
  84.               is no counter, a counter  of  0  is  used  and
  85.               added  to  the  property list.  Thus, a symbol
  86.               need not be initsymed.
  87.  
  88.      EXAMPLE: (initsym 'joe '(john5)) ==> (joe0 john5)
  89.               (newsym 'john) ==> john6
  90.               (newsym 'joe) ==> joe1
  91.  
  92.      NOTE: See also initsym,  oldsym,  allsym,  remsym,  and
  93.            symstat functions.
  94.  
  95. (oldsym 's_arg)
  96.  
  97.      RETURNS: the  identifier  using  the   current   symbol
  98.               counter  for s_arg, rather than creating a new
  99.               identifier.  If no symbol counter  exists  for
  100.               s_arg, then s_arg is returned.
  101.  
  102.      NOTE: See also initsym,  newsym,  allsym,  remsym,  and
  103.            symstat functions.
  104.  
  105. (allsym 'g_arg)
  106.  
  107.      WHERE:   g_arg is a list (s_arg n_counter) or a  string
  108.               s_arg (equivalent to (s_arg 0)).
  109.  
  110.      RETURNS: a list of all the created identifiers  between
  111.               n_counter  and  the current symbol counter for
  112.               s_arg.
  113.  
  114.      EXAMPLE: (allsym 'john) ==> (john0 john1 john2)
  115.  
  116.      NOTE: See also initsym,  newsym,  oldsym,  remsym,  and
  117.            symstat functions.
  118.  
  119. (remsym 'g_arg1 ...)
  120.  
  121.      WHERE:   g_argi is a  list  (s_argi  n_counteri)  or  a
  122.               string  s_argi (which is equivalent to (s_argi
  123.               0)).
  124.  
  125.      RETURNS: a list of symbols s_argi with the current sym-
  126.               bol counters.
  127.  
  128.      SIDE EFFECT: remsym remob's all the created identifiers
  129.                   between   zero   and  the  current  symbol
  130.                   counter for s_argi.
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.      NOTE: See also initsym, newsym oldsym, allsym, and sym-
  145.            stat functions.
  146.  
  147. (symstat 's_arg1 ...)
  148.  
  149.      RETURNS: a list of pairs consisting of (s_argi symctri)
  150.               where   symctri  is  s_argi's  current  symbol
  151.               counter.
  152.  
  153.      NOTE: See also initsym,  newsym,  oldsym,  allsym,  and
  154.            remsym functions.
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.