Re: more closed-world chatter

From: David Cressey <cressey73_at_verizon.net>
Date: Sun, 06 May 2007 09:57:11 GMT
Message-ID: <XDh%h.3756$XG1.2460_at_trndny07>


"Jon Heggland" <jon.heggland_at_idi.ntnu.no> wrote in message news:f1ju1j$qni$1_at_orkan.itea.ntnu.no...
> Marshall wrote:
> > On May 5, 8:50 am, Jon Heggland <jon.heggl..._at_idi.ntnu.no> wrote:
> >>> when it comes to the advantage of sub-typing in dealing with
> >>> my question.
> >> I don't know about "advantage"; I just don't see how you can avoid it.
> >
> > It's easy to avoid: just don't put subtying in the language design.
>
> I didn't mean how to avoid subtyping per se; I meant how to avoid it if
> you want to be able to join on attributes with different types.
> --
> Jon

If the language includes casting functions, it should be possible to using them to join on attributes with different types. Consider Marshall's scenario, with the two types, namely int and string. Consider also the function str(i) which takes an int as an argument and returns the corresponding string.

now we can join on attributes i and s by saying something like

       "where a.s = str(b.i)"

(Maybe I should have said "conversion functions" instead of "casting functions".) Received on Sun May 06 2007 - 11:57:11 CEST

Original text of this message