On Sun, 13 Oct 2002, Aaron Crane wrote:
: Luke Palmer writes:
: > Some of my students want to go:
: > 
: >      if ($x == 1 || 2) { ... }
: > 
: > Now they can:
: > 
: >      if $x == 1 | 2 { ... } 
: 
: I like that a lot.  (Some of my students also want to do that.)
: 
: You can write an equivalent thing in Icon:
: 
:   if x = (0 | 1)
: 
: though (if memory serves) the parens are required.  And in Icon it's done
: with backtracking, not superpositions.

The optimizer could certainly choose to implement it with backtracking
if that was deemed to be more efficient and just as correct.  The big
value of superpositions is that they're a declarative syntax for
something that would otherwise have to be specified procedurally.
But everything ends up procedural underneath, at least with our
current computers.

I think that any() really needs to avoid making any guarantees
about whether (and in what order) its arguments are evaluated.
(Use || if you want to be sure.)  In a sense, that's the way
QM-based nanomachinery works anyway--progress is never guaranteed
unless an external constraint is met.  In other words, you just
run probabistically on Brownian motion until something "latches".
Proteins just happen to be very good at latching.

Larry

Reply via email to