[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replacing a function with another one
From: |
Michael Heerdegen |
Subject: |
Re: replacing a function with another one |
Date: |
Mon, 17 Mar 2014 13:00:31 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
lee <lee@yun.yagibdah.de> writes:
> Ah! Finally I understand what the difference is! What is the point of
> having two variations of `let'?
Both are useful. The standard `let' works similar to how arguments of a
lambda expression are bound. If the expressions expr1, expr2, ... in a
`let' form
(let ((v1 expr1)
(v2 expr2)
...)
body)
are side-effect free, the bindings of the `let' are interchangeable and
independent from each other, which makes code easier to read in general.
OTOH, `let*' provides the possibility to refer to bindings made earlier,
which is often what you want.
But to the cost that every binding may depend on prior bindings in the
same `let*', which makes it harder to read.
BTW, there is also a parallel setting operator named `psetq' or
`cl-psetq' respectively. For example, to interchange the values bound
to the variables a, b, you can do
(psetq a b b a)
Michael.
- Re: replacing a function with another one, (continued)
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/09
- Re: replacing a function with another one, lee, 2014/03/10
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/10
- Re: replacing a function with another one, lee, 2014/03/11
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/11
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/12
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/13
- Re: replacing a function with another one, lee, 2014/03/15
- Re: replacing a function with another one,
Michael Heerdegen <=
- Re: replacing a function with another one, lee, 2014/03/12
- Re: replacing a function with another one, Stefan Monnier, 2014/03/12
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/12
- Re: replacing a function with another one, Stefan Monnier, 2014/03/10
- Re: replacing a function with another one, lee, 2014/03/10
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/10
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/10
- Re: replacing a function with another one, lee, 2014/03/11
- Re: replacing a function with another one, Michael Heerdegen, 2014/03/11
- Re: replacing a function with another one, lee, 2014/03/12