Re: reading file to list

2009-01-18 Thread André Thieme
William James schrieb: André Thieme wrote: You make a very strong case that Lisp is very feeble at processing data. I'm almost convinced. I somehow don’t believe you :-) Ruby isn't feeble, so data like this is fine: shall we begin? or lotus135? 1984 times! The 3 stooges:

Re: reading file to list

2009-01-17 Thread André Thieme
Xah Lee schrieb: Xah Lee wrote: • A Ruby Illustration of Lisp Problems http://xahlee.org/UnixResource_dir/writ/lisp_problems_by_ruby.html On Jan 17, 12:30 pm, André Thieme wrote: In the Lisp style Clojure for example one does exactly the same as Jillian James (JJ) did in Ruby: (map

Re: reading file to list

2009-01-17 Thread André Thieme
Xah Lee schrieb: comp.lang.lisp,comp.lang.scheme,comp.lang.functional,comp.lang.python,comp.lang.ruby Here's a interesting toy problem posted by Drew Krause to comp.lang.lisp: On Jan 16, 2:29 pm, Drew Krause wrote [paraphrased a bit]: OK, I want to create a nested list

Re: merits of Lisp vs Python

2006-12-18 Thread André Thieme
Paul Rubin schrieb: > GC also gets rid of programs. There are programs you can write in C > but not in Lisp, like device drivers that poke specific machine > addresses. You are talking about an ANSI Common Lisp implementation. But nothing stops a vendor to deliver its CL with libs that support t

Re: merits of Lisp vs Python

2006-12-16 Thread André Thieme
Paul Rubin schrieb: > Kirk Sluder <[EMAIL PROTECTED]> writes: >> Personally, I've always preferred use the imperative to describe >> basic math rather than the passive. This would seem to map better to >> RPN than infix. > > For writing down complicated, nested expressions too? That's very >

Re: merits of Lisp vs Python

2006-12-16 Thread André Thieme
greg schrieb: > André Thieme wrote: >> (aif (timeConsumingCalculation) >> (use it)) > > I think the answer is that you just wouldn't do > that in Python at all. Having magic variables > spring into existence in your local namespace > as a side effect

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
Paul Rubin schrieb: > André Thieme <[EMAIL PROTECTED]> writes: >> And I didn't count the indentation level and \n in Python code. >> Why should I? They are editor commands. > > No they're part of Python syntax. A change in indent level is > recognized by

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
Paul Rubin schrieb: > André Thieme <[EMAIL PROTECTED]> writes: >> Lisp has no parens. An editor could support a mode where code >> is displayed in written in trees. There wouldn't be a single paren. > > But there would be even more tokens, the lines going betwe

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
[EMAIL PROTECTED] schrieb: William James schrieb: >>> How would you solve this in Python? >>> You could embed it inside a lambda and must somehow make the >>> variable "it" visible in it, because in the context of aif this >>> "it" gets bound to the result.In Ruby: >> def aif val >> yield v

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
William James schrieb: > André Thieme wrote: >> William James schrieb: >> >>> def nif num, pos, zero, neg >>> send( num>0 ? pos : (num==0 ? zero : neg) ) >>> end >> btw, your nif body is built out of 13 tokens, so more >> complicated than

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
greg schrieb: > [EMAIL PROTECTED] wrote: >> Adding parentheses ... all this is a >> burden specific to Python. > > As opposed to Lisp, where all you have to do is > use parentheses... oh, er... Lisp has no parens. An editor could support a mode where code is displayed in written in trees. There

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
William James schrieb: > def nif num, pos, zero, neg > send( num>0 ? pos : (num==0 ? zero : neg) ) > end btw, your nif body is built out of 13 tokens, so more complicated than the Python version. André -- -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
William James schrieb: I suppose that is Ruby code. So my statement was correct when I said: "In some languages it would look a bit cleaner, for example Ruby." This is because it has a minimal syntax for "lambda". > def p > puts "very positive" > "positive" > end > def z > puts "no no" >

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
Neil Cerutti schrieb: > That's not a real difficulty, is it? > > CL-USER> (mapcar #'(lambda (x) >(funcall (nif x p z n))) >'(0 2.5 -8)) Didn't you forget the #' before p, z and n? >> CL-USER> (mapcar #'(lambda (x) >>(nif x (p) (z) (n))) >

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
Paul Rubin schrieb: > André Thieme <[EMAIL PROTECTED]> writes: >> and the Lisp version has only 9: >> nth, 1+, truncate, signum, num, list, pos, zero, neg > > Oh come on, you have to count the parentheses too. We could define hundreds of way how to count tokens. Bu

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
Christophe Cavalaria schrieb: > Paul Rubin wrote: > >> André Thieme <[EMAIL PROTECTED]> writes: >>> def nif(num, pos, zero, neg): >>>if num > 0: >>> return pos >>>else: >>> if num == 0: >>>retu

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
Paul Rubin schrieb: > André Thieme <[EMAIL PROTECTED]> writes: >> def nif(num, pos, zero, neg): >>if num > 0: >> return pos >>else: >> if num == 0: >>return zero >> else: >>return neg > > def

Re: merits of Lisp vs Python

2006-12-15 Thread André Thieme
greg schrieb: > Ken Tilton wrote: > >> The reason I post macro expansions along with examples of the macro >> being applied is so that one can see what code would have to be >> written if I did not have the defskill macro to "write" them for me. > > It seems to me your brain is somewhat stuck o

Re: merits of Lisp vs Python

2006-12-14 Thread André Thieme
Bruno Desthuilliers schrieb: > André Thieme a écrit : >> Bruno Desthuilliers schrieb: >> > (snip) >>> Both are highly dynamic. Neither are declarative. >> >> >> Well, Lisp does support some declarative features in the ansi standard. > > If you

Re: merits of Lisp vs Python

2006-12-13 Thread André Thieme
Markus Triska schrieb: > Ken Tilton <[EMAIL PROTECTED]> writes: > >> I think all-rules-all-the-time Prolog is the poster boy for paradigm >> slavery. (I did try for a famous two months to use Prolog as a >> general-purpose programming language.) > > Don't expect to learn Prolog properly in so li

Re: merits of Lisp vs Python

2006-12-12 Thread André Thieme
Bruno Desthuilliers schrieb: > Mathias Panzenboeck a écrit : >> Mark Tarver wrote: >> >>> How do you compare Python to Lisp? What specific advantages do you >>> think that one has over the other? >>> >>> Note I'm not a Python person and I have no axes to grind here. This is >>> just a question fo

Re: merits of Lisp vs Python

2006-12-12 Thread André Thieme
Paul Rubin schrieb: > André Thieme <[EMAIL PROTECTED]> writes: >>> import module >>> module.function = memoize(module.function) >> Yes, I mentioned that a bit earlier in this thread (not about the >> "during runtime" thing). >> I also

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Christophe schrieb: > André Thieme a écrit : >> You don't even need to say 'function >> (memoize function) would be enough. >> And yes, you can memoize functions while the program is running. >> And you don't need a tool like slime for it. Lisp alre

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
mystilleef schrieb: > Ken Tilton wrote: >> Lisp has all the cool qualities you like in your pets, plus native >> compilation in most implementations, plus maturity and a standard, plus >> a better OO, plus macros, plus a dozen more small wins. Including >> automatic indentation. :) >> > > Better O

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Steven D'Aprano schrieb: > Yes. But you can't redefine 1+2 in Python, at least not without hacking > the interpreter. Can you redefine (+ 1 2) in Lisp? It is possible as was pointed out. If anyone would do it, he/she would do it inside a package. Then you would write: (package:+ 1 2) So in real

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Fred Gilham schrieb: > Paul Rubin <http://[EMAIL PROTECTED]> writes: > >> André Thieme <[EMAIL PROTECTED]> writes: >>> Instead of function = memoize(function) >>> one could just say: memoize(function). >> In Python you'd say >> >

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Steven D'Aprano schrieb: > On Sat, 09 Dec 2006 22:41:12 -0500, Ken Tilton wrote: > >>> I know that. It was more of a rhetorical question -- Lispers are either >>> trying to emphasis the radical nature of what you can do with macros, or >>> understate it and make them seem just like functions. >>

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Paul Rubin schrieb: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Now, if you want to tell me that, despite all the talk, Lisp coders don't >> actually create new syntax or mini-languages all that often, that they >> just use macros as functions, then the question becomes: why do you need >> mac

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Bill Atkins schrieb: > Bill Atkins <[EMAIL PROTECTED]> writes: > >> "every corner of the language"? Please. Why are you so post-happy >> when it's quite obvious that you don't know enough about Lisp to >> attack it? > > In addition to macros that define classes or methods, a common macro > is t

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Steven D'Aprano schrieb: > With Lisp macros, even that isn't guaranteed. Now, if Lispers would say > "Oh yes, macros give you great power, and with great power comes great > responsibility. Be careful." Well, macros are one (big) thing that Lisp has and which many other languages don't have. Thei

Re: merits of Lisp vs Python

2006-12-11 Thread André Thieme
Steven D'Aprano schrieb: > On Sat, 09 Dec 2006 14:57:08 -0500, Bill Atkins wrote: > >> Paul Rubin writes: >> >>> There is just not that much boilerplate in Python code, so there's >>> not so much need to hide it. >> Well, of course there is. There are always going to be

Re: merits of Lisp vs Python

2006-12-09 Thread André Thieme
Ken Tilton schrieb: > > > André Thieme wrote: >> Ken Tilton schrieb: >> >>> The last time we went thru this a Pythonista finally said, Oh, I get >>> it. These five lines of code I have to write all the time (two setup, >>> one func call, tw

Re: merits of Lisp vs Python

2006-12-09 Thread André Thieme
Ken Tilton schrieb: > The last time we went thru this a Pythonista finally said, Oh, I get it. > These five lines of code I have to write all the time (two setup, one > func call, two cleanup) can be collapsed into one or two. The thread > will be hard to miss in Google groups (two years back?)

Re: merits of Lisp vs Python

2006-12-09 Thread André Thieme
Aahz schrieb: > In article <[EMAIL PROTECTED]>, > Mark Tarver <[EMAIL PROTECTED]> wrote: >> I'm looking at Python and I see that the syntax would appeal to a >> newbie. Its clearer than ML which is a mess syntactically. But I >> don't see where the action is in Python. Not yet anyway. Lisp syn

Re: merits of Lisp vs Python

2006-12-08 Thread André Thieme
hankhero schrieb: > Some clever details, like using minus to index vectors from the right. > (aref "hello" -1) gives an error on Lisp, but the character o on Python. It would not be difficult to add this feature to Lisp. > Another detail I like is that you can choose how to quote strings, in >