[Top][All Lists]

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

RE: Always using let*

From: Drew Adams
Subject: RE: Always using let*
Date: Mon, 15 Sep 2014 09:15:09 -0700 (PDT)

sm> So, I stand by my claim: it's an Urban Legend.

But your claim changes with each post.

What you first claimed was an urban legend was my statement that:

 "for some Lisps the bindings of `let' can be done in parallel"

Your next message confirmed that that statement is true
(though for some reason you put "parallel" in quotes and
strengthened the assertion to "is" from "can be done"):

sm> Only the var-binding is "parallel", not the computation
sm> of each value.

The bindings are exactly what my statement claimed, and
what your first "Urban legend!" cry denounced.  And what
your latest message confirms.  The myth ("legend") is a myth.

`let' (vs `let*') is indeed about the _bindings_ being
independent, so making it _possible_ to carry them out in

That is the only thing specified for Common Lisp.  And that
is the only thing that makes sense for a language such as
Lisp that allows side effects during evaluation.

That is, it is not possible to arbitrarily parallelize
evaluation of the sexps whose values are bound.  (And yes,
my followup message spoke of "parallel evaluation", but I
again meant creation of the bindings.  Admittedly, I was
not as clear as I should have been there.)

As Pascal pointed out, in some concrete cases analysis can
reveal independency, which could be exploited for parallel
execution.  But as others then pointed out, this is also
true generally, including for `let*'.

The question of possibly parallelizing evaluation of the
sexps whose values are to be bound is a side point (red

The point of what CLTL(2) has to say about `let', which was
my point, is that `let' allows for parallelizing the
_bindings_.  And on that, you apparently agree now, in spite
of the alarmist messages.


Note: When I mentioned this binding independence/parallelism
point in passing, I put it in _parentheses_, pretty much as
an afterthought to the main reason I gave for the existence
of `let' in addition to `let*' and why/when one might want
to use the former.  I mentioned it only because it is
explicitly part of the design rationale for `let' vs `let*'
in Common Lisp.

Putting that in parens did not stop people from getting all
excited about it, unfortunately, starting with your "Urban
legend!" alarm.

reply via email to

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