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

Re: how to truncate an array

Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> On 03/04/2014 07:05 PM, Bart Schaefer wrote:
> > On Mar 4, 12:02pm, Ray Andrews wrote:
> > }
> > } God knows what " =() " really does, and I'm smart enough to not even ask ;-)
> >
> > Heh.  () in an assignment is just an array with no elements.
> That's easy for you to say. ;-) What I mean is how the underlying C
> code knows to terminate
> the array. Come to think of it, there must be a null inserted, cuz
> that's how C does things
> even if zsh wants to be different. I wish we could just do the same
> thing up front and in yo' face.
> Nevermind, I hafta try to think like a zsheller.

I agree with the recommendation that you stop making assumptions that a shell's method of handilng a particular data structure, is the same as how one of the C language library functions does.  The source code is availabe for you to read and study.  If you come up with a better algorithm I'm sure it would be adopted.  


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