[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [BUG] Table constructor not equivalent to left-to-right assignment (Was: Testing for a sequence ...)
- From: Mark Hamburg <mhamburg.lists@...>
- Date: Sun, 22 Apr 2012 14:57:29 -0700
On Apr 22, 2012, at 2:53 PM, Mark Hamburg <mhamburg.lists@gmail.com> wrote:
> On Apr 22, 2012, at 11:22 AM, Robert Virding <robert.virding@erlang-solutions.com> wrote:
>
>> Without a clear deterministic definition of the language it can be basically impossible to determine what your program does. It also becomes impossible to reason about.
>
> Go read Dijkstra or Gries. Their control flow constructs were non-deterministic.
>
> Basically, in this case, you have to stop thinking of the program as being in a specific state but rather in one of a set of states and you reason in terms of properties of that set.
For example, if we execute:
t = { 10, 20, nil, 40, [ returnsThree() ] = 30 }
And we then ask what is the value of t[ 3 ]?
The answer is that it can be nil or 30 but no other value.
Mark