Browse Source

Use Axxord.

Herbert Vojčík 6 years ago
parent
commit
d44551bcea
13 changed files with 17 additions and 1479 deletions
  1. 1 1
      bower.json
  2. 0 1
      local.amd.json
  3. 0 414
      src/Alybaba-Tests.js
  4. 0 106
      src/Alybaba-Tests.st
  5. 0 97
      src/Alybaba.js
  6. 0 19
      src/Alybaba.st
  7. 1 645
      src/Axon.js
  8. 0 181
      src/Axon.st
  9. 7 7
      src/Trapped-Backend.js
  10. 3 3
      src/Trapped-Backend.st
  11. 3 3
      src/Trapped-Frontend.js
  12. 1 1
      src/Trapped-Frontend.st
  13. 1 1
      testing.js

+ 1 - 1
bower.json

@@ -31,7 +31,7 @@
   "dependencies": {
     "amber": "^0.19.1",
     "amber-compat-es2015": "^0.1.5",
-    "lyst": "^0.2.0",
+    "axxord0": "^0.1.0",
     "xontent": "^0.1.0"
   },
   "devDependencies": {

+ 0 - 1
local.amd.json

@@ -2,7 +2,6 @@
     "paths": {
         "trapped": "src",
         "axon": "src",
-        "alybaba": "src",
         "trapped-todo": "example-todo/src",
         "trapped-counter": "example-counter/src"
     }

+ 0 - 414
src/Alybaba-Tests.js

@@ -1,414 +0,0 @@
-define("alybaba/Alybaba-Tests", ["amber/boot", "amber_core/SUnit", "axon/Axon"], function($boot){"use strict";
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
-$core.addPackage('Alybaba-Tests');
-$core.packages["Alybaba-Tests"].innerEval = function (expr) { return eval(expr); };
-$core.packages["Alybaba-Tests"].transport = {"type":"amd","amdNamespace":"alybaba"};
-
-$core.addClass('PlainConsumeTransformTest', $globals.TestCase, [], 'Alybaba-Tests');
-$core.addMethod(
-$core.method({
-selector: "testModelTransformSentToAxon",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result,axon;
-function $TestSpyAxon(){return $globals.TestSpyAxon||(typeof TestSpyAxon=="undefined"?nil:TestSpyAxon)}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=$globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]);
-axon=$recv($TestSpyAxon())._new();
-$recv(axon)._registerIn_(model);
-$recv(model)._atLyst_transform_(["foo", (2)],(function(r){
-return "new";
-
-}));
-self._assert_equals_($recv(axon)._changedAspectLog(),[["foo", (2)]]);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testModelTransformSentToAxon",{model:model,result:result,axon:axon},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testModelTransformSentToAxon\x0a| model result axon |\x0aresult := nil.\x0amodel := #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0aaxon := TestSpyAxon new.\x0aaxon registerIn: model.\x0amodel atLyst: #(foo 2) transform: [:r | #new].\x0aself assert: axon changedAspectLog equals: #((foo 2))",
-referencedClasses: ["TestSpyAxon"],
-//>>excludeEnd("ide");
-messageSends: ["new", "registerIn:", "atLyst:transform:", "assert:equals:", "changedAspectLog"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testNontrivialModelGetsAppropriateValueForTransform",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=$globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (5)]], "baz"],"moo","zoo"]);
-$recv(model)._atLyst_transform_(["foo", (2)],(function(r){
-result=r;
-return result;
-
-}));
-self._assert_equals_([(1), [(2), (5)]],result);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForTransform",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testNontrivialModelGetsAppropriateValueForTransform\x0a| model result |\x0aresult := nil.\x0amodel := #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.\x0amodel atLyst: #(foo 2) transform: [:r | result := r].\x0aself assert: #(1 #(2 5)) equals: result",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["atLyst:transform:", "assert:equals:"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testNontrivialModelReturnsAppropriateValue",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=$globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]);
-$recv(model)._atLyst_consume_(["foo", (2)],(function(r){
-result=r;
-return result;
-
-}));
-self._assert_equals_([(1), [(2), (3)]],result);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testNontrivialModelReturnsAppropriateValue\x0a| model result |\x0aresult := nil.\x0amodel := #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel atLyst: #(foo 2) consume: [:r | result := r].\x0aself assert: #(1 #(2 3)) equals: result",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["atLyst:consume:", "assert:equals:"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testNontrivialModelTransformsAppropriateValue",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=$globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]);
-$recv(model)._atLyst_transform_(["foo", (2)],(function(r){
-return "new";
-
-}));
-$recv(model)._atLyst_consume_(["foo", (2)],(function(r){
-result=r;
-return result;
-
-}));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["atLyst:consume:"]=1;
-//>>excludeEnd("ctx");
-self._assert_equals_("new",result);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["assert:equals:"]=1;
-//>>excludeEnd("ctx");
-$recv(model)._atLyst_consume_([],(function(r){
-result=r;
-return result;
-
-}));
-self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",["bar", "new", "baz"],"moo","zoo"]),result);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelTransformsAppropriateValue",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testNontrivialModelTransformsAppropriateValue\x0a| model result |\x0aresult := nil.\x0amodel := #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel atLyst: #(foo 2) transform: [:r | #new].\x0amodel atLyst: #(foo 2) consume: [:r | result := r].\x0aself assert: #new equals: result.\x0amodel atLyst: #() consume: [:r | result := r].\x0aself assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["atLyst:transform:", "atLyst:consume:", "assert:equals:"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testRootModelCannotTransform",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=[(1), [(2), (3)]];
-self._should_raise_((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(model)._atLyst_transform_([],(function(r){
-return $globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
-
-}));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-}),$Error());
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testRootModelCannotTransform",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testRootModelCannotTransform\x0a| model result |\x0aresult := nil.\x0amodel := #(1 #(2 3)).\x0aself should: [ model atLyst: #() transform: [:r | #{'foo'->#(4 5 6)}] ] raise: Error",
-referencedClasses: ["Error"],
-//>>excludeEnd("ide");
-messageSends: ["should:raise:", "atLyst:transform:"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testRootModelReturnsDirectRoot",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=[(1), [(2), (4)]];
-$recv(model)._atLyst_consume_([],(function(r){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(r)._at_put_((2),nil);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)});
-//>>excludeEnd("ctx");
-}));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.sendIdx["atLyst:consume:"]=1;
-//>>excludeEnd("ctx");
-$recv(model)._atLyst_consume_([],(function(r){
-result=r;
-return result;
-
-}));
-self._assert_equals_([(1), nil],result);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDirectRoot",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testRootModelReturnsDirectRoot\x0a| model result |\x0aresult := nil.\x0amodel := #(1 #(2 4)).\x0amodel atLyst: #() consume: [:r | r at: 2 put: nil].\x0amodel atLyst: #() consume: [:r | result := r].\x0aself assert: #(1 nil) equals: result",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["atLyst:consume:", "at:put:", "assert:equals:"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testRootModelReturnsRoot",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=[(1), [(2), (3)]];
-$recv(model)._atLyst_consume_([],(function(r){
-result=r;
-return result;
-
-}));
-self._assert_equals_([(1), [(2), (3)]],result);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testRootModelReturnsRoot\x0a| model result |\x0aresult := nil.\x0amodel := #(1 #(2 3)).\x0amodel atLyst: #() consume: [:r | result := r].\x0aself assert: #(1 #(2 3)) equals: result",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["atLyst:consume:", "assert:equals:"]
-}),
-$globals.PlainConsumeTransformTest);
-
-$core.addMethod(
-$core.method({
-selector: "testRootTransformBlockIsNotRun",
-protocol: 'tests',
-fn: function (){
-var self=this;
-var model,result;
-function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-result=nil;
-model=[(2), [(1), (0)]];
-$recv((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(model)._atLyst_transform_([],(function(r){
-result=r;
-return result;
-
-}));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-}))._on_do_($Error(),(function(){
-
-}));
-self._assert_($recv(result)._isNil());
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"testRootTransformBlockIsNotRun",{model:model,result:result},$globals.PlainConsumeTransformTest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "testRootTransformBlockIsNotRun\x0a| model result |\x0aresult := nil.\x0amodel := #(2 #(1 0)).\x0a[model atLyst: #() transform: [:r | result := r]] on: Error do: [].\x0aself assert: result isNil",
-referencedClasses: ["Error"],
-//>>excludeEnd("ide");
-messageSends: ["on:do:", "atLyst:transform:", "assert:", "isNil"]
-}),
-$globals.PlainConsumeTransformTest);
-
-
-
-$core.addClass('TestSpyAxon', $globals.DumbAxon, ['changedAspectLog'], 'Alybaba-Tests');
-//>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.TestSpyAxon.comment="I am an axon that logs changed aspects. I am useful in tests.";
-//>>excludeEnd("ide");
-$core.addMethod(
-$core.method({
-selector: "changed:",
-protocol: 'action',
-fn: function (anAspect){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv(self["@changedAspectLog"])._add_(anAspect);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"changed:",{anAspect:anAspect},$globals.TestSpyAxon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anAspect"],
-source: "changed: anAspect\x0a\x09changedAspectLog add: anAspect",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["add:"]
-}),
-$globals.TestSpyAxon);
-
-$core.addMethod(
-$core.method({
-selector: "changedAspectLog",
-protocol: 'accessing',
-fn: function (){
-var self=this;
-var $1;
-$1=self["@changedAspectLog"];
-return $1;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "changedAspectLog\x0a\x09^ changedAspectLog",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.TestSpyAxon);
-
-$core.addMethod(
-$core.method({
-selector: "changedAspectLog:",
-protocol: 'accessing',
-fn: function (anObject){
-var self=this;
-self["@changedAspectLog"]=anObject;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anObject"],
-source: "changedAspectLog: anObject\x0a\x09changedAspectLog := anObject",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.TestSpyAxon);
-
-$core.addMethod(
-$core.method({
-selector: "initialize",
-protocol: 'initialization',
-fn: function (){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-(
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
-//>>excludeEnd("ctx");
-$globals.TestSpyAxon.superclass.fn.prototype._initialize.apply($recv(self), []));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = false;
-//>>excludeEnd("ctx");;
-self["@changedAspectLog"]=[];
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TestSpyAxon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x0a\x09changedAspectLog := #()",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["initialize"]
-}),
-$globals.TestSpyAxon);
-
-
-});

+ 0 - 106
src/Alybaba-Tests.st

@@ -1,106 +0,0 @@
-Smalltalk createPackage: 'Alybaba-Tests'!
-TestCase subclass: #PlainConsumeTransformTest
-	instanceVariableNames: ''
-	package: 'Alybaba-Tests'!
-
-!PlainConsumeTransformTest methodsFor: 'tests'!
-
-testModelTransformSentToAxon
-| model result axon |
-result := nil.
-model := #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.
-axon := TestSpyAxon new.
-axon registerIn: model.
-model atLyst: #(foo 2) transform: [:r | #new].
-self assert: axon changedAspectLog equals: #((foo 2))
-!
-
-testNontrivialModelGetsAppropriateValueForTransform
-| model result |
-result := nil.
-model := #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.
-model atLyst: #(foo 2) transform: [:r | result := r].
-self assert: #(1 #(2 5)) equals: result
-!
-
-testNontrivialModelReturnsAppropriateValue
-| model result |
-result := nil.
-model := #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.
-model atLyst: #(foo 2) consume: [:r | result := r].
-self assert: #(1 #(2 3)) equals: result
-!
-
-testNontrivialModelTransformsAppropriateValue
-| model result |
-result := nil.
-model := #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.
-model atLyst: #(foo 2) transform: [:r | #new].
-model atLyst: #(foo 2) consume: [:r | result := r].
-self assert: #new equals: result.
-model atLyst: #() consume: [:r | result := r].
-self assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result
-!
-
-testRootModelCannotTransform
-| model result |
-result := nil.
-model := #(1 #(2 3)).
-self should: [ model atLyst: #() transform: [:r | #{'foo'->#(4 5 6)}] ] raise: Error
-!
-
-testRootModelReturnsDirectRoot
-| model result |
-result := nil.
-model := #(1 #(2 4)).
-model atLyst: #() consume: [:r | r at: 2 put: nil].
-model atLyst: #() consume: [:r | result := r].
-self assert: #(1 nil) equals: result
-!
-
-testRootModelReturnsRoot
-| model result |
-result := nil.
-model := #(1 #(2 3)).
-model atLyst: #() consume: [:r | result := r].
-self assert: #(1 #(2 3)) equals: result
-!
-
-testRootTransformBlockIsNotRun
-| model result |
-result := nil.
-model := #(2 #(1 0)).
-[model atLyst: #() transform: [:r | result := r]] on: Error do: [].
-self assert: result isNil
-! !
-
-DumbAxon subclass: #TestSpyAxon
-	instanceVariableNames: 'changedAspectLog'
-	package: 'Alybaba-Tests'!
-!TestSpyAxon commentStamp!
-I am an axon that logs changed aspects. I am useful in tests.!
-
-!TestSpyAxon methodsFor: 'accessing'!
-
-changedAspectLog
-	^ changedAspectLog
-!
-
-changedAspectLog: anObject
-	changedAspectLog := anObject
-! !
-
-!TestSpyAxon methodsFor: 'action'!
-
-changed: anAspect
-	changedAspectLog add: anAspect
-! !
-
-!TestSpyAxon methodsFor: 'initialization'!
-
-initialize
-	super initialize.
-
-	changedAspectLog := #()
-! !
-

+ 0 - 97
src/Alybaba.js

@@ -1,97 +0,0 @@
-define(["amber/boot"
-//>>excludeStart("imports", pragmas.excludeImports);
-, "axon/Axon", "lyst/Lyst"
-//>>excludeEnd("imports");
-, "amber_core/Kernel-Objects"], function($boot
-//>>excludeStart("imports", pragmas.excludeImports);
-
-//>>excludeEnd("imports");
-){"use strict";
-if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
-if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
-var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
-if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
-$core.addPackage("Alybaba");
-$core.packages["Alybaba"].innerEval = function (expr) { return eval(expr); };
-$core.packages["Alybaba"].imports = ["axon/Axon", "lyst/Lyst"];
-$core.packages["Alybaba"].transport = {"type":"amd","amdNamespace":"alybaba"};
-$core.addMethod(
-$core.method({
-selector: "atLyst:consume:",
-protocol: "*Alybaba",
-fn: function (aCollection,aBlock){
-var self=this,$self=this;
-var value;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $early={};
-try {
-value=$self._atLyst_ifAbsent_(aCollection,(function(){
-throw $early=[self];
-
-}));
-return $recv(aBlock)._value_(value);
-}
-catch(e) {if(e===$early)return e[0]; throw e}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"atLyst:consume:",{aCollection:aCollection,aBlock:aBlock,value:value},$globals.Object)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aCollection", "aBlock"],
-source: "atLyst: aCollection consume: aBlock\x0a\x09| value |\x0a\x09value := self atLyst: aCollection ifAbsent: [ ^self ].\x0a\x09^ aBlock value: value",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["atLyst:ifAbsent:", "value:"]
-}),
-$globals.Object);
-
-$core.addMethod(
-$core.method({
-selector: "atLyst:transform:",
-protocol: "*Alybaba",
-fn: function (aCollection,aBlock){
-var self=this,$self=this;
-var value;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $1,$receiver;
-var $early={};
-try {
-$recv(aCollection)._last();
-value=$self._atLyst_ifAbsent_(aCollection,(function(){
-throw $early=[self];
-
-}));
-value=$recv(aBlock)._value_(value);
-value=$self._atLyst_ifAbsent_put_(aCollection,(function(){
-throw $early=[self];
-
-}),value);
-$1=$self._registeredAxon();
-if(($receiver = $1) == null || $receiver.a$nil){
-$1;
-} else {
-var axon;
-axon=$receiver;
-$recv(axon)._changed_(aCollection);
-}
-return self;
-}
-catch(e) {if(e===$early)return e[0]; throw e}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"atLyst:transform:",{aCollection:aCollection,aBlock:aBlock,value:value},$globals.Object)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aCollection", "aBlock"],
-source: "atLyst: aCollection transform: aBlock\x0a\x09| value |\x0a\x09aCollection last. \x22raise if empty\x22\x0a\x09value := self atLyst: aCollection ifAbsent: [ ^self ].\x0a\x09value := aBlock value: value.\x0a\x09value := self atLyst: aCollection ifAbsent: [ ^self ] put: value.\x0a\x09self registeredAxon ifNotNil: [:axon | axon changed: aCollection]",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["last", "atLyst:ifAbsent:", "value:", "atLyst:ifAbsent:put:", "ifNotNil:", "registeredAxon", "changed:"]
-}),
-$globals.Object);
-
-});

+ 0 - 19
src/Alybaba.st

@@ -1,19 +0,0 @@
-Smalltalk createPackage: 'Alybaba'!
-(Smalltalk packageAt: 'Alybaba') imports: {'axon/Axon'. 'lyst/Lyst'}!
-!Object methodsFor: '*Alybaba'!
-
-atLyst: aCollection consume: aBlock
-	| value |
-	value := self atLyst: aCollection ifAbsent: [ ^self ].
-	^ aBlock value: value
-!
-
-atLyst: aCollection transform: aBlock
-	| value |
-	aCollection last. "raise if empty"
-	value := self atLyst: aCollection ifAbsent: [ ^self ].
-	value := aBlock value: value.
-	value := self atLyst: aCollection ifAbsent: [ ^self ] put: value.
-	self registeredAxon ifNotNil: [:axon | axon changed: aCollection]
-! !
-

+ 1 - 645
src/Axon.js

@@ -1,4 +1,4 @@
-define(["amber/boot", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects"], function($boot){"use strict";
+define(["amber/boot", "amber_core/Kernel-Objects"], function($boot){"use strict";
 if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
 if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
 var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
@@ -7,626 +7,6 @@ $core.addPackage("Axon");
 $core.packages["Axon"].innerEval = function (expr) { return eval(expr); };
 $core.packages["Axon"].transport = {"type":"amd","amdNamespace":"axon"};
 
-$core.addClass("Axon", $globals.Object, ["factory"], "Axon");
-//>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.Axon.comment="I represent a pub-sub based on a key (called 'aspect').\x0aI manage aspect-block subscriptions (called 'interests') as well as run blocks of dirtied interests.\x0aThe interest objects are responsible of decision if the change of an aspect is relevant for them.\x0aInterest object must be subclasses of `AxonInterest`.\x0a\x0aMy subclasses must provide implementation for:\x0a\x0a - add:\x0a - do:\x0a - clean";
-//>>excludeEnd("ide");
-$core.addMethod(
-$core.method({
-selector: "addInterest:",
-protocol: "action",
-fn: function (anInterest){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $1;
-$recv(anInterest)._flag();
-$1=$recv(anInterest)._yourself();
-$self._add_($1);
-$self._dirty_(true);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"addInterest:",{anInterest:anInterest},$globals.Axon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anInterest"],
-source: "addInterest: anInterest\x0a\x09self\x0a\x09\x09add: (anInterest flag; yourself);\x0a\x09\x09dirty: true",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["add:", "flag", "yourself", "dirty:"]
-}),
-$globals.Axon);
-
-$core.addMethod(
-$core.method({
-selector: "changed:",
-protocol: "action",
-fn: function (anAspect){
-var self=this,$self=this;
-var needsToRun;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $1;
-needsToRun=false;
-$self._do_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-$1=$recv(each)._accepts_(anAspect);
-if($core.assert($1)){
-$recv(each)._flag();
-needsToRun=true;
-return needsToRun;
-}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
-//>>excludeEnd("ctx");
-}));
-$self._dirty_(needsToRun);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"changed:",{anAspect:anAspect,needsToRun:needsToRun},$globals.Axon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anAspect"],
-source: "changed: anAspect\x0a\x09| needsToRun |\x0a\x09needsToRun := false.\x0a\x09self do: [ :each |\x0a\x09\x09(each accepts: anAspect) ifTrue: [\x0a\x09\x09\x09each flag.\x0a\x09\x09\x09needsToRun := true ]].\x0a\x09self dirty: needsToRun",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["do:", "ifTrue:", "accepts:", "flag", "dirty:"]
-}),
-$globals.Axon);
-
-$core.addMethod(
-$core.method({
-selector: "changedAll",
-protocol: "action",
-fn: function (){
-var self=this,$self=this;
-var needsToRun;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-needsToRun=false;
-$self._do_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-$recv(each)._flag();
-needsToRun=true;
-return needsToRun;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
-//>>excludeEnd("ctx");
-}));
-$self._dirty_(needsToRun);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"changedAll",{needsToRun:needsToRun},$globals.Axon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "changedAll\x0a\x09| needsToRun |\x0a\x09needsToRun := false.\x0a\x09self do: [ :each |\x0a\x09\x09each flag.\x0a\x09\x09needsToRun := true ].\x0a\x09self dirty: needsToRun",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["do:", "flag", "dirty:"]
-}),
-$globals.Axon);
-
-$core.addMethod(
-$core.method({
-selector: "dirty:",
-protocol: "action",
-fn: function (aBoolean){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-if($core.assert(aBoolean)){
-$recv((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $self._run();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
-//>>excludeEnd("ctx");
-}))._fork();
-}
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},$globals.Axon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aBoolean"],
-source: "dirty: aBoolean\x0a\x09aBoolean ifTrue: [[ self run ] fork]",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["ifTrue:", "fork", "run"]
-}),
-$globals.Axon);
-
-$core.addMethod(
-$core.method({
-selector: "registerIn:",
-protocol: "injecting",
-fn: function (anObject){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-anObject.$axon$=self;
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"registerIn:",{anObject:anObject},$globals.Axon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anObject"],
-source: "registerIn: anObject\x0a<inlineJS: 'anObject.$axon$=self'>",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.Axon);
-
-$core.addMethod(
-$core.method({
-selector: "run",
-protocol: "action",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-var $1,$2,$3;
-$recv((function(){
-var needsClean;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-needsClean=false;
-needsClean;
-$self._do_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx3) {
-//>>excludeEnd("ctx");
-$1=$recv(each)._isFlagged();
-if($core.assert($1)){
-$recv(each)._run();
-}
-$2=$recv(each)._isEnabled();
-if(!$core.assert($2)){
-needsClean=true;
-return needsClean;
-}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
-//>>excludeEnd("ctx");
-}));
-$3=needsClean;
-if($core.assert($3)){
-return $self._clean();
-}
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({needsClean:needsClean},$ctx1,1)});
-//>>excludeEnd("ctx");
-}))._on_do_($globals.Error,(function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $self._dirty_(true);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
-//>>excludeEnd("ctx");
-}));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"run",{},$globals.Axon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "run\x0a\x09[\x0a\x09\x09| needsClean |\x0a\x09    needsClean := false.\x0a\x09\x09self do: [ :each |\x0a\x09\x09\x09each isFlagged ifTrue: [ each run ].\x0a\x09        each isEnabled ifFalse: [ needsClean := true ]\x0a\x09\x09].\x0a    \x09needsClean ifTrue: [ self clean ]\x0a\x09] on: Error do: [ self dirty: true ]",
-referencedClasses: ["Error"],
-//>>excludeEnd("ide");
-messageSends: ["on:do:", "do:", "ifTrue:", "isFlagged", "run", "ifFalse:", "isEnabled", "clean", "dirty:"]
-}),
-$globals.Axon);
-
-
-
-$core.addClass("DumbAxon", $globals.Axon, [], "Axon");
-//>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.DumbAxon.comment="I am an axon that does nothing.";
-//>>excludeEnd("ide");
-$core.addMethod(
-$core.method({
-selector: "add:",
-protocol: "as yet unclassified",
-fn: function (anInterest){
-var self=this,$self=this;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anInterest"],
-source: "add: anInterest\x0a\x09\x22pass\x22",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.DumbAxon);
-
-$core.addMethod(
-$core.method({
-selector: "clean",
-protocol: "as yet unclassified",
-fn: function (){
-var self=this,$self=this;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "clean\x0a\x09\x22pass\x22",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.DumbAxon);
-
-$core.addMethod(
-$core.method({
-selector: "do:",
-protocol: "as yet unclassified",
-fn: function (aBlock){
-var self=this,$self=this;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aBlock"],
-source: "do: aBlock\x0a\x09\x22pass\x22",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.DumbAxon);
-
-
-
-$core.addClass("SimpleAxon", $globals.Axon, ["queue"], "Axon");
-$core.addMethod(
-$core.method({
-selector: "add:",
-protocol: "accessing",
-fn: function (aSubscription){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv($self["@queue"])._add_(aSubscription);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},$globals.SimpleAxon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aSubscription"],
-source: "add: aSubscription\x0a\x09queue add: aSubscription.",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["add:"]
-}),
-$globals.SimpleAxon);
-
-$core.addMethod(
-$core.method({
-selector: "clean",
-protocol: "bookkeeping",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$self["@queue"]=$recv($self["@queue"])._select_((function(each){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-return $recv(each)._isEnabled();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
-//>>excludeEnd("ctx");
-}));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"clean",{},$globals.SimpleAxon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "clean\x0a\x09queue := queue select: [ :each | each isEnabled ]",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["select:", "isEnabled"]
-}),
-$globals.SimpleAxon);
-
-$core.addMethod(
-$core.method({
-selector: "do:",
-protocol: "enumeration",
-fn: function (aBlock){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv($self["@queue"])._do_(aBlock);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},$globals.SimpleAxon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aBlock"],
-source: "do: aBlock\x0a\x09queue do: aBlock",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["do:"]
-}),
-$globals.SimpleAxon);
-
-$core.addMethod(
-$core.method({
-selector: "initialize",
-protocol: "initialization",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-(
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true,
-//>>excludeEnd("ctx");
-($globals.SimpleAxon.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = false;
-//>>excludeEnd("ctx");;
-$self["@queue"]=$recv($globals.OrderedCollection)._new();
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.SimpleAxon)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "initialize\x0a    super initialize.\x0a\x09queue := OrderedCollection new",
-referencedClasses: ["OrderedCollection"],
-//>>excludeEnd("ide");
-messageSends: ["initialize", "new"]
-}),
-$globals.SimpleAxon);
-
-
-
-$core.addClass("AxonInterest", $globals.Object, ["aspect", "actionBlock", "flagged"], "Axon");
-$core.addMethod(
-$core.method({
-selector: "accepts:",
-protocol: "testing",
-fn: function (anAspect){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$self._subclassResponsibility();
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accepts:",{anAspect:anAspect},$globals.AxonInterest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anAspect"],
-source: "accepts: anAspect\x0a    \x22Should return true if change for anAspect is relevant for this AxonInterest\x22\x0a    self subclassResponsibility",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["subclassResponsibility"]
-}),
-$globals.AxonInterest);
-
-$core.addMethod(
-$core.method({
-selector: "aspect:block:",
-protocol: "accessing",
-fn: function (anAspect,aBlock){
-var self=this,$self=this;
-$self["@aspect"]=anAspect;
-$self["@actionBlock"]=aBlock;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anAspect", "aBlock"],
-source: "aspect: anAspect block: aBlock\x0a\x09aspect := anAspect.\x0a    actionBlock := aBlock",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.AxonInterest);
-
-$core.addMethod(
-$core.method({
-selector: "flag",
-protocol: "accessing",
-fn: function (){
-var self=this,$self=this;
-$self["@flagged"]=true;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "flag\x0a\x09flagged := true",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.AxonInterest);
-
-$core.addMethod(
-$core.method({
-selector: "initialize",
-protocol: "initialization",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-(
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true,
-//>>excludeEnd("ctx");
-($globals.AxonInterest.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = false;
-//>>excludeEnd("ctx");;
-$self["@aspect"]=nil;
-$self["@actionBlock"]=nil;
-$self["@flagged"]=false;
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.AxonInterest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a    aspect := nil.\x0a    actionBlock := nil.\x0a    flagged := false.",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["initialize"]
-}),
-$globals.AxonInterest);
-
-$core.addMethod(
-$core.method({
-selector: "isEnabled",
-protocol: "testing",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-return $recv($self["@actionBlock"])._notNil();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"isEnabled",{},$globals.AxonInterest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "isEnabled\x0a\x09^actionBlock notNil",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["notNil"]
-}),
-$globals.AxonInterest);
-
-$core.addMethod(
-$core.method({
-selector: "isFlagged",
-protocol: "testing",
-fn: function (){
-var self=this,$self=this;
-return $self["@flagged"];
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "isFlagged\x0a\x09^flagged",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.AxonInterest);
-
-$core.addMethod(
-$core.method({
-selector: "run",
-protocol: "action",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-$recv((function(){
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx2) {
-//>>excludeEnd("ctx");
-$self["@flagged"]=false;
-$self["@flagged"];
-return $recv($self["@actionBlock"])._value();
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
-//>>excludeEnd("ctx");
-}))._on_do_($globals.AxonOff,(function(){
-$self["@actionBlock"]=nil;
-return $self["@actionBlock"];
-
-}));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"run",{},$globals.AxonInterest)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "run\x0a\x09[ flagged := false. actionBlock value ]\x0a    on: AxonOff do: [ actionBlock := nil ]",
-referencedClasses: ["AxonOff"],
-//>>excludeEnd("ide");
-messageSends: ["on:do:", "value"]
-}),
-$globals.AxonInterest);
-
-
-
-$core.addClass("InterestedInEqual", $globals.AxonInterest, [], "Axon");
-$core.addMethod(
-$core.method({
-selector: "accepts:",
-protocol: "testing",
-fn: function (anAspect){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-return $recv(anAspect).__eq($self["@aspect"]);
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"accepts:",{anAspect:anAspect},$globals.InterestedInEqual)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["anAspect"],
-source: "accepts: anAspect\x0a    ^ anAspect = aspect",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["="]
-}),
-$globals.InterestedInEqual);
-
-
-
-$core.addClass("AxonOff", $globals.Error, [], "Axon");
-//>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.AxonOff.comment="Signal me from the subscription block to unsubscribe it.";
-//>>excludeEnd("ide");
-
-
 $core.addClass("AxonizedObject", $globals.Object, ["axon"], "Axon");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.AxonizedObject.comment="I am base class for object using Axon changed:\x0afor event / change logistics,\x0a\x0aSet Axon instance with `axon:` and then use\x0a`self changed: anAspect` to trigger axon's `changed:`.";
@@ -693,28 +73,4 @@ messageSends: ["changed:", "axon"]
 $globals.AxonizedObject);
 
 
-$core.addMethod(
-$core.method({
-selector: "registeredAxon",
-protocol: "*Axon",
-fn: function (){
-var self=this,$self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-return self.$axon$;
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"registeredAxon",{},$globals.Object)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "registeredAxon\x0a<inlineJS: 'return self.$axon$'>",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.Object);
-
 });

+ 0 - 181
src/Axon.st

@@ -1,179 +1,4 @@
 Smalltalk createPackage: 'Axon'!
-Object subclass: #Axon
-	instanceVariableNames: 'factory'
-	package: 'Axon'!
-!Axon commentStamp!
-I represent a pub-sub based on a key (called 'aspect').
-I manage aspect-block subscriptions (called 'interests') as well as run blocks of dirtied interests.
-The interest objects are responsible of decision if the change of an aspect is relevant for them.
-Interest object must be subclasses of `AxonInterest`.
-
-My subclasses must provide implementation for:
-
- - add:
- - do:
- - clean!
-
-!Axon methodsFor: 'action'!
-
-addInterest: anInterest
-	self
-		add: (anInterest flag; yourself);
-		dirty: true
-!
-
-changed: anAspect
-	| needsToRun |
-	needsToRun := false.
-	self do: [ :each |
-		(each accepts: anAspect) ifTrue: [
-			each flag.
-			needsToRun := true ]].
-	self dirty: needsToRun
-!
-
-changedAll
-	| needsToRun |
-	needsToRun := false.
-	self do: [ :each |
-		each flag.
-		needsToRun := true ].
-	self dirty: needsToRun
-!
-
-dirty: aBoolean
-	aBoolean ifTrue: [[ self run ] fork]
-!
-
-run
-	[
-		| needsClean |
-	    needsClean := false.
-		self do: [ :each |
-			each isFlagged ifTrue: [ each run ].
-	        each isEnabled ifFalse: [ needsClean := true ]
-		].
-    	needsClean ifTrue: [ self clean ]
-	] on: Error do: [ self dirty: true ]
-! !
-
-!Axon methodsFor: 'injecting'!
-
-registerIn: anObject
-<inlineJS: 'anObject.$axon$=self'>
-! !
-
-Axon subclass: #DumbAxon
-	instanceVariableNames: ''
-	package: 'Axon'!
-!DumbAxon commentStamp!
-I am an axon that does nothing.!
-
-!DumbAxon methodsFor: 'as yet unclassified'!
-
-add: anInterest
-	"pass"
-!
-
-clean
-	"pass"
-!
-
-do: aBlock
-	"pass"
-! !
-
-Axon subclass: #SimpleAxon
-	instanceVariableNames: 'queue'
-	package: 'Axon'!
-
-!SimpleAxon methodsFor: 'accessing'!
-
-add: aSubscription
-	queue add: aSubscription.
-! !
-
-!SimpleAxon methodsFor: 'bookkeeping'!
-
-clean
-	queue := queue select: [ :each | each isEnabled ]
-! !
-
-!SimpleAxon methodsFor: 'enumeration'!
-
-do: aBlock
-	queue do: aBlock
-! !
-
-!SimpleAxon methodsFor: 'initialization'!
-
-initialize
-    super initialize.
-	queue := OrderedCollection new
-! !
-
-Object subclass: #AxonInterest
-	instanceVariableNames: 'aspect actionBlock flagged'
-	package: 'Axon'!
-
-!AxonInterest methodsFor: 'accessing'!
-
-aspect: anAspect block: aBlock
-	aspect := anAspect.
-    actionBlock := aBlock
-!
-
-flag
-	flagged := true
-! !
-
-!AxonInterest methodsFor: 'action'!
-
-run
-	[ flagged := false. actionBlock value ]
-    on: AxonOff do: [ actionBlock := nil ]
-! !
-
-!AxonInterest methodsFor: 'initialization'!
-
-initialize
-	super initialize.
-    aspect := nil.
-    actionBlock := nil.
-    flagged := false.
-! !
-
-!AxonInterest methodsFor: 'testing'!
-
-accepts: anAspect
-    "Should return true if change for anAspect is relevant for this AxonInterest"
-    self subclassResponsibility
-!
-
-isEnabled
-	^actionBlock notNil
-!
-
-isFlagged
-	^flagged
-! !
-
-AxonInterest subclass: #InterestedInEqual
-	instanceVariableNames: ''
-	package: 'Axon'!
-
-!InterestedInEqual methodsFor: 'testing'!
-
-accepts: anAspect
-    ^ anAspect = aspect
-! !
-
-Error subclass: #AxonOff
-	instanceVariableNames: ''
-	package: 'Axon'!
-!AxonOff commentStamp!
-Signal me from the subscription block to unsubscribe it.!
-
 Object subclass: #AxonizedObject
 	instanceVariableNames: 'axon'
 	package: 'Axon'!
@@ -200,9 +25,3 @@ changed: anAspect
 	self axon changed: anAspect
 ! !
 
-!Object methodsFor: '*Axon'!
-
-registeredAxon
-<inlineJS: 'return self.$axon$'>
-! !
-

+ 7 - 7
src/Trapped-Backend.js

@@ -1,8 +1,8 @@
 define(["amber/boot"
 //>>excludeStart("imports", pragmas.excludeImports);
-, "alybaba/Alybaba", "lyst/Lyst"
+, "axxord/Axxord"
 //>>excludeEnd("imports");
-, "amber_core/Kernel-Collections", "amber_core/Kernel-Objects", "axon/Axon"], function($boot
+, "amber_core/Kernel-Collections", "amber_core/Kernel-Objects", "axon/Axon", "axxord/Axxord"], function($boot
 //>>excludeStart("imports", pragmas.excludeImports);
 
 //>>excludeEnd("imports");
@@ -13,7 +13,7 @@ var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.as
 if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
 $core.addPackage("Trapped-Backend");
 $core.packages["Trapped-Backend"].innerEval = function (expr) { return eval(expr); };
-$core.packages["Trapped-Backend"].imports = ["alybaba/Alybaba", "lyst/Lyst"];
+$core.packages["Trapped-Backend"].imports = ["axxord/Axxord"];
 $core.packages["Trapped-Backend"].transport = {"type":"amd","amdNamespace":"trapped"};
 
 $core.addClass("EavModel", $globals.Object, ["getBlock", "putBlock"], "Trapped-Backend");
@@ -826,7 +826,7 @@ $recv(model)._getBlock_((function(anObject){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv(anObject)._atLyst_ifAbsent_(self,(function(){
+return $recv(anObject)._atAxes_ifAbsent_(self,(function(){
 return nil;
 
 }));
@@ -840,7 +840,7 @@ $recv(model)._putBlock_((function(anObject,value){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv(anObject)._atLyst_ifAbsent_put_(self,(function(){
+return $recv(anObject)._atAxes_ifAbsent_put_(self,(function(){
 return nil;
 
 }),value);
@@ -856,10 +856,10 @@ return model;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "asEavModel\x0a    | model |\x0a    model := EavModel new.\x0a    model getBlock: [ :anObject | anObject atLyst: self ifAbsent: [ nil ] ].\x0a    self isEmpty ifFalse: [\x0a        model putBlock: [ :anObject :value | anObject atLyst: self ifAbsent: [ nil ] put: value ]].\x0a    ^model",
+source: "asEavModel\x0a    | model |\x0a    model := EavModel new.\x0a    model getBlock: [ :anObject | anObject atAxes: self ifAbsent: [ nil ] ].\x0a    self isEmpty ifFalse: [\x0a        model putBlock: [ :anObject :value | anObject atAxes: self ifAbsent: [ nil ] put: value ]].\x0a    ^model",
 referencedClasses: ["EavModel"],
 //>>excludeEnd("ide");
-messageSends: ["new", "getBlock:", "atLyst:ifAbsent:", "ifFalse:", "isEmpty", "putBlock:", "atLyst:ifAbsent:put:"]
+messageSends: ["new", "getBlock:", "atAxes:ifAbsent:", "ifFalse:", "isEmpty", "putBlock:", "atAxes:ifAbsent:put:"]
 }),
 $globals.SequenceableCollection);
 

+ 3 - 3
src/Trapped-Backend.st

@@ -1,5 +1,5 @@
 Smalltalk createPackage: 'Trapped-Backend'!
-(Smalltalk packageAt: 'Trapped-Backend') imports: {'alybaba/Alybaba'. 'lyst/Lyst'}!
+(Smalltalk packageAt: 'Trapped-Backend') imports: {'axxord/Axxord'}!
 Object subclass: #EavModel
 	instanceVariableNames: 'getBlock putBlock'
 	package: 'Trapped-Backend'!
@@ -243,9 +243,9 @@ read: path do: aBlock
 asEavModel
     | model |
     model := EavModel new.
-    model getBlock: [ :anObject | anObject atLyst: self ifAbsent: [ nil ] ].
+    model getBlock: [ :anObject | anObject atAxes: self ifAbsent: [ nil ] ].
     self isEmpty ifFalse: [
-        model putBlock: [ :anObject :value | anObject atLyst: self ifAbsent: [ nil ] put: value ]].
+        model putBlock: [ :anObject :value | anObject atAxes: self ifAbsent: [ nil ] put: value ]].
     ^model
 ! !
 

+ 3 - 3
src/Trapped-Frontend.js

@@ -1357,7 +1357,7 @@ return $recv($recv(rule)._tokenize_(":"))._collect_((function(message){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return $recv($globals.Lyst)._parse_(message);
+return $recv($globals.Axes)._parse_(message);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({message:message},$ctx2,2)});
 //>>excludeEnd("ctx");
@@ -1376,8 +1376,8 @@ return $1;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aString"],
-source: "parse: aString\x0a\x09^ (aString tokenize: '.') collect: [ :rule |\x0a\x09\x09(rule tokenize: ':') collect: [ :message |\x0a\x09\x09\x09Lyst parse: message ] ]",
-referencedClasses: ["Lyst"],
+source: "parse: aString\x0a\x09^ (aString tokenize: '.') collect: [ :rule |\x0a\x09\x09(rule tokenize: ':') collect: [ :message |\x0a\x09\x09\x09Axes parse: message ] ]",
+referencedClasses: ["Axes"],
 //>>excludeEnd("ide");
 messageSends: ["collect:", "tokenize:", "parse:"]
 }),

+ 1 - 1
src/Trapped-Frontend.st

@@ -354,7 +354,7 @@ injectToElement: anElement
 parse: aString
 	^ (aString tokenize: '.') collect: [ :rule |
 		(rule tokenize: ':') collect: [ :message |
-			Lyst parse: message ] ]
+			Axes parse: message ] ]
 ! !
 
 !Trapped class methodsFor: 'private'!

+ 1 - 1
testing.js

@@ -2,7 +2,7 @@ define([
     './deploy',
     'amber_core/SUnit',
     // --- packages used only during automated testing begin here ---
-    'alybaba/Alybaba-Tests',
+    'axxord/Axxord-Tests',
     'trapped/Trapped-Tests',
     // --- packages used only during automated testing end here ---
 ], function (amber) {