Re: Default or optional arguments to handlers
Re: Default or optional arguments to handlers
- Subject: Re: Default or optional arguments to handlers
- From: has <email@hidden>
- Date: Tue, 23 Apr 2002 13:18:00 +0100
Timothy Bates wrote:
>
4. Libraries enhancements
>
a Scripting Additions becomes a generic library access folder
>
b.1 No distinction between Osax and AppleScript libraries
Only ~2 more weeks till we find out what the new 'osax' architecture is
going to be. I'd be delighted if it covered these points (as it should,
imho).
>
b.2 Ability to define names for Applescript handlers
Whoop - for a moment I thought you meant reflection. I get it now though -
you mean the ability to define multi-word identifiers, e.g. "do something"
instead of "doSomething" or "do_something".
I like your other points, but not sure about that one. I'm unsure what the
potential for keyword collisions and other disasters might be once you let
the grand mass of ASers in on that particular act as well.
---------
Quick Aside:
I have a bit of a love/hate thing about application kewords as it is; never
sure if they're a boon or a curse, and think they're probably over-used as
it is. (Nothing more annoying than finding your variable names reformatting
as keywords because some osax you just installed claims it for its own.)
Besides, I really quite like the "foo(...)" syntax. It's clean, simple, and
easy to write and remember. The parens also make for a good visual cue - I
find it's much easier to spot "foo(x, y)" within code than "foo for x from
y", for example.
So something like you suggest:
to take an item (with terms {from list:theList, at:location})
I'm really not sure about [1]. It seems like the whole labelled params
business would be getting even more complex, when simplification and
consolidation are what's really needed. (BTW, how would you do optional
params here?)
---------
I think if it was specifically for the purpose of dressing up mods to
appear osax-like then some sort of additional wrapper that goes around a
normal library would be the best solution - you'd likely need something
like this anyway to support osax-style dictionaries.
But this move away from a simple, familiar, transparent and direct solution
may not be a good idea either. Perhaps one can try *too hard* to be
"English-like" sometimes?:)
Cheers,
has
[1] Though do feel free to show that I'm being needlessly paranoid.:)
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
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.