[REBOL] Re: A question of function interface design
From: premshree::pillai::gmail::com at: 19-Jan-2005 20:08
On Wed, 19 Jan 2005 15:31:25 +0100, Michael Berg <[mokkel--gmx--de]> wrote:
> > Given that Rebol is not strongly typed, is the second of these "idioms"
> I thought Rebol is strongly typed (but not statically) ... like a value
> has always an assigned type.
Yes, REBOL _is_ strongly typed. Did anybody say otherwise? :-?
> About the rest: I prefer to have the interpreter checking the types of the
> arguments if that is wished. Actually I would like to have real support
This is something debatable. Folks from the strong-dynamic typed
kingdom would obviously not like the idea. However, there are clear
benefits of having static type checking. The compromise to this
solution would be to have _optional_ type checking. In fact, this is
what's happening with Python.
However, if there are type checkers (like pycheker for Python), it'd
be nice. And I doubt there's one for REBOL as of now.
> for Design by Contract (pre- and postconditions and maybe
> object-invariants), but I'm not sure whether that fits will with the Rebol
> philosophy - but however I find in principle nothing bad in having it. I
> know there is some old implementation of it at Rebol.org, but nobody seams
> to use it - maybe because of some other reasons ?
> I guess if you return 'none in case of error, that would somewhat destroy
> the purpose of a function (some precondition is always implied - if not
> explicitely stated), unless returning 'none would be raised to some
> standard, but then other problems occur (like Andreas Bolka stated in the
> other post). Maybe that's why I like the DBC approach, you just state
> what's else implicit in the function explicitely and the user/client of
> the function has to take care to fullfill the precondition and everything
> will work fine.
> Are there any comments regarding DBC being (un)useful for Rebol ?
> To unsubscribe from the list, just send an email to rebol-request
> at rebol.com with unsubscribe as the subject.