Developer Annoyance #1
aturban at qwest.net
Fri Mar 17 03:35:53 EST 2006
Thanx for the alternate examples you provided. I addressed their
shortcomings in other posts in the thread, so I won't reiterate. :)
While I will continue to entertain other "solutions", the main thrust of
my initial post was to propose a new, clearer syntax for message
calling. One I think Rev could handle easily.
put calc(varA,varB) of btn "source" into localResult
send calc varA,varB to btn "source"
Clearly, everything between 'send' and 'to' is the message followed by it's arguments; very simple to parse. Why send appears to be limited to a single string argument (under the hood), is odd to me. Even if varA was a chunk expression (char 1 to 2), Rev is smart enough to know that you can't send a message to a chunk expression, ergo keep looking for an object reference when parsing.
I think if developers and casual coders could easily assemble complex messages, they would be more inclined to keep the behavior with the data, leading to greater reusability. I imagine I'm a voice in the wilderness here.
Jim Ault wrote:
> Ooops, I got the wrong idea from your use of value(merge... etc
> You can use the 'send' or 'call' commands to use a function outside the
> message hierarchy, even in another stack.
> As Andre has shown
> send "calc VarA, VarB" to btn "source"
> put the result into localResult
> on calc VarA, VarB
> ...do work here
> return theVal
> end calc
> insert the script of btn "source" into back
> --now the handler(s) are in the message hierarchy
> put calc(varA,varB) into localResult
> remove the script of btn "source" from back --now or later
> Jim Ault
> Las Vegas
> On 3/16/06 9:43 PM, "Arthur Urban" <aturban at qwest.net> wrote:
>> I think a new syntax needs to be made available for calling functions
>> outside the message hierarchy. The existing mechanism does not lend
>> itself to high readability or maintainability. Consider the following,
>> if you will:
>> put 1 into varA
>> put 2 into varB
>> put value( merge("calc([[varA]],[[varB]]))", btn "source" ) into
>> further, if I need to protect the integrity of the variable passed it
>> begins to look like this:
>> put "1,2,3" into varA
>> put 4 into varB
>> put value( merge("calc([[quote&varA"e]],[[varB]]))", btn "source"
>> ) into localResult
>> I'm not sure that this is the right direction for any language to be
>> headed. Please explain why we can't have the following syntax:
>> put calc(varA,varB) of btn "source" into localResult
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode