Prev: Searching some references
Next: Comparing Lisp to Python, what you consider more important:speed or macros.
From: Zach Beane on 29 Apr 2010 10:42 Tamas K Papp <tkpapp(a)gmail.com> writes: > On Thu, 29 Apr 2010 06:55:24 -0700, RG wrote: > >> coders have to face on a daily basis. And Python has some built-in >> features (notably iterators and list comprehensions) that make >> functional programming easier than in Lisp. > > I don't know Python that well. Could you please give an example? I > am curious whether those constructs give something extra, and if so, > whether one could implement them in CL. Even if they're implementable, there's a lot of value in providing things by default. For example, you can implement the condition system with simpler features, but having a single, specified condition system available with no extra effort is nicer. Zach
From: Tamas K Papp on 29 Apr 2010 10:47 On Thu, 29 Apr 2010 10:42:07 -0400, Zach Beane wrote: > Tamas K Papp <tkpapp(a)gmail.com> writes: > >> On Thu, 29 Apr 2010 06:55:24 -0700, RG wrote: >> >>> coders have to face on a daily basis. And Python has some built-in >>> features (notably iterators and list comprehensions) that make >>> functional programming easier than in Lisp. >> >> I don't know Python that well. Could you please give an example? I am >> curious whether those constructs give something extra, and if so, >> whether one could implement them in CL. > > Even if they're implementable, there's a lot of value in providing > things by default. For example, you can implement the condition system > with simpler features, but having a single, specified condition system > available with no extra effort is nicer. I don't disagree with you, but my question was not about establishing which language is nicer. I just want to see if I can learn something useful from another language, and possibly adapt it to CL and play around with it. Cheers, Tamas
From: His kennyness on 29 Apr 2010 11:01 Helmut Eller wrote: > * His kennyness [2010-04-28 21:12+0200] writes: > >> Mariano Montone wrote: >>> His kennyness escribi�: >>>> Captain Obvious wrote: >>>>> Z> I'm new to functional programming, just barely getting the hang of it, >>>>> Z> I hope. >>>>> >>>>> I'm sorry to disappoint you, but Lisp is not really a functional >>>>> programming language. >>>>> But it supports functional programming to some extent, ok... >>>> God, you are worse than I thought. Could you just go away or shut up for >>>> ten years and learn something before speaking here again? >>>> >>>> In Lisp, every form returns a value. Case closed. Thank you for playing. >>>> >>>> kt >>> CL-USER> (defun foo () >>> (values)) >>> FOO >>> CL-USER> (foo) >>> ; No value >>> CL-USER> >> >> I can always count on some newsgroup genius to point out the one >> non-exception exception. It is a non-exception because there /is/ a >> value if you are looking for one, namely nil. "; No value" is just a >> choice of the author of your repl. My repl's author simply shows a new >> prompt, which gets the edge for elegance in my book. > > (multiple-value-call (lambda (x) x) (values)) > > Is definitely an error. 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. kt
From: RG on 29 Apr 2010 11:42 In article <4bd99f61$0$22529$607ed4bc(a)cv.net>, His kennyness <kentilton(a)gmail.com> wrote: > Helmut Eller wrote: > > * His kennyness [2010-04-28 21:12+0200] writes: > > > >> Mariano Montone wrote: > >>> His kennyness escribió: > >>>> Captain Obvious wrote: > >>>>> Z> I'm new to functional programming, just barely getting the hang of > >>>>> it, > >>>>> Z> I hope. > >>>>> > >>>>> I'm sorry to disappoint you, but Lisp is not really a functional > >>>>> programming language. > >>>>> But it supports functional programming to some extent, ok... > >>>> God, you are worse than I thought. Could you just go away or shut up for > >>>> ten years and learn something before speaking here again? > >>>> > >>>> In Lisp, every form returns a value. Case closed. Thank you for playing. > >>>> > >>>> kt > >>> CL-USER> (defun foo () > >>> (values)) > >>> FOO > >>> CL-USER> (foo) > >>> ; No value > >>> CL-USER> > >> > >> I can always count on some newsgroup genius to point out the one > >> non-exception exception. It is a non-exception because there /is/ a > >> value if you are looking for one, namely nil. "; No value" is just a > >> choice of the author of your repl. My repl's author simply shows a new > >> prompt, which gets the edge for elegance in my book. > > > > (multiple-value-call (lambda (x) x) (values)) > > > > Is definitely an error. > > 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. 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: Too few arguments in call to #<Compiled-function (:INTERNAL BAZ) (Non-Global) #x302000D4D68F>: rg
From: o.jasper on 29 Apr 2010 17:15
Seems a little pointless to discuss whether it is functional or not. It is functional in the sense that you can write functionally with it if you want, it isn't functional in the sense that it doesn't force you, and perhaps it misses some features of functional languages. (Though i suspect most of them are library-addable) |