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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,56525db28240414a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.98.234 with SMTP id el10mr1287615wib.3.1343312798704; Thu, 26 Jul 2012 07:26:38 -0700 (PDT) Received: by 10.66.84.41 with SMTP id v9mr1677768pay.43.1343312366161; Thu, 26 Jul 2012 07:19:26 -0700 (PDT) Path: q11ni71877290wiw.1!nntp.google.com!16no6822486wil.1!news-out.google.com!b9ni60415685pbl.0!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!feed-C.news.volia.net!volia.net!news2.volia.net!feed-A.news.volia.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.straub-nv.de!news-2.dfn.de!news.dfn.de!goblin2!goblin.stu.neva.ru!feeder2.cambriumusenet.nl!feed.tweaknews.nl!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Efficient Sequential Access to Arrays Date: Sat, 21 Jul 2012 22:13:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: <23fae3a7-ab27-4e13-ae38-c48e83443161@googlegroups.com> References: <9d4d4463-4c7e-40f4-a167-933eb056c6a5@googlegroups.com> <5007ecf3$0$9507$9b4e6d93@newsspool1.arcor-online.net> <3dbfa883-54c8-4269-a567-26dde8ead4cd@googlegroups.com> <72dbbd45-320b-436a-9d81-fcb6d02504e1@googlegroups.com> NNTP-Posting-Host: 69.20.190.126 Mime-Version: 1.0 X-Trace: posting.google.com 1342934015 27059 127.0.0.1 (22 Jul 2012 05:13:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 22 Jul 2012 05:13:35 +0000 (UTC) In-Reply-To: <72dbbd45-320b-436a-9d81-fcb6d02504e1@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-Received-Bytes: 2784 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-07-21T22:13:34-07:00 List-Id: On Saturday, July 21, 2012 2:24:19 AM UTC-6, Keean Schupke wrote: > I have an ADT representing the disjoint set, but the element stored in it is limited and I cannot return it from a function. So, what's stopping you from having something like this: Procedure Adjustment( Object : In Out Disjoint_Set; State: In Boolean_Array_of_elements ); set as a Primitive operation? Actually, can't primitive operations (as functions) return the limited type, you know for initialization and such? The rationale says so. ( http://www.adaic.org/resources/add_content/standards/05rat/html/Rat-4-5.html ) Ada 2005 introduces a new approach to returning the results from functions which can be used to solve this and other problems. We will first consider the case of a type that is limited such as type T is limited record A: Integer; B: Boolean; C: Float; end record; We can declare a function that returns a value of type T provided that the return does not involve any copying. For example we could have function Init(X: Integer; Y: Boolean; Z: Float) return T is begin return (X, Y, Z); end Init;