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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a0c:c3c5:: with SMTP id p5mr1106312qvi.34.1572467957502; Wed, 30 Oct 2019 13:39:17 -0700 (PDT) X-Received: by 2002:a05:6808:9ad:: with SMTP id e13mr950885oig.90.1572467957152; Wed, 30 Oct 2019 13:39:17 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!j16no4850230qtl.0!news-out.google.com!x9ni625qti.1!nntp.google.com!j16no4850216qtl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 30 Oct 2019 13:39:16 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=81.167.3.186; posting-account=uulyKwoAAAA86DO0ODu--rZtbje8Sytn NNTP-Posting-Host: 81.167.3.186 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <51f1445d-8b2d-43b3-a193-733395a090d2@googlegroups.com> Subject: Re: User defined implicit conversion From: Egil H H Injection-Date: Wed, 30 Oct 2019 20:39:17 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57392 Date: 2019-10-30T13:39:16-07:00 List-Id: On Wednesday, October 30, 2019 at 8:43:05 PM UTC+1, Alain De Vos wrote: > Casting from one type to another is a real pain. > Does the functionality "User defined implicit conversion" exists? > If not are there strategies, general rules, to limit conversion to a minimum ? > > We don't want as concatination : > result := to_type_a (from_type_a (X) & from_type_a (Y)) ; > when you could have : > result := X & Y ; If they are all type_a, as indicated in the example, you should be able to do just result := X & Y; Maybe you forgot to make the operator visible? use type type_a;