quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] gawk 3.0.6 doesn't support asort


From: Jean Delvare
Subject: Re: [Quilt-dev] gawk 3.0.6 doesn't support asort
Date: Tue, 6 Sep 2005 07:42:08 +0200 (CEST)

Hi Andreas,

[Jean Delvare]
> >     END     {
> > -             i = 1
> > -             for (file in files) {
> > -               if (!(file in printed)) {
> > -                 new_files[i]=file
> > -                 i++
> > -               }
> > -             }
> > -             n = asort(new_files)
> >               for (i=1; i<=n; i++)

[Andreas Gruenbacher]
> "i<=n" needs to be changed to "i in new_files" as well,

I don't think so. My awk manual states that the "var in array" type
loops have no guaranteed ordering.

http://www.cs.uu.nl/docs/vakken/st/nawk/nawk_84.html#SEC87
"The order in which elements of the array are accessed by this statement
is determined by the internal arrangement of the array elements within
awk and cannot be controlled or changed."

I could verify this myself with gawk 3.0.6 yesterday, which is why I
switched to using explicit indexes (which works as intended.)

> and new_files also should be removed completely.

What do to mean exactly please?

> > -               print new_files[i]
> > +               if (!(new_files[i] in printed))
> > +                 print new_files[i]
> >             }
> >     '
> >  }

Thanks,
--
Jean Delvare




reply via email to

[Prev in Thread] Current Thread [Next in Thread]