• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Deleting last item of a List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting last item of a List


  • Subject: Re: Deleting last item of a List
  • From: Nigel Garvey <email@hidden>
  • Date: Sun, 21 Nov 2004 00:10:28 +0000

kai wrote on Sat, 20 Nov 2004 15:45:45 +0000:

>On Sat, 20 Nov 2004 13:47:21 +0000, Nigel Garvey wrote:
>
>> I had a look in the AppleScript Language Guide this morning. It says:
>>
>> [quote]
>> beginning | front
>> end | back
>>
>> The beginning and front forms are equivalent and refer to the first
>> insertion point of the container (insertion point 1). The end and back
>> forms are equivalent and refer to the last insertion point of the
>> container (insertion point -1).

>> [/quote]
>>
>> The assertions of equivalence are wrong - at least, with regard to
>> AppleScript Language lists. "Front" and "back" can only be used
>> adjectivally and are equivalent to "first" and "last" respectively.

>Interesting. There seems to be a contextual thing going on here in
>terms of equivalence:
>
>set l to {"a", "b", "c"}

>l's back
>--> "c"

Even more interesting! I said above that "front" and "back" were *not*
equivalent to "beginning" and "end" because I kept getting errors when
trying to use them in that context. With both AS 1.3.7 (current when ASLG
was written) and AS 1.9.1 (in Jaguar):

  back of l
  --> Error: Can't get after {"a", "b", "c"}

But, on both systems, using Kai's Germanic genitive:

  l's back
  --> "c"

An equivalence failure of a different kind. :-)

Trying a bit harder, I find that this also works on both systems:

  (back) of l

So I withdraw my earlier statement. 'Front' and 'back' *are* equivalent
to 'beginning' and 'end' - or can be - so long as you remember to
compensate for the compiler.

NG
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Deleting last item of a List
      • From: jj <email@hidden>
    • Re: Deleting last item of a List
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Applescript-users Digest, Vol 1, Issue 213
  • Next by Date: Re: Deleting last item of a List
  • Previous by thread: Re: Deleting last item of a List
  • Next by thread: Re: Deleting last item of a List
  • Index(es):
    • Date
    • Thread