home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.scheme
- Path: sparky!uunet!mcsun!Germany.EU.net!news.Hamburg.Germany.EU.net!malihh!clu
- From: clu@malihh.hanse.de (Carsten Lutz)
- Subject: applying or
- Message-ID: <BztJDI.1J1@malihh.hanse.de>
- Organization: malihh, Hamburg, Germany
- Date: Fri, 25 Dec 1992 14:10:29 GMT
- Lines: 43
-
- Moin !
-
- I tried to write a little procedure which implements an "or"-function but
- additionally checks if it's arguments are booleans. My approach was the
- following:
-
- (define (b-or . oplist)
- (if (boollist? oplist)
- (apply or oplist)
- 'not-a-bool))
-
- Looks simple, but unfortunately 'or' is a syntactic keyword and hence can't
- be passed to apply as a variable. So evaluating the above results in:
-
- ;syntactic keyword referenced as variable or
- ;Abort!
-
- Two questions arise for me:
-
- 1. How can I pass a list of arguments to "or" ? apply doesn't work and I don't
- see another way.
-
- 2. Which where the criteria for choosing syntactic keywords. E.g. why are
- "or" and "and" syntactic keywords but "+" or "-" are not ?
-
- greetings,
- Carsten
-
-
- I should mention my version of scheme:
-
- Scheme Microcode Version 11.59
- MIT Scheme running under NeXT
-
- Scheme saved on Friday December 13, 1991 at 9:19:31 AM
- Release 7.1.3
- Microcode 11.59
- Runtime 14.104
- Schematik 1.1
-
- --
- * Carsten Lutz, Rellingen, FRG / clu@malihh.hanse.de ( NeXTmail accepted ) *
- * Voice : +49 4101 512493 Fax: +49 4101 27757 Traily : +49 4101 22306 *
-