guile-user
[Top][All Lists]
Advanced

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

Re: C++ declaration style programming?


From: Han-Wen Nienhuys
Subject: Re: C++ declaration style programming?
Date: Wed, 21 Jan 2004 13:40:42 +0100

address@hidden writes:
> 
> (let* ((var1 (+ (something) 2))
>        (var2 (+ (something var1) var1))
>        (var3 (something var1 var2)))
> 
> If you need to change var3 at a later point, just give it another name:
> 
>   (let ((var3-2 (+ (something-else var3))))
>     (...
> 
> instead of set!-ting it. The problem with set! in a lexically scoped
> language is that you can change the binding of a variable defined at a
> higher level by mistake:

I know about all this. The example was a little contrived. The things
I have in mind are statements which currently return SCM_UNSPECIFIED.

I think it looks stupid to do

  (let* ((a (something))
         (unused (display a))
         (b (something-else a))
         ..
         )

which introduces a variable unused, and puts emphasis on the
declaration, not on the main action of the statements.

-- 

 Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 





reply via email to

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