[Top][All Lists]
[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
- C++ declaration style programming?, Han-Wen Nienhuys, 2004/01/20
- Re: C++ declaration style programming?, Viktor Pavlenko, 2004/01/20
- Re: C++ declaration style programming?,
Han-Wen Nienhuys <=
- Re: C++ declaration style programming?, Issac Trotts, 2004/01/20
- Re: C++ declaration style programming?, Lynn Winebarger, 2004/01/21
- Re: C++ declaration style programming?, Stephen Compall, 2004/01/21
- Re: C++ declaration style programming?, Keith Wright, 2004/01/21