Subject: Re: What does #+<anything-here> mean?
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/07/17
Newsgroups: comp.lang.scheme
Message-ID: <7movgt$o7ub@fido.engr.sgi.com>
Gregory V. Larchev <gregl@leland.Stanford.EDU> wrote:
+---------------
| My textbook does not explain the '#+' notation.
+---------------

It's a "read-time conditional". The notation is borrowed from Common Lisp
(and many earlier Lisps). See the Common Lisp HyperSpec for all the gory
details [the following text edited slightly, to indicate fonts]:

    http://www.harlequin.com/education/books/HyperSpec/Body/sec_2-4-8-17.html
    ...
    #+ provides a read-time conditionalization facility; the syntax
    is #+<test> <expression>. If the feature expression <test> succeeds,
    then this textual notation represents an object whose printed
    representation is <expression>. If the feature expression <test>
    fails, then this textual notation is treated as "whitespace".
    ...

There's also "#-" for the inverse conditional, and the "test" can be
a fairly complex "feature expression", not just a single symbol. See:

    http://www.harlequin.com/education/books/HyperSpec/Body/sec_2-4-8-18.html
    http://www.harlequin.com/education/books/HyperSpec/Body/sec_24-1-2-1.html
    http://www.harlequin.com/education/books/HyperSpec/Body/sec_24-1-2-1-1.html

By the way, very few Schemes implement #+/#- (or #. either).


-Rob

-----
Rob Warnock, 8L-855		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA