From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!deine.net!hamster.europeonline.net!newsfeed.europeonline.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: #+,#- etc. (Re: Behaviour of #'directory) References: <3c923d85.214813000@nntp.interaccess.com> <3224437278089234@naggum.net> <3224454424845597@naggum.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3224499472669088@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 51 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Mar 2002 14:17:43 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader1.kpnqwest.net 1015510663 193.71.199.50 (Thu, 07 Mar 2002 15:17:43 MET) NNTP-Posting-Date: Thu, 07 Mar 2002 15:17:43 MET Xref: archiver1.google.com comp.lang.lisp:28039 * Erik Naggum > (defmacro maybe-provide-feature (feature &body body) > (when body > `(progn ,@body (pushnew ,feature *features*)))) > > Then we could simply wrap the above example in like this: > > (maybe-provide-feature :momble-frotz > #+(or Genera (and (not Win32) Franz)) (foo) > #+(and CLIM (not PDP10)) (bar) > #+(or (not CLIM) linux) (baz)) > > #-mumble-frotz > (error "mumble-frotz is unavailable on this system") ; or whatever * Kent M Pitman | This is cute but doesn't address the issue that (a) the | maybe-provide-feature form could get more than one form in its body | [which could almost be dealt with] Almost? Just change &body to &optional and ,@body to ,body, and the macro call will refuse to work with more than one "actual" body. | and (b) there might be spurious #.'s in there [which can't be]. What is the difference between this and the code without the maybe-provide-feature wrapper? | A failing #-conditional doesn't execute #. But since I rely on the specified functionality of #+ and #- to produce only whitespace if the conditions are not met, I fail to see what you think would make a failing #-condition execute #. in my code. | So a form that actually does reading and evaluating as it accumulates its | forms, as would {...} or #{...} discussed earlier has some advantages. But that is not what maybe-provide-feature does. All it does is make sure that it pushes the new feature symbol onto *features* if at least one of the conditionally read (with the normal reader functionality) expressions are actually read, and not treated as whitespace. | Btw, that isn't fatal. Just something I thought I'd mention in defense | of the conditional notation those people do use. I am not quite certaint what you have replied to. /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.