Rainer Joswig <rainer.joswig / ision.net> wrote:
>
> > This is a very
> > unspectacular property in a dynamically-typed language, but in a
> > statically-typed language, it means that I can write code like
> >   x: FOO
> >   x.some_feature
> > and I can look up the contract of 'some_feature' in FOO and be
> > sure that at least the contract that I find there will be
> > honored, no matter what kind of object was assigned to x.
>
> The same is true for dynamically typed languages with DbC.
>
> > In a dynamically-typed language, I don't know that x will always
> > be of type FOO,
>
> Just assert it. This can be done in many ways.

Ah, I didn't of think that. Thanks.
(I should really program in a dynamically-typed language. This is the
sort of things that you overlook when examining a concept from theory.
If I only had the time...)

Regards,
Joachim
--
This is not an official statement from my employer or from NICE.
Reply-to address changed to discourage unsolicited advertisements.