Search found 4 matches

by foregam
Tue Aug 02, 2011 1:13 pm
Forum: Common Lisp
Topic: Lisp idioms/functions for common tasks
Replies: 3
Views: 4828

Re: Lisp idioms/functions for common tasks

Maybe the question about last was a bit silly, but then look here. Anyway, you get the idea what kind of details are of interest to me. Is there something like the CL Cookbook but a bit more detailed?
by foregam
Tue Aug 02, 2011 8:51 am
Forum: Common Lisp
Topic: Lisp idioms/functions for common tasks
Replies: 3
Views: 4828

Lisp idioms/functions for common tasks

So I've been mucking with Lisp for a few days, finding my way, getting the feel of it, and now I'm beginning to wonder what the canonical way to do certain tasks is. For example, to append a new element at the end of a list I would say (setf (cdr (last list)) (cons 'new nil)) However, I suspect ther...
by foregam
Fri Jul 29, 2011 4:46 am
Forum: Common Lisp
Topic: Macro to construct function names dynamically
Replies: 4
Views: 15379

Re: Macro to construct function names dynamically

Thank you both very much for your concise answers. @Kompottkin, no, I actually want it as a shorthand for writing a big number of similarly looking lines by hand, which I consider a very likely source of errors. Maybe I should refactor my source further on. The Bash example I gave was simplified to ...
by foregam
Thu Jul 28, 2011 6:49 am
Forum: Common Lisp
Topic: Macro to construct function names dynamically
Replies: 4
Views: 15379

Macro to construct function names dynamically

Hello, I'm new to Lisp and my previous programming experience was mostly C, Perl and shell scripts. I'm still heavily influenced by it so please bear with me. So: Is there a way to define a macro which constructs a function name when given a list of symbols? I'd like to call it like this: (do-expand...