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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a0833bbed8752e1f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!news.glorb.com!newspeer2.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, sv-se, sv-fi, en-gb, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Why these "Drop" parameters? (was: variable lenght strings) References: <1861614.TWv5A9FgVL@linux1.krischik.com> <4178e979_1@baen1673807.greenlnk.net> In-Reply-To: <4178e979_1@baen1673807.greenlnk.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Sun, 24 Oct 2004 18:38:09 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1098643089 217.209.116.179 (Sun, 24 Oct 2004 20:38:09 CEST) NNTP-Posting-Date: Sun, 24 Oct 2004 20:38:09 CEST Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:5679 Date: 2004-10-24T18:38:09+00:00 List-Id: Martin Dowie wrote: > Being added in Ada2005, see Ada.Text_IO.Unbounded_IO in > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00301.TXT?rev=3D1.12 Reading that file I see these declarations: procedure Set_Bounded_String (Target : out Bounded_String; Source : in String; Drop : in Truncation :=3D Error); function Bounded_Slice (Source : in Bounded_String; Low : in Positive; High : in Natural; Drop : in Truncation :=3D Error) return Bounded_String; procedure Bounded_Slice (Source : in Bounded_String; Target : out Bounded_String; Low : in Positive; High : in Natural; Drop : in Truncation :=3D Error); procedure Set_Unbounded_String (Target : out Unbounded_String; Source : in String; Drop : in Truncation :=3D Error); function Unbounded_Slice (Source : in Unbounded_String; Low : in Positive; High : in Natural; Drop : in Truncation :=3D Error) return Unbounded_String; procedure Unbounded_Slice (Source : in Unbounded_String; Target : out Unbounded_String; Low : in Positive; High : in Natural; Drop : in Truncation :=3D Error); For Set_Bounded_String it is quite obvious that Drop specifies what=20 should happen if Source is longer than the maximum length of Target, but = can anyone explain what all the other "Drop" parameters are for? In the case of Bounded_Slice, shouldn't a slice of Source always fit in=20 Target? Aren't they the same type, with the same max length? Unbounded strings are supposed to be unbounded. Their only limit should=20 be the available memory, no? So, are the "Drop" parameters there meant=20 as a way to avoid Storage_Error? --=20 Bj=F6rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu