Re: Since Apple Listens to this List...
Re: Since Apple Listens to this List...
- Subject: Re: Since Apple Listens to this List...
- From: has <email@hidden>
- Date: Mon, 11 Feb 2002 15:42:05 +0000
Paul Berkowitz wrote:
>
On 2/11/02 1:15 AM, "email@hidden" <email@hidden> wrote:
>
>
> I thought I'd say "I'd love to see a case statement included in a
>
>near-future
>
> revision"; it would be so much more elegant than If/else
>
>if/elseif/elseif/etc
>
>
>
I've heard people say that before. I don't see why it's any better, or even
>
any different. What's the difference? Can you keep referring back to the
>
same case numbers later in a script, even out of the same context structure?
>
If not, what's the advantage?
It's a bit more concise to write; I dunno if it makes any difference
functionality-wise (it might be a little bit faster since each condition
test is simpler).
Overall it'd be pretty low on my list of Must Haves: if...elseif works
pretty well already and should be more than adequate for most folk. (Also,
if you're using more than, say, 20 tests then there may well be more
efficient ways to do it than long if...elseif/switch...case blocks.)
Besides, you can very easily go overboard on these things; for example, AS
has (count them) FIVE different ways of making local handler calls (three
of which suck [1] and one which is rendered virtually useless [2], btw).
How many ASers could even name all five, never mind use them or identify
the flaws within them? i.e. More is NOT necessarily better. ;)
has
[1] labelled parameters of forms: doSomething for value1 into value2 etc;
doSomething given label1: value1, label1: value2; doSomething with param1
without param2. A single, logical syntax would have been much better:
doSomething(param1: value1, param2: value2). Note also that parentheses
provide a strong visual cue, while the other syntaxes are much harder to
spot within code.
[2] wrapping (extending) osax/app calls, e.g. on display dialog someString
buttons someButtons...end display dialog. Unfortunately, although osax/app
calls support optional parameters local handler calls do not, which
seriously cripples this technique.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.