[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: Style Guide

From: Tobia Conforto
Subject: [Chicken-users] Re: Style Guide
Date: Mon, 5 Nov 2007 17:19:04 +0100
User-agent: Mutt/1.5.16 (2007-06-11)

Mark Fredrickson wrote:
> There is certainly a idiomatic style of Scheme, but I think the actual
> style as defined by the layout of the source code matters as well.
> Those two documents were useful reads to some who frets over such
> issues (me).

Yes, I'm correcting my style based on those documents too.

> Here's a related question for more experienced Schemers: In Dybvig, he
> states that the define form:
>       (define square (lambda (x) (* x x)))
> is to be preferred to
>       (define (square x) (* x x))
> After reading that, I started using the first form religiously. Now
> I'm not so sure.

I'm no experienced schemer, but I like the second form best because it
makes it visually clear how the function will be called: looking at
(square x) it's obvious what the parameters and their formal names are.

When I see a (square 3) later on in the code, I will recognize it
instantly ("visually") as an application of (define (square x) ...)

Plus it's shorter.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]