[Xotcl] Re: XOTcl 0.83 questions (continued...)

uwe.zdun at uni-essen.de uwe.zdun at uni-essen.de
Fri Dec 8 12:57:35 CET 2000


Hi Zoran,

ZV> The main problem is the ORDER! What I need to
ZV> do is run a script against an initialized interpreter
ZV> and construct another script which will replicate all
ZV> XOTcl objects, classes etc,etc in an fresh interpreter.
ZV> So the *ORDER* of commands is crucial.

I've played around with ordering, when I've created the -- still very
incomplete -- script creation for agents. So what I've done now is to
extend the ScirptCreator component (in packages/script-creation) to
support several classes & objects with a method makeScriptForAll. It
then writes scripts with one possible order regarding the object &
class hierarchy.

It is still very incomplete ... but should already show how things
could function. It only handles procs and instprocs, but not:

-- adavanded features, like filters, mixins, etc. (for them ordering
   matters, too .. you cannot define a mixin without the class 
   being defined)
-- tcl namespaces 
-- indentation

I'll hope to extend & test it ASAP to support more functionalities,
but today I will not make it. Therefore, I send what I have so far.

It already handles another crucial issue besides ordering: it can
exclude certain objects & classes from re-creation. You surely do not
want the script creator itself or the predefined stuff (like Object
and Class)to be re-created.

--Uwe

Here's the example script:

###################################################################
# load the ScriptCreator
package require ScriptCreator
ScriptCreator s

# exclude everything defined so far
s excludedObjs [s getAllInstances Object]
puts "EXCLUDED [s excludedObjs]"

# set up some classes for testing

#
# some meta classes
#
Class Meta -superclass Class
Class Meta2 -superclass Meta
Class Meta3 -superclass Meta2
#
# some classes
#
Class X
Class Y
Meta Z
Meta2 A
Meta2 B
#
# some objs
#
X x
Object o
Y y1
Y y2
A a1
A a2



puts [s makeScriptForAll]

###################################################################


-- 
Uwe Zdun
Specification of Software Systems, University of Essen
Phone: +49 201 81 00 332, Fax: +49 201 81 00 398
zdun at xotcl.org, uwe.zdun at uni-essen.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScriptCreator.xotcl
Type: application/octet-stream
Size: 7502 bytes
Desc: not available
Url : http://alice.wu-wien.ac.at/pipermail/xotcl/attachments/20001208/869ef509/ScriptCreator.obj


More information about the Xotcl mailing list