|
![](/i/fill.gif) |
On 16-10-2010 4:51, nemesis wrote:
> Orchid XP v8<voi### [at] dev null> wrote:
>> Oh wow. 42 years later, it still exists:
>>
>> http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF
>>
>> "Go to considered harmful."
>
> a classic! I'm glad you've been interested in the evolution of programming
> formalisms -- and all by yourself! Next on, the lambda papers! ;)
>
>> I also note, with some interest, what looks suspiciously like Haskell
>> syntax, in a letter typed 42 years ago. Obviously it's not after
>> Haskell, but rather whatever mathematical formalism Haskell borrowed the
>> notation from. Still, interesting none the less...)
>
> bwahahahaha
>
> you must be talking about `conditional expressions as introduced by J.McCarthy
> ("B1 -> E1, B2 -> E2,....., Bn -> En")'... although it looks like currying
> haskell notation, it's actually what it's told: John McCarthy's conditional
> expressions for Lisp!
>
> (cond
> ((null? ls) 0)
> ((zero? (car ls)) 0)
> (#t (/ n (car ls))))
>
> cond was blowderized and adapted to all other programming languages in the
> simplified form if-then-else... even Lisp provides it as well as cond!
Dijkstra's guarded commands does not have a if-then-else, I know it is a
rather obscure language, but not in this context.
I find the if-then-else case interesting because it shows so clearly
that there was a trade off between having a language that has some
relation to maths and one that is understandable for below average IQ
humans*. Dijstra's version, the McCarthy version he mentions here and
the LISP version all are homologues of the disjuction. If-then-else is
more like human reasoning using a decision tree. I am not surprised that
the latter is the more common now, but I don't think I am happy with it.
*) there is also that if-then-else is more close to the conditional jump
of most processors at the machine level, but mentioning that might spoil
my point.
Post a reply to this message
|
![](/i/fill.gif) |