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

Re: the forward method [dynamic vs. static typing]



"Felix Klock's ll1 list proxy" <ll1@pnkfx.org> writes:

> (replying to myself, a sure sign of inanity)

Why?  I often find that I'm the only one that listens to myself.

> 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.

I'm strangely uncompelled.  This sort of dispatching seems *much* more
along the lines of a clever hack than a good technique.  I haven't
figured out *exactly* what's wrong with this, but something seems off.