The paradigm of containers and self-referenced names

Dar Scott dsc at swcp.com
Thu Mar 24 16:31:52 EST 2005


On Mar 24, 2005, at 2:10 PM, Ken Ray wrote:

> And I *still* think that allowing for unquoted string literals is a bad
> idea. Even though every xTalk language has allowed for it, it is so 
> prone to
> problems that if this small feature of xTalk were gone, I wouldn't 
> miss it.
> But in reality I don't miss it anyway, since I don't use unquoted 
> string
> literals myself. It's more for helping others who have mistakenly done
> things like:
>
>  put "apple" into tFruit
>  put theFruit into theSelectedFruit
>
> and wondering why "theSelectedFruit" holds the string "theFruit"
> (personally, I think it should hold an empty string).

One of the compromises I mentioned was making the initial value of a 
container its name and drop the unquoted literals.  Most traditional 
scripts will work.  Some folks would say, "Oh, I thought that was how 
it worked."

In that case the above bug would still use the value "theFruit" and not 
empty.  That might provide a clue in debugging, but might also provide 
more info than you wanted exposed in the field.  If some field ended up 
with "md5HashBase21" or "nina_dos" mixed in, the user might think hmmm.

If we add to that, that the initial value is empty if declared then 
your style would not have to change.

Dar

-- 
**********************************************
     DSC (Dar Scott Consulting & Dar's Lab)
     http://www.swcp.com/dsc/
     Programming Services and Software
**********************************************



More information about the use-livecode mailing list