[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: the forward method [dynamic vs. static typing]
(replying to myself, a sure sign of inanity)
On Dec 10, 2003, at 11:46 AM, Felix Klock's ll1 list proxy wrote:
> I'm a (big) fan of ST, but I don't think this is a very convincing
> example from Ken.
>
> I firmly believe that DT *can* get this effect, if you define your
> types and primitive operations appropriately.
I just fired up hugs and played with the example Ken gave, and doing
that made me realize that there is one thing that his example could be
extended to do that mine could not: his could use a variant of read
that parsed the input and prompted the user again if the input was not
of the right type. In the system I proposed, you wouldn't know whether
the input was of the right type until potentially much later in the
computation, perhaps after a number of other side-effects had occurred.
So, getting the prompt-loop to occur within read does require some form
of return-type dispatch, which my system did not support, and I don't
know any way to extend it to support that feature (without actually
adding some sort of RTTI that the caller of prompting_read would pass
along to it)
Thus, I concede that Ken's example is a compelling use of ST.
-Felix