Prev: Searching some references
Next: Comparing Lisp to Python, what you consider more important:speed or macros.
From: Tim Bradshaw on 2 May 2010 04:33 On 2010-05-01 18:53:01 +0100, RG said: > Lisp doesn't distinguish between statements and expressions. Instead, > Lisp conflates those two concepts into one, called a FORM. What I said > was that MOST FORMS return a value, and that this is true for most > languages. And, in Lisp, ALL forms can be used in a place which syntactially expects a value or values (possibly creating a run-time error if there is a mismatch in value count, which may in turn be elevated to compile-time in some cases with a sufficiently smart compiler). This is not true in languages which have several kinds of form.
From: Tim Bradshaw on 2 May 2010 04:35 On 2010-05-01 19:23:58 +0100, Espen Vestre said: > But is the space of lisp return values a Hilbert space? No, there's no norm, and I think Hilbert spaces need one
From: Espen Vestre on 2 May 2010 16:00 Tim Bradshaw <tfb(a)tfeb.org> writes: >> But is the space of lisp return values a Hilbert space? > > No, there's no norm, and I think Hilbert spaces need one :-) -- (espen)
From: Rob Warnock on 3 May 2010 04:00 Tim Bradshaw <tfb(a)tfeb.org> wrote: +--------------- | Espen Vestre said: | > But is the space of lisp return values a Hilbert space? | | No, there's no norm, and I think Hilbert spaces need one +--------------- Is Cheers a Hilbert space? http://en.wikipedia.org/wiki/Norm_Peterson -Rob ----- Rob Warnock <rpw3(a)rpw3.org> 627 26th Avenue <URL:http://rpw3.org/> San Mateo, CA 94403 (650)572-2607
From: Johan Ur Riise on 3 May 2010 05:37
Espen Vestre <espen(a)vestre.net> writes: > His kennyness <kentilton(a)gmail.com> writes: > >> meanwhile, here, I'll ask floor for its third value and see what it says: >> >> (nth-value 3 (floor 42 10)) -> nil > > I can "ask" nth-value for it googolth value, and it still returns nil: > > CL-USER 9 > (defparameter *googol* (expt 10 100)) > *GOOGOL* > > CL-USER 10 > (nth-value *googol* (floor 42 10)) > NIL > > But the definition of nth-value actually says the following: "Evaluates > n and then form, returning as its only value the nth value yielded by > form, or nil if n is greater than or equal to the number of values > returned by form. (The first returned value is numbered 0.)". We obviously need a new nth-value, free of this defect. Here nth-value-x returns two values, the second is T if the nth value in fact exists, nil else. (defmacro nth-value-x (n form) `(let ((reslist (multiple-value-list ,form))) (if (> ,n (length reslist)) (values nil nil) (values (nth ,n reslist) t)))) |