Re: Two Questions
Re: Two Questions
- Subject: Re: Two Questions
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Wed, 14 Feb 2001 23:32:28 +0100
(Michelle Steiner)
>
This doesn't work right for me.
>
>
if xItem is a string, it returns <<"">> in its place
>
>
set thelist to "c"
>
set itemToRemove to {"a","b","c","d","e"}
>
remove_from_list (xItem, xList)
>
>
--> {"a","b","","d","e"}
Sorry, assuming that you really meant:
remove_from_list ("c", {"a","b","c","d","e"})
I still have the result I expected:
remove_from_list("c", {"a", "b", "c", "d", "e"})
--> {"a", "b", "d", "e"}
8.6/1.3.7 here.
(Nigel Garvey)
>
2) I haven't written "xList's items", which is just a very inefficient
>
way of saying "xList".
Oh... I've been using such construct for monthes. Now I feel like stupid :(
Thanks for your corrections, they made the script even faster.
And regarding your 3):
>
3) The return list is all strings, so the method's only really good if
>
the original list is all strings too.
Once again you're all correct. I tried to revise it to make it work on mixed lists, only to find that it was absolutely impossible - with TIDs. Moreover, even adding a construct to turn the result back to integer ruined the benefit of the handler. So unless the entry is all strings, this handler is useless and the more traditional method of looping through the list must be used.
I don't want to end on this sad note :)
Speaking about the power of TIDs, I use a vanilla replacement of offset that is constantly 4x faster. I wonder however if the spead increase isn't merely because there's no more call to Standard Additions.
I also use vanilla replacements for ASCII char and ASCII number; they use ASCII char only at compile time to build an ASCII table, and then they are much faster - don't remember the benchmarks. Same remark as for the offset replacement. All of these were inspired by the constant emphasize on TIDs on this list.
So my question is, does anyone know why they are called
"AppleScript's text item delimiter_s_", is it an insight that they could be used with more than one value?
Thanks,
Serge
__ __ __
_ \///\/ _ I N S T I T U T | Serge Belleudy-d'Espinose - IJM
\///\/// J A C Q U E S | 2 place Jussieu - 75251 Paris Cedex 05
_///\///\_ M O N O D | m@il : email@hidden
__/\///\__ Service Informatique | WWW :
http://www.ijm.jussieu.fr/