• 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: Default or optional arguments to handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default or optional arguments to handlers


  • Subject: Re: Default or optional arguments to handlers
  • From: Andy Wylie <email@hidden>
  • Date: Tue, 23 Apr 2002 22:35:59 +1200

on 23/4/02 2:53 PM +1200: Timothy Bates wrote:

> On 23/4/02 8:46 AM, "has" <email@hidden> wrote:
>> I'm not sure overloading is as important to a loosely typed language like
>> AS as to a strongly typed one. Optional parameters would be very nice,
>> however.

>
> My priority list is
> 1. all arrays are hashes, just like in php
> set listA to {}
> set "dog" of listA to ""fido"
> get dog of listA
> -->"fido"
> get item 1 of listA
> -->"fido"
>

>> I wouldn't use lists myself: too much room for confusion. Also, I think the
>> 'all-or-nothing' approach works best. I've tried using stuff like:

> Absolutely: way confusing.

agreed OMM...

set listA to {dog:"fido"}
set ickyStuff to get ({listA}'s item 1 as string)
set AppleScript's text item delimiters to {""}
set thisDog to ickyStuff's text item -1
set AppleScript's text item delimiters to ""
thisDog
-- "fido"
_____________________________ Andy

http://www.sanyohk.com/kitty.htm
_______________________________________________
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.

References: 
 >Re: Default or optional arguments to handlers (From: Timothy Bates <email@hidden>)

  • Prev by Date: Re: Alias list not a list of aliases !?!
  • Next by Date: Re: Deafult or optional arguments to handlers
  • Previous by thread: Re: Default or optional arguments to handlers
  • Next by thread: Re: Default or optional arguments to handlers
  • Index(es):
    • Date
    • Thread