Lively Kernel canvas
ContextJS-SyntaxandSemanticExample32true
truetruetrue
SoftwareArchitectureGroup(HPI)2010-http://www.hpi.uni-potsdam.de/swa/14true
10000.02878914122158398Wikicontroltrue
Object.subclass("MyObject",{m:function(a){returna*3}})cop.create('LayerA')LayerA.refineClass(MyObject,{m:function(a){returncop.proceed(a)+4}})cop.create('LayerB')LayerB.refineClass(MyObject,{m:function(a){returncop.proceed(a*2)}})18
18
o=newMyObject()log(o.m(2))//->6//DynamicallyScopedLayerActivationwithLayers([LayerA],function(){log(o.m(2))//->10withLayers([LayerB],function(){log(o.m(2))//->16})})//GlobalLayerActivationenableLayer(LayerB)log(o.m(2))//->12withLayers([LayerA],function(){log(o.m(2))//->16});disableLayer(LayerB)181 6\r\r// Dynamically Scoped Layer Activation \rwithLayers([LayerA], function() {\r log(o.m(2)) // -> 10\r withLayers([LayerB], function() {\r log(o.m(2)) // -> 16\r }) \r})\r\r// Global Layer Activation\renableLayer(LayerB)\rlog(o.m(2)) // -> 12\r\rwithLayers([LayerA], function() {\r log(o.m(2)) // -> 16\r});\n\ndisableLayer(LayerB)\n\n\r"]]> 6\r\r// Dynamically Scoped Layer Activation \rwithLayers([LayerA], function() {\r log(o.m(2)) // -> 10\r withLayers([LayerB], function() {\r log(o.m(2)) // -> 16\r }) \r})\r\r// Global Layer Activation\renableLayer(LayerB)\rlog(o.m(2)) // -> 12\r\rwithLayers([LayerA], function() {\r log(o.m(2)) // -> 16\r});\n\ndisableLayer(LayerB)\n\n\r"]]>
null60