From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: * X-Spam-Status: No, score=1.8 required=3.0 tests=AC_FROM_MANY_DOTS,BAYES_50, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.6 X-Received: by 2002:a05:622a:134d:b0:2f3:ac46:28c with SMTP id w13-20020a05622a134d00b002f3ac46028cmr8977539qtk.342.1651654974940; Wed, 04 May 2022 02:02:54 -0700 (PDT) X-Received: by 2002:a25:33c6:0:b0:648:b8a1:a30e with SMTP id z189-20020a2533c6000000b00648b8a1a30emr16663724ybz.44.1651654974781; Wed, 04 May 2022 02:02:54 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 4 May 2022 02:02:54 -0700 (PDT) Injection-Info: google-groups.googlegroups.com; posting-host=160.46.252.10; posting-account=mOyWBQoAAAD7S-NBmMUOr9hRClcL0vqR NNTP-Posting-Host: 160.46.252.10 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0b4ddd38-1f19-44fe-acd9-43a316ec9d29n@googlegroups.com> Subject: Discriminants or Constructor Function for Limited Types From: R R Injection-Date: Wed, 04 May 2022 09:02:54 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:63808 List-Id: There are two ways (to my knowledge) how to initialize objects of limited types. Either the limited type has some discriminants type DLT (Width, Length : Positive) is tagged limited private; Obj : DLT (3, 5); or I can provide a constructor function that takes corresponding parameters type LT (<>) is tagged limited private; function Make (Width, Length : Positive) return LT; Obj : LT := Make (3, 5); Do you recommend one way over the other? Why? Is it possible to combine both methods (discriminants plus constructor)? RREE