comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@mitre-bedford.arpa  (Robert I. Eachus)
Subject: Re: How to assign STRINGs?
Date: 7 Sep 93 21:56:53 GMT	[thread overview]
Message-ID: <EACHUS.93Sep7165653@spectre.mitre.org> (raw)

In article <1993Sep3.181825.920@cfmu.eurocontrol.be> stef@cfmu.eurocontrol.be (
Stef Van Vlierberghe) writes:

   Newsgroups: comp.lang.ada
   Path: linus.mitre.org!linus!agate!doc.ic.ac.uk!uknet!mcsun!ub4b!cfmu!news
   From: stef@cfmu.eurocontrol.be (Stef Van Vlierberghe)
   Sender: news@cfmu.eurocontrol.be (News account)
   Date: Fri, 3 Sep 93 18:18:25 GMT
   References: <25gmc2$3cf@neomimsy.cs.umd.edu> <HILDJJ.93Aug26100909@jupiter.f
uentez.com> <EACHUS.93Aug27152310@spectre.mitre.org>
   Nntp-Posting-Host: cfmu
   Organization: Eurocontrol - Central Flow Management Unit
   Lines: 30

   In article <EACHUS.93Aug27152310@spectre.mitre.org> eachus@spectre.mitre.org
 (Robert I. Eachus) writes:

  > Nice going Bob, but you were a bit over-focused on style I guess,
  > I would like to return Better_Ideas on this one :

  >			String'(In_Str_Len+1..Out_Str'LENGTH => Pad_Char);
					  ^^
  > or you get a CONSTRAINT_ERROR.

    Mea culpa.

  > Hey, a new species of bug : off by 2 !   :-)

    Nope!  Old bug species.  Incorrect signs from double negation.  I
originally wrote In_Str_Len..Out_Str'LENGTH-1. (The catenation wipes
the actual indexes, all that matters is the length.)  But I moved the
correction to the first index as less confusing, and the usually
helpful SunAda compiler failed to do the symbolic arithmetic to
eliminate the run-time check.  (Not a compliant, since it catches most
of these cases.)  Next time I post something like this I'll have to
test it, not just compile it.

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...

             reply	other threads:[~1993-09-07 21:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-07 21:56 Robert I. Eachus [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-03 18:18 How to assign STRINGs? dog.ee.lbl.gov!overload.lbl.gov!agate!doc.ic.ac.uk!uknet!mcsun!ub4b!cfmu!
1993-08-27 20:23 Robert I. Eachus
1993-08-27 19:00 Tucker Taft
1993-08-27 15:35 cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!noc.near.ne
1993-08-26 18:17 cis.ohio-state.edu!pacific.mps.ohio-state.edu!math.ohio-state.edu!howland
1993-08-26 16:54 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-08-26 14:09 Joe Hildebrand
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox