Cool @schwarzbox! I'll try to make time to check it out.
do [ ... and
do read <file!> a couple places. The former is redundant, as the contents of the block will just be evaluated normally. Your "invisible constants" comment makes me think you hope to hide those vars, but that's not the case. For the latter, you can just do
@hiiamboris so without
face as argument we have to rebound it on our own?
l: layout [b: base on-down [print 'down]] b/actors/on-down: func [event] [print 'aaaaeee]
In the above case I had to bind body of the function to the
b? Or is there going to be some kind of reactors that does it for me?
selfin actor's body. Something tells me that because of that GC might be unable to reclaim entire virtual tree of faces.
self, as a keyword, exists as a backreference to the enclosing object, and can be instantiated only on object's creation (if I'm not mistaken). With your proposal you'll need something like
bind <body> object [self: <face>].
faceword gets automagically bound to (any given) face at runtime, during actor's invocation. With just
[event]you'll need to do that manually with actor's body, either ahead of time (provided that face already exists) or at runtime (but this is what Red already does for you, so why bother?).
body-of <object>returns a fresh block copy, so binding it instead won't work either.
faceargument for free, but that they have to use this
face/facetthing every time instead of just
facet, and this gets really ugly really fast.
on-change*limitation comes to mind as a valid explanation. Without
face/..part it probably won't work. Still, I'm not convinced.
Found a way to hack it:
>> system/view/VID/styles/style1: [ init: [attempt [ foreach w words-of face/actors [bind body-of select face/actors w face] ]] template: [type: 'base size: 100x100]] ] >> view [style1 on-created [probe type]] base
Surprisingly it even detects facet changes and redraws.
eventinside body will point to evaluation stack, and all other
facetwords will point to face. But then, if you wish to change actor after face is created, you'll need to do it manually. And how would you deal with global event handlers?