Inconsistent comma requirements

Richard Gaskin ambassador at fourthworld.com
Sat Jun 24 11:37:34 EDT 2017


Apparently commas are optional in a handler definition, e.g.:

    on DoSomething a b

But they are not optional when passing arguments to a definition, e.g.:

     Doomething a b

...throws a compilation error, but this:

     DoSomething a,b

...works.

Because most languages require commas separating arguments, and because 
calling a handler explicitly requires them, it never occurred to me that 
the definition would allow them to be optional.

Ideally the same rules would apply on both sides.

I can kinda understand why they don't here, but if we had comma-free 
arguments we could add syntactic sugar to make things more English-like, 
e.g.:

   DoSomething with a and b


Two questions:

How many of you have never before known that commas are optional between 
definition arguments?

For those who've known about this, were you confused to discover that 
this only works for definitions but not calls?

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list