Brendan,
I agree with all of your points except the need for multiple contexts. I'd much rather see a smarter system than contexts. Using contexts to expose a large number of classes is a large pain in the rear, and it wouldn't get much better with multiple contexts (but the code would be more manageable). I've messed around with RbScript to a _great_ extent... Right before REALworld (literally, it was the night before) I began expirimenting with a system to transparently pass objects back and forth between Rb and the RbScript. It worked perfectly!

Basically it used my RbHacks stuff to introspect each class and generate wrappers for each class on the fly (and smartly caching stuff for performance). In the end, methods and properties were 100% seamless, with the exception of arrays. Arrays are a PITA because there's no way to get notified when things get appended - though with a decent enough preprocessor this could be worked around. Also, you can't create *new* objects from the script as is - you have to have a global method to return one (which wasn't a problem for my needs). It would be possible to get around this fairly easily however. My thought for a solution is under additions.

FancyRbScript API (from memory -- it's currently in a 1+ GB zip file backup): Event ShouldAllowMethod( class as ObjectClass, method as ObjectMethod ) as boolean Event ShouldAllowProperty( class as ObjectClass, property as ObjectProperty ) as boolean
Sub AddClass( class as ObjectClass )
Sub AddGlobalFunction( method as ObjectMethod )

Additions I thought about:
Sub AddGlobalProperty( property as ObjectProperty )
Sub AddConstructor( class as ObjectClass, constructor as ObjectMethod )

I've been using RbScript to a great degree in RbDocGen (to anyone interested in this: please email me! after the announcement on the NUG and the lack of interest I stopped working on it...) - we exposed the whole project tree (basically) to the template scripts. Also we used an RbScript to parse documentation tags out of the source code.

RbScript has amazing potential, but is severely limited by the lack of language features more than bugs, in my opinion. If we could get references to classes (not using hacks or undocumented things) they could add similar methods to the ones I used... Even if RS just added introspection and the ability to call methods found by introspection, all this could be done _legally_ and not require hacks.

-- Joe Ranieri


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to