home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / scheme / 2825 < prev    next >
Encoding:
Text File  |  1992-12-25  |  1.4 KB  |  53 lines

  1. Newsgroups: comp.lang.scheme
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.Hamburg.Germany.EU.net!malihh!clu
  3. From: clu@malihh.hanse.de (Carsten Lutz)
  4. Subject: applying or
  5. Message-ID: <BztJDI.1J1@malihh.hanse.de>
  6. Organization: malihh, Hamburg, Germany
  7. Date: Fri, 25 Dec 1992 14:10:29 GMT
  8. Lines: 43
  9.  
  10. Moin !
  11.  
  12. I tried to write a little procedure which implements an "or"-function but
  13. additionally checks if it's arguments are booleans. My approach was the
  14. following:
  15.  
  16.  (define (b-or . oplist)
  17.    (if (boollist? oplist)
  18.        (apply or oplist)
  19.        'not-a-bool))
  20.   
  21. Looks simple, but unfortunately 'or' is a syntactic keyword and hence can't 
  22. be passed to apply as a variable. So evaluating the above results in:
  23.  
  24. ;syntactic keyword referenced as variable or
  25. ;Abort!
  26.  
  27. Two questions arise for me:
  28.  
  29. 1. How can I pass a list of arguments to "or" ? apply doesn't work and I don't
  30.    see another way.
  31.  
  32. 2. Which where the criteria for choosing syntactic keywords. E.g. why are
  33.    "or" and "and" syntactic keywords but "+" or "-" are not ?
  34.  
  35. greetings,
  36.         Carsten
  37.  
  38.  
  39. I should mention my version of scheme:
  40.  
  41. Scheme Microcode Version 11.59
  42. MIT Scheme running under NeXT
  43.  
  44. Scheme saved on Friday December 13, 1991 at 9:19:31 AM
  45.   Release 7.1.3
  46.   Microcode 11.59
  47.   Runtime 14.104
  48.   Schematik 1.1
  49.  
  50. -- 
  51. * Carsten Lutz, Rellingen, FRG / clu@malihh.hanse.de ( NeXTmail accepted )  *
  52. *   Voice : +49 4101 512493  Fax: +49 4101 27757  Traily : +49 4101 22306   *
  53.