Prev: Searching some references
Next: Comparing Lisp to Python, what you consider more important:speed or macros.
From: His kennyness on 30 Apr 2010 23:31 Tim Bradshaw wrote: > On 2010-04-30 11:52:53 +0100, RG said: > >> Good grief, I'm surrounded by idiots. > > You are living in a hall of mirrors. > >> Of course it's different. Here >> you're calling a function of two arguments with one argument. > > And there you're feeding no values to a form which expects one. You may > observe a certain partly-broken symmetry there. > >> That has >> nothing to do with whether or not (values) "really" returns NIL as Kenny >> claimed. > > Why do you think I said it had anything to do with that? relax, that's just Ron being Erann. kt
From: His kennyness on 30 Apr 2010 23:48 Espen Vestre wrote: > His kennyness <kentilton(a)gmail.com> writes: > >> Cool, nice exception to the exception to the exclusion. But it is a >> compiler-macro that complains, so it is not that (values) does not >> return nil if asked (it better, it's in the spec) it's that >> multiple-value-call knows how to count. > > I see you guys are having fun flaming each other... I think your wording > above is not quite right though. It's true that the spec says (section > 3.1.7) "if the form produces zero values, then the caller receives nil > as a value", but it's misleading to say that (values) "returns nil if > asked". > > I think it's better to compare it to what happenes if you try to assign > more variables than there are values in multiple-value-bind, all excess > variables get bound to nil: > > CL-USER 6 > (let ((foo (values))) > foo) > NIL > > CL-USER 7 > (multiple-value-bind (foo bar gazonk) > (floor 2 3) > (list foo bar gazonk)) > (0 2 NIL) > > CL-USER 8 > > > I think it would be misleading to explain thas as "floor returns NIL as > its third value if asked" ;-) Now hold on there, desperado. /You/ drew a comparison and nothing but a comparison between the choice made by the cubicle dweller who coded up mvb and a different choice by the yobbo covered in donut debris who coded up mvc. So there you are off in The Land of Haphazard Choice citing it as the definition of how (values) should be understood, while I am safely ensconced in the arms of our sacred CLHS with the only problem being that you do not consider a caller to be "asking" for a value. Sure, the Unsaved use setf. But in lisp that returns a value! Cuz in Lisp, every form... oh, well. meanwhile, here, I'll ask floor for its third value and see what it says: (nth-value 3 (floor 42 10)) -> nil The deepest problem here is that once again HK has been underestimated: "ask" is nowhere to be found in the CLHS, and was deliberately chosen to be undecidable in meaning in the context of Lisp. Ergo, one cannot hope to prove HK wrong about His Usage thereof. All bow. kt
From: RG on 1 May 2010 00:39 In article <4bdba00c$0$31262$607ed4bc(a)cv.net>, His kennyness <kentilton(a)gmail.com> wrote: > Tim Bradshaw wrote: > > On 2010-04-29 16:42:18 +0100, RG said: > > > >> You know, Kenny, the arrogant Lisp weenie act would go over a lot better > >> if you actually knew what you're talking about. > >> > >> ? (defun foo () (values)) > >> FOO > >> ? (defun baz () (multiple-value-call (lambda (x) x) (foo))) > >> BAZ > >> ? (baz) > >>> Error: > > > > THis is not really any different to > > > > (defun foo (x y) > > (cons x y)) > > > > (foo 1) > > > > the vastly more interesting point is that all these yobbos are useless > usenet roadkill. The point was: lisp is indeed a functional language (in > the non-crazy obsessive sense) because every lisp form returns a value. You really aren't paying attention. GO and THROW do not return. But leaving this aside, imagine if CL did not have LAMBDA, FLET, LABELS, FUNCTION, FUNCALL, REDUCE, or any of the MAP* functions. It would still be true that (nearly) all of the remaining forms returned values. But no sane person would call the resulting language functional. So... > lisp is > indeed a functional language because every form returns a value*. No. Lisp is a functional language because functions are first-class objects. rg
From: RG on 1 May 2010 01:16 In article <rNOSPAMon-B76D75.21393130042010(a)news.albasani.net>, RG <rNOSPAMon(a)flownet.com> wrote: > In article <4bdba00c$0$31262$607ed4bc(a)cv.net>, > His kennyness <kentilton(a)gmail.com> wrote: > > > Tim Bradshaw wrote: > > > On 2010-04-29 16:42:18 +0100, RG said: > > > > > >> You know, Kenny, the arrogant Lisp weenie act would go over a lot better > > >> if you actually knew what you're talking about. > > >> > > >> ? (defun foo () (values)) > > >> FOO > > >> ? (defun baz () (multiple-value-call (lambda (x) x) (foo))) > > >> BAZ > > >> ? (baz) > > >>> Error: > > > > > > THis is not really any different to > > > > > > (defun foo (x y) > > > (cons x y)) > > > > > > (foo 1) > > > > > > > the vastly more interesting point is that all these yobbos are useless > > usenet roadkill. The point was: lisp is indeed a functional language (in > > the non-crazy obsessive sense) because every lisp form returns a value. > > You really aren't paying attention. GO and THROW do not return. > > But leaving this aside, imagine if CL did not have LAMBDA, FLET, LABELS, > FUNCTION, FUNCALL, REDUCE, or any of the MAP* functions. Doh, left out APPLY. > It would still > be true that (nearly) all of the remaining forms returned values. But > no sane person would call the resulting language functional. So... > > > lisp is > > indeed a functional language because every form returns a value*. > > No. Lisp is a functional language because functions are first-class > objects. > > rg
From: His kennyness on 1 May 2010 07:58
Captain Obvious wrote: > Hk> In Lisp, every form returns a value. > > What does GO return? And, importantly, WHERE does it return? > > Hk> God, you are worse than I thought. Could you just go away or shut up > Hk> for ten years and learn something before speaking here again? > > Aha, come back when you learn about non-local control transfers. Good lord, can you not even manage human discourse? Well, no, you are an engineer. The context is "is lisp a functional language?". Finding edge cases is besides the point, but amusing for the pathetic types that just hang out on usenet playing gotcha. hth, kenzo |