Re: `let*' and functional design
- From: Joe Marshall <prunesquallor@xxxxxxxxxxx>
- Date: Sat, 09 Jul 2005 15:24:53 -0400
Bruce Hoult <bruce@xxxxxxxxx> writes:
> I really hate the CL/Scheme "let" because I like to give meaningful
> names to lots of intermediate values
I try to avoid giving names to intermediate values. I'll make an
intermediate variable only if
1. The value is used in more than one place.
2. The intermediate value is `important enough' to deserve a name.
3. Using the value producing form `in-place' clutters the code.
> I also use let* as the contents of many or most bodies in imperative
> code. But it's very easy to tell the difference -- in imperative code
> the expression bound to some of the names is a progn (begin in Scheme)
> containing all the side-effecting code that needs to be executed between
> the previous binding (and presumably using it) and this one.
>
> e.g.
>
> (let* ((name (begin (printf "What is your name?: ")
> (read)))
> (age (begin (printf "Hi, ~a, how old are you?: " name)
> (read))))
> (printf "Thanks for the information~n")
> age)
For this, I'd write a prompting-read subroutine.
--
~jrm
.
- References:
- `let*' and functional design
- From: N. Raghavendra
- Re: `let*' and functional design
- From: David H. Friedman
- Re: `let*' and functional design
- From: Kent M Pitman
- Re: `let*' and functional design
- From: Mike
- Re: `let*' and functional design
- From: Kent M Pitman
- Re: `let*' and functional design
- From: Joe Marshall
- Re: `let*' and functional design
- From: Bruce Hoult
- `let*' and functional design
- Prev by Date: Re: CL vs. K/KDB or efficient analysis of financial time series
- Next by Date: Re: Compiling PCL example, possible CLISP bug?
- Previous by thread: Re: `let*' and functional design
- Next by thread: Re: `let*' and functional design
- Index(es):