Question about Object Names

Richard Gaskin ambassador at fourthworld.com
Fri May 27 11:30:39 EDT 2011


Todd Geist wrote:

> On Fri, May 27, 2011 at 7:57 AM, Richard Gaskin wrote:
>> For example, you can call the numToChar function using either of these two
>> forms:
>>
>>  numToChar(128)
>>  the numToChar of 128
>>
>> Meanwhile, the sum function can only be called using function syntax:
>>
>>  sum(1,2,3) -- works
>>  the sum of "1,2,3" -- throws an error
>
> Is there a pattern at all in when one is form is not allowed?
>
> In the example you gave, the sum function takes a list of numbers, where the
> numToChar takes a single item.

There may be a pattern; I'm sure it made sense to whomever came up with 
that "sometimes" rule at the time.

But for myself the problem is easily worked around:  I usually just 
ignore the capability of using property syntax for function calls.

I find it much clearer to read code in which functions are called using 
function syntax and properties are accessed using property syntax.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




More information about the use-livecode mailing list