Variable parameter synonym functions

Ken Ray kray at sonsothunder.com
Fri Oct 24 00:45:23 EDT 2014


How about:

on a
   send ("aardvark" && (word 2 to -1 of the params)) to me
end a

on aardvark
  put the params
end aardvark

—
on mouseUp
   a "one","two","three"
end mouseUp

—> aardvark "one","two","three"

??

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com <applewebdata://472067EC-3153-497D-B547-581563CF4971/kray@sonsothunder.com>
Web Site: http://www.sonsothunder.com/	 <http://www.sonsothunder.com/>



> On Oct 23, 2014, at 6:51 AM, Mikey <mikeythek at gmail.com> wrote:
> 
> Has anybody come up with an easy way to write functions or handlers that are synonyms for other functions/handlers where both take a variable number of parameters?
> 
> If I want to have a handler "a" and synonym "aardvark", I would normally write
> 
> on a name
>   aardvark name
> end a
> 
> on aardvark name
>   answer "I'm an aardvark named"&&name
> end aardvark
> 
> 
> Now imagine doing that while supporting a variable number of parameters.
> 
> Sent from my iPhone
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list