in reply to code to get the first line of an array

Destructive to the array - isn't that a bit of an overstatement? shift does what it says; it shifts the first element of the array out. It therefore "modifies" rather than "destroys".

One world, one people

  • Comment on Re: code to get the first line of an array

Replies are listed 'Best First'.
Re^2: code to get the first line of an array
by tlm (Prior) on Jul 12, 2005 at 10:26 UTC

    monarch's usage is pretty standard, I think. For example,

    destructive

    (~ function) Capable of modifying its arguments.

    That's from here.

    the lowliest monk

Re^2: code to get the first line of an array
by pg (Canon) on Jul 12, 2005 at 07:38 UTC

    That statement hit me too. As far as most people are concerned, a destructor should deallocate all the resources an object owns (in a loose sense, not strictly an OO object, here I consider an array as an object).

    shift obviously does not meet that criteria, it is just a usual method.