uliwitness / Stacksmith

An intuitive software erector kit targeted at people new to programming, but with enough potential to stay useful once they've learned, inspired by HyperCard.
http://stacksmith.org
131 stars 13 forks source link

Add "object descriptor" data type #88

Closed uliwitness closed 7 years ago

uliwitness commented 7 years ago

Right now we are only able to directly return an object. This means that you can't compare it, as you will always attempt to turn the object into a string (which usually gives its contents).

So, if we have a mainStack property and no windows are open, the mainStack should be "none" or empty. But if you try to compare if the mainStack is empty and there are windows open, you'd get the contents of that stack.

To make code like this work, we need an object descriptor data type that can be a reference to an object, but when read as a value will show up as 'stack "file:///Users/uli/TestStack.xstk"', so it compares unequal to empty. OTOH when it is asked for a property, it should forward that call to the object. Same probably when something is assigned to it.

uliwitness commented 7 years ago

Basically have this now in CScriptableObject, though it's a very simple form for now.