Re: A style question
- From: "Pillsy" <pillsbury@xxxxxxxxx>
- Date: 27 Feb 2007 18:38:28 -0800
On Feb 27, 9:02 pm, job-271842...@xxxxxxxxxxxxxx wrote:
[...]
Thanks. Some questions/comments:
1) In "ANSI Common Lisp", Graham makes the following comments:
"The loop macro was originally designed to help inexperienced
Lisp users write iterative code...Unfortunately, loop is more like
English than its designers ever intended...to understand it in the
abstract is almost impossible...For such reasons, the use of loop
cannot be recommended."
Is this a minority view?
I think it is. I cordially despise LOOP myself, but almost everyone
uses it for simple stuff some of the time. You can avoid it entirely
if you want, but it can make your life unneccessarily difficult do.
You should spend some time becoming familiar with it. At the very
least, you need a basic understanding to read other people's
code. Then you can make an informed decision to avoid it. :)
One of the things that attracted me to Lisp was the simplicity,
consistency, etc. of the language, so when I read the above, it
seemed reasonable.
Common Lisp is in some ways simple, and pretty consistent, but it's
also huge and not particularly "pure". Personally, I like the sense of
compromise and age.
Others prefer Scheme, which is a different dialect of Lisp which is
all about being small and elegant and pure. I find it sterile and
spare and unfun myself.
3) Any reason why you chose (when fizz (princ "Fizz")) instead of (if
fizz (princ "Fizz")) ?
It's a little bit of Common Lisp style. If you are only going to use
the true branch of the conditional, use "when", and if you're only
going to use the false branch, use "unless".
Hope you continue to have fun.
Cheers,
Pillsy
.
- Follow-Ups:
- Re: A style question
- From: GP lisper
- Re: A style question
- References:
- A style question
- From: job-271842874
- Re: A style question
- From: Frank Buss
- Re: A style question
- From: job-271842874
- A style question
- Prev by Date: Re: Optimizing n-gram generation
- Next by Date: Re: Lisp Syntax - functions versus data
- Previous by thread: Re: A style question
- Next by thread: Re: A style question
- Index(es):
Relevant Pages
|