[Swift-devel] Re: Criteria for rollout
Ben Clifford
benc at hawaga.org.uk
Thu Jan 10 18:29:46 CST 2008
On Thu, 10 Jan 2008, Mihael Hategan wrote:
> > I think the correct behaviour should be to output in the order of the
> > array indices (for both plain array passing and for @filenames).
>
> So I think sorting in all cases (i.e. getFringePaths()) isn't necessary.
> Not sorting is faster.
>
> So a simple solution would be to sort those paths right in
> leavesFileNames(). In the particular case of an array, it will achieve
> the desired result. In other cases (i.e. more complex data types) it
> would result in some form of order, not particularily worse than no
> order. Make sense?
Sorting only needs to happen when the arrays get serialised in some
place that is significant.
At the moment, I think the only place for that is @filename and
@filenames.
So leavesFileNames would be an ok place to do it.
A more complicated-to-implement approach would be to sort out the return
type of @filenames (it doesn't have one at the moment that fits in the
Swift data model) so that it returns a Swift-style array of strings rather
than a Java array of strings; and then have the sorting happening at the
point that the swift-style array of strings is serialised (whether its a
Swift array coming out of @filenames or a swift array coming from
somewhere else). That's something that I want to do to tidy up the
language some anyway; but don't let that hold up implementation of a
leavesFileNames sorting fix.
--
More information about the Swift-devel
mailing list