From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,57c2a52b53b360c2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Multiple dispatch Date: Wed, 15 Jun 2011 13:19:22 +0200 Organization: Ada @ Home Message-ID: References: <7loar137gjid$.qrn6ghii6ee$.dlg@40tude.net> <11peqoimzzkd9$.foyzy9udb4dt$.dlg@40tude.net> NNTP-Posting-Host: C6YugxKrhgMFJYeUelqZVQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.11 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19846 Date: 2011-06-15T13:19:22+02:00 List-Id: Le Wed, 15 Jun 2011 13:10:50 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > A common and simple example, while not related to dispatching, is stre= am = > operations : although its clear a input/ouput method must have two = > arguments, one for the stream and one for the data, how do you decide = = > the operation belongs to the package defining the type or to the packa= ge = > defining the stream. I forget to say there is another alternative to that kind of ambiguity := = defining a third package. In that third package, both the stream type an= d = the data type are treated equally, this is the package which represent t= he = union or collaboration of both together, with no one of both looking lik= e = dominated or controlled by the other (because there is no reason for the= = design to act as if this was, as it is not). This obviously applies even= = better when there are more than two types involved (but the question mos= t = commonly raises when there are two types). -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [Ep= igrams on = Programming =E2=80=94 Alan J. =E2=80=94 P. Yale University] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [Idem] =E2=80=9Cc++; /* this makes c bigger but returns the old value */=E2=80=9D= [Anonymous]