Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: sorting/uniq-ing an array?



On Aug 11, 10:31am, Bruce Stephens wrote:
} Subject: Re: sorting/uniq-ing an array?
}
} "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx> writes:
} 
} > Standard linked pairs of arrays and colon-arrays behave that way,
} > yes.  I'm not (yet) suggesting adding that sort of linkage.  I'm
} > interested only in being able to declare a colon-array variable.
} > For example, I can't think of any reason to create ld_library_path
} > as an array.
} 
} Being able to create new special variables would be sufficient for
} this specific case.

There are lots of kinds of special variables besides just colon-arrays.
Most of them involve more special handling than just changing the set/get 
functions for the values.  On further inspection I now understand that
colonarr{set,get}fn are assuming that there's a global char ** somewhere
(pointed to by the param struct) in which to store the associated array
representation, so it's not merely a matter of changing the functions
even for this case.

} I was playing around with a variety of installed
} Tcl libraries, and it was handy to change my LD_LIBRARY_PATH quite a
} lot interactively.

vared works a lot better on colon-arrays (scalars) than on true arrays.

} Indeed, arrays have some nice syntax in zsh, which might be
} convenient.  Or are you suggesting using the same syntax for
} colon-arrays?

I'm not (at this point) suggesting changing any syntax other than to
add something to typeset.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author