From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!QnTRC4x3WOQxzaUUaj2zKA.user.gioia.aioe.org.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Multiple dispatch in Julia Date: Sun, 15 Nov 2020 17:28:16 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <6faed833-462a-4b4b-b555-9a632fd7caddn@googlegroups.com> NNTP-Posting-Host: QnTRC4x3WOQxzaUUaj2zKA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:60588 List-Id: On 15/11/2020 15:32, antispam@math.uni.wroc.pl wrote: > Dmitry A. Kazakov wrote: >> On 15/11/2020 13:43, antispam@math.uni.wroc.pl wrote: >>> Dmitry A. Kazakov wrote: >>>> On 13/11/2020 13:55, antispam@math.uni.wroc.pl wrote: >>>>> Dmitry A. Kazakov wrote: >>>>>> On 12/11/2020 22:22, antispam@math.uni.wroc.pl wrote: >>>>>>> Dmitry A. Kazakov wrote: >>>>>>>> On 12/11/2020 18:56, antispam@math.uni.wroc.pl wrote: >>>>>>>>> Dmitry A. Kazakov wrote: >>>>>> >>>>>> Either you have static typing or not. But there is no disagreement. You >>>>>> said you do not know how to implement multiple dispatch (while keeping >>>>>> the language statically typed), I said same thing. >>>>> >>>>> I do not see why failure (error) during dispatch would >>>>> conflict with static typing. >>>> >>>> Because it violates typing. A multiple dispatch method is declared as >>>> acting on the whole Cartesian product of classes of arguments and/or the >>>> result. Violating that is type error. In Ada you cannot declare such >>>> methods ARM 3.9.2 (12). >>> >>> OK, Ada defines it own terminology, conflicting with terminology >>> used outside Ada. Since this discussion clearly goes beyond >>> Ada features my assumption was that general terminology applies. >> >> No, it is not a terminology issue. When an operation is declared it is >> on all possible values of the arguments, unless explicitly stated otherwise. > > Well, in typical multiple dispatch laggage method (operation) > declaration is split into several part. First part just introduces > name. [...] Right. You can proclaim it all untyped and so avoid type errors. No types, no type errors. >> The problem is that this is not possible to do. There is no contract of >> a multiply-dispatching operation in languages like Julia. Which is why >> it is a type error or an undefined behavior. > > I did not look at Julia rules. But languages which I know give > tight contract on multiple dispatch. How is it tight if it does not guarantee execution of the operation? >> If you contracted the multiple-dispatch operation Print to propagate >> exception on *certain* combinations of arguments that would not be a >> fault either. The problem is with [un]certainty. > > There is no uncertainty: language rules and program text exactly > specify which argument combinations propagate exception and > which go to specific implementation. That would not qualify even if it were true. It must be the specification of the module where the type declaration appears, nothing else. Contract /= implementation of. But of course Julia does not check the whole source code for consistency of dispatching calls. It is just typical "use it at your own peril" stuff. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de