Re: Lisp refactoring puzzle

2011-07-12 Thread Petter Gustad
Xah Lee writes: > it's funny, in all these supposedly modern high-level langs, they > don't provide even simple list manipulation functions such as union, > intersection, and the like. Not in perl, not in python, not in lisps. In Common Lisp you have: CL-USER> (union '(a b c) '(b c d)) (A B C D

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-09 Thread Petter Gustad
r...@rpw3.org (Rob Warnock) writes: > invocation was given only one arg!! IT FOUND THE PATTERN, BUT DIDN'T > TELL ME WHAT !@^%!$@#@! FILE IT WAS IN!! :-{ Sounds frustrating, but grep -H will always print the filename, even when given a single filename on the command line. //Petter -- .sig remo

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Petter Gustad
Icarus Sparry writes: > The 'modern' way to do this is > find . -maxdepth 2 -name '*.html' -exec grep whatever {} + Agree, I've noticed that recent version of find have the + option. I remember in the old days the exec method was considered bad since it would fork grep for each process, so I've

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-08 Thread Petter Gustad
Xah Lee writes: > problem with find xargs is that they spawn grep for each file, which > becomes too slow to be usable. find . -maxdepth 2 -name '*.html -print0 | xargs -0 grep whatever will call grep with a list of filenames given by find, only a single grep process will run. //Petter -- .s

Re: merits of Lisp vs Python

2006-12-12 Thread Petter Gustad
Robert Uhl <[EMAIL PROTECTED]> writes: > that for can understand new objects; CL LOOP is not extensible, unless I > have missed something big, but it's simple enough to write a > map-new-object or loop-new-object or whatever). There is no standard way to extend loop, but most of the major vendors

Re: merits of Lisp vs Python

2006-12-08 Thread Petter Gustad
Bjoern Schliessmann <[EMAIL PROTECTED]> writes: > Can you give an example? I cannot imagine how homogenity always > results in easiness. CL-USER> (+ 1 2 3 4 5 6 7 8 9 10) 55 CL-USER> (< 1 2 3 4 5 6 7 8 9 10) T CL-USER> (< 1 2 3 4 5 6 7 8 9 10 9) NIL Petter -- A: Because it messes up the order