arraylast( in theory

Robert Ameeti Robert at Ameeti.net
Sat Feb 23 10:54:03 PST 2008


At 1:23 PM -0500, 2/23/08, James Cook wrote:

>At 11:28 AM -0600 2/23/08, David Thompson wrote:
>>"abcd"["-.",-1][".",-1][2,-1]
>
>Actually  "abcd"["-.",-1][2,-1] will do it and that's the method I've
>resorted to.
>
>The scenario begs the question though, since  array("abcd",1,".")
>duplicates arrayfirst("abcd","."), what's the point of arrayfirst(?

To find the 1st element in the array.

>And using Gary's example of  one person buying a ticket, technically
>he's not the last person in line;  there is no line.

Of course there is. If there were no line, there would be no one 
there. But since someone is there, there is a line. There is one 
person in line. He is the first person in line and he is the last 
person in line. Or do you count everything starting with zero? ;-)

>  His backside would be the separator and there's no one following 
>his backside.

No, His backside would not be the separator. The space between him 
and the next person (if there was one), would be the separator. His 
backside is the back of the last person in line.

>If I want to grab the last element of an array and there is no array, it
>would seem that arraylast( should be empty.

That is correct. If there is no array, there is no last element, and 
arraylast( would be empty.

>Otherwise, it would seem that a high percentage of uses for it need 
>to determine if an array
>actually exists.

No more than ArrayFirst( returning empty requires you to see if the 
array exists.

>As I noted, I can see all kinds of arguments either way. I also see a
>need to easily grab the last element of an array and be able to
>reliably know that I actually have an array in the first place
>without resorting to other tests.

Those same tests would be required for ArrayFirst(
-- 

<><><><><><><><><><><><><><><><><><>
Robert Ameeti

Bananas are my favorite vegetable because they have no bones.
<><><><><><><><><><><><><><><><><><>


More information about the Qna mailing list