comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: Constraint Error - Please Help
Date: 1998/12/03
Date: 1998-12-03T00:00:00+00:00	[thread overview]
Message-ID: <7461v4$272$1@platane.wanadoo.fr> (raw)
In-Reply-To: 7445iv$gog$1@news.nyu.edu

Not the initial question, but I can't resist:

Fanni Kolchina a �crit dans le message <7445iv$gog$1@news.nyu.edu>...
> [...]
>    function sort_generic (x: SORT_ARRAY) return SORT_ARRAY is
>       copy: SORT_ARRAY(x'range);
>       last, left, right, max_l_r, current, this, parent: integer;
>       end_node, contents : ITEM;
>    begin
>
>    for i in x'first..x'last loop
>       copy(i):=x(i);
>    end loop;
>
You should rather simply write:

    function sort_generic (x: SORT_ARRAY) return SORT_ARRAY is
       copy: SORT_ARRAY := x;

One of the nice things with Ada is that you can very often deal with
structrured variables globally, and that you are not forced to always
go to basic loop.

---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://perso.wanadoo.fr/adalog






      parent reply	other threads:[~1998-12-03  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-02  0:00 Constraint Error - Please Help Fanni Kolchina
1998-12-02  0:00 ` Tom Moran
1998-12-02  0:00 ` Richard D Riehle
1998-12-03  0:00 ` Jeff Carter
1998-12-04  0:00   ` Michael F Brenner
1998-12-03  0:00 ` Jean-Pierre Rosen [this message]
replies disabled

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