What is LC's internal text format?

Ben Rubinstein benr_mc at cogapp.com
Tue Nov 20 13:24:58 EST 2018


This isn't about strongly typed variables though, but about when (correct) 
conversion is possible.

LC throws an error if you implicitly ask it to convert the wrong kind of 
string to a number - for example, add 45 to "horse". (Obviously multiplication 
is fine: the answer would be "45 horses".)

LC throws an error if you implicitly ask it convert the wrong kind of string 
or number to a colour: try setting the backcolor of a control to "horse".

LC throws an error if asked to convert a number, or the wrong kind of string, 
to a boolean: try setting the hilite of a button to 45.

In all these cases, LC knows it cannot do the right thing, so it throws an 
error to tell you so, rather than guessing, for example, what the truth value 
of "45" is.

I'm just suggesting that it cannot know how to correctly convert binary data 
into a string - so it should throw an error rather than possibly (probably?) 
do the wrong thing.


On 20/11/2018 17:55, Mark Wieder via use-livecode wrote:
> On 11/20/18 8:33 AM, Ben Rubinstein via use-livecode wrote:
> 
>> Would it not be better to refuse to make an assumption, i.e. require an 
>> explicit conversion?
> 
> While I'd love to have the option of strongly typed variables at the scripting 
> level, I know better than to expect that this will ever happen.
> 




More information about the use-livecode mailing list