From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!141.201.2.63!newshunter!cosy.sbg.ac.at!newsfeed.Austria.EU.net!newsfeed.kpnqwest.at!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader1.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Macros OR, AND References: <3BF4D9A4.D07BF449@eurocom.od.ua> <87r8qy5lr0.fsf@noetbook.telent.net> <3214961354417483@naggum.net> <3215041628177349@naggum.net> <2hitc85cxs.fsf@dslab7.cs.uit.no> Mail-Copies-To: never From: Erik Naggum Message-ID: <3215123981399435@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 50 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 19 Nov 2001 01:59:43 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader1.kpnqwest.net 1006135183 193.71.66.49 (Mon, 19 Nov 2001 02:59:43 MET) NNTP-Posting-Date: Mon, 19 Nov 2001 02:59:43 MET Xref: archiver1.google.com comp.lang.lisp:20335 * Frode Vatvedt Fjeld | This seems to me a very bad idea, as the transient magic mode of | operation enables a "transient-extent" (efficient) kind of allocation of | the values. If I understand you correctly, those multiple-value objects | would need to be consed at every function return, almost like python's | bad excuse for multiple values. I have no idea whether you understood me correctly or not, because I cannot figure out what you are talking about. I think you may have missed an "instead of" or something. | I (also) find it slightly strange that cond must coerce test-form returns | to single-values. Huh? This is very strange language. It really helps to understand you if you used the common language of the standard. (That is another good reason for a community standard as its focal point of agreement.) It is specified to test and return the primary value. | Seeing as cond is defined to be a macro, I suppose that is the reason; a | cond written in terms of if and let would need to use m-v-list to support | multiple-values. However, if cond was a special operator, I believe | implementing a multiple-values returning cond would be non-problematic | for most implementations. I have implemented a cond special operator, | and in fact the requirement to return a single value from test-forms is | just a nuisance, it would be easier to return all the test-forms values. Whether you implement it as a macro or a special operator does not affect the internal implementation. A symbol in the common-lisp package defined to hold a amacro does not have to be expanded by the compiler if it can do smarter things directly, it only needs to be defined as a macro to make user-defined code walkers see only a known and predefined set of special operators. You could clearly define a cond that held onto the multivalue return vector, if that is how they were implemented, and set up to return it if there were no body-forms. | But then again there may have been (other) good reasons why cond was | selected to be a macro and if a special operator, I don't know (but I'd | like to..) It was probably selected as a macro because it easier to code-walk if than cond. The implementation is free to do whatever it pleases as long as the semantics of the form is maintained. /// -- Norway is now run by a priest from the fundamentalist Christian People's Party, the fifth largest party representing one eighth of the electorate. -- Carrying a Swiss Army pocket knife in Oslo, Norway, is a criminal offense.