comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Multiple dispatch
Date: Wed, 15 Jun 2011 13:19:22 +0200
Date: 2011-06-15T13:19:22+02:00	[thread overview]
Message-ID: <op.vw362kdlule2fv@douda-yannick> (raw)
In-Reply-To: op.vw36oci1ule2fv@douda-yannick

Le Wed, 15 Jun 2011 13:10:50 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> A common and simple example, while not related to dispatching, is stream  
> 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 package  
> 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 and  
the data type are treated equally, this is the package which represent the  
union or collaboration of both together, with no one of both looking like  
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 most  
commonly raises when there are two types).


-- 
“Syntactic sugar causes cancer of the semi-colons.”  [Epigrams on  
Programming — Alan J. — P. Yale University]
“Structured Programming supports the law of the excluded muddle.” [Idem]
“c++; /* this makes c bigger but returns the old value */” [Anonymous]



  reply	other threads:[~2011-06-15 11:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-11 10:13 Multiple dispatch Yannick Duchêne (Hibou57)
2011-06-11 11:52 ` Dmitry A. Kazakov
2011-06-11 13:19   ` Yannick Duchêne (Hibou57)
2011-06-11 13:57     ` Dmitry A. Kazakov
2011-06-11 18:42       ` Emmanuel Briot
2011-06-11 19:12         ` Dmitry A. Kazakov
2011-06-15 10:30       ` Natasha Kerensikova
2011-06-15 11:10         ` Yannick Duchêne (Hibou57)
2011-06-15 11:19           ` Yannick Duchêne (Hibou57) [this message]
2011-06-15 14:59         ` Georg Bauhaus
2011-06-15 15:18           ` Yannick Duchêne (Hibou57)
2011-06-15 16:21             ` Georg Bauhaus
2011-06-12  5:13 ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox