Split Helios-Core into Helios-Core and Helios-Environments
This commit is contained in:
parent
2f77965e17
commit
d57aff1353
|
@ -14,7 +14,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<script type='text/javascript'> loadAmber({packages: ['Spaces', 'Helios-Core', 'Helios-Commands', 'Helios-Layout','Helios-KeyBindings', 'Helios-Browser', 'Helios-Workspace', 'Helios-Inspector', 'Helios-Announcements']}) </script>
|
||||
<script type='text/javascript'> loadAmber({packages: ['Spaces', 'Helios-Core', 'Helios-Environments', 'Helios-Commands', 'Helios-Layout','Helios-KeyBindings', 'Helios-Browser', 'Helios-Workspace', 'Helios-Inspector', 'Helios-Announcements']}) </script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,135 +1,4 @@
|
|||
smalltalk.addPackage('Helios-Core', {});
|
||||
smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1, $2;
|
||||
var $early = {};
|
||||
try {
|
||||
var compiler;
|
||||
compiler = smalltalk.send(smalltalk.Compiler || Compiler, "_new", []);
|
||||
smalltalk.send(function () {return smalltalk.send(compiler, "_parseExpression_", [someCode]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {$1 = smalltalk.send(window, "_alert_", [smalltalk.send(ex, "_messageText", [])]);throw $early = [$1];}]);
|
||||
$2 = smalltalk.send(smalltalk.send(smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compile_forClass_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [someCode]), "__comma", ["] value"]), smalltalk.DoIt || DoIt])]), "_fn", []), "_applyTo_arguments_", [aReceiver, []]);
|
||||
return $2;
|
||||
} catch (e) {
|
||||
if (e === $early) {
|
||||
return e[0];
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packages", []);
|
||||
return $1;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
smalltalk.send(self, "_notYetImplemented", []);
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_doesNotUnderstand_",
|
||||
smalltalk.method({
|
||||
selector: "doesNotUnderstand:",
|
||||
fn: function (aMessage) {
|
||||
var self = this;
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_inspectOn_",
|
||||
smalltalk.method({
|
||||
selector: "inspectOn:",
|
||||
fn: function (anInspector) {
|
||||
var self = this;
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_printString",
|
||||
smalltalk.method({
|
||||
selector: "printString",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return "this is a remote object";
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLSourceArea', smalltalk.Widget, ['editor', 'textarea', 'div', 'receiver', 'onDoIt'], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_clear",
|
||||
|
|
|
@ -1,182 +1,4 @@
|
|||
smalltalk.addPackage('Helios-Core', {});
|
||||
smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Core');
|
||||
smalltalk.HLEnvironment.comment="Abstract class defining common behavior for local and remote environments"
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
category: 'actions',
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
},
|
||||
args: ["someCode", "aReceiver"],
|
||||
source: "eval: someCode on: aReceiver\x0a\x0a\x09^ self subclassResponsibility",
|
||||
messageSends: ["subclassResponsibility"],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
category: 'accessing',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
},
|
||||
args: [],
|
||||
source: "packages\x0a\x0a\x09^ self subclassResponsibility",
|
||||
messageSends: ["subclassResponsibility"],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
category: 'actions',
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1, $2;
|
||||
var $early = {};
|
||||
try {
|
||||
var compiler;
|
||||
compiler = smalltalk.send(smalltalk.Compiler || Compiler, "_new", []);
|
||||
smalltalk.send(function () {return smalltalk.send(compiler, "_parseExpression_", [someCode]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {$1 = smalltalk.send(window, "_alert_", [smalltalk.send(ex, "_messageText", [])]);throw $early = [$1];}]);
|
||||
$2 = smalltalk.send(smalltalk.send(smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compile_forClass_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [someCode]), "__comma", ["] value"]), smalltalk.DoIt || DoIt])]), "_fn", []), "_applyTo_arguments_", [aReceiver, []]);
|
||||
return $2;
|
||||
} catch (e) {
|
||||
if (e === $early) {
|
||||
return e[0];
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
args: ["someCode", "aReceiver"],
|
||||
source: "eval: someCode on: aReceiver\x0a\x09| compiler |\x0a\x09compiler := Compiler new.\x0a\x09[compiler parseExpression: someCode] on: Error do: [:ex |\x0a\x09\x09^window alert: ex messageText].\x0a\x09^(compiler eval: (compiler compile: 'doIt ^[', someCode, '] value' forClass: DoIt)) fn applyTo: aReceiver arguments: #()",
|
||||
messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "applyTo:arguments:", "fn", "eval:", "compile:forClass:", ","],
|
||||
referencedClasses: ["Compiler", "Error", "DoIt"]
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
category: 'accessing',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packages", []);
|
||||
return $1;
|
||||
},
|
||||
args: [],
|
||||
source: "packages\x0a\x0a\x09^ Smalltalk current packages",
|
||||
messageSends: ["packages", "current"],
|
||||
referencedClasses: ["Smalltalk"]
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
category: 'actions',
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
smalltalk.send(self, "_notYetImplemented", []);
|
||||
return self;
|
||||
},
|
||||
args: ["someCode", "aReceiver"],
|
||||
source: "eval: someCode on: aReceiver\x0a\x0a\x09\x22Note for future self and friends:\x0a whatever way this compilation happens on the other side, \x0a it should return a proxy to the remote resulting object\x22\x0a \x0a self notYetImplemented",
|
||||
messageSends: ["notYetImplemented"],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
category: 'accessing',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return self;
|
||||
},
|
||||
args: [],
|
||||
source: "packages\x0a\x09\x22Answer the remote environment's packages\x22\x0a \x0a\x09\x22to-do\x22\x0a \x0a \x22Note for future self and friends:\x0a the problem with remote stuff is that the answers shouldn't be expected to be\x0a received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here\x22",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Core');
|
||||
smalltalk.HLRemoteObject.comment="This is a local proxy to a remote object.\x0aTipically useful for evaluating and inspecting and interacting with instances of a remote VM.\x0a"
|
||||
smalltalk.addMethod(
|
||||
"_doesNotUnderstand_",
|
||||
smalltalk.method({
|
||||
selector: "doesNotUnderstand:",
|
||||
category: 'actions',
|
||||
fn: function (aMessage) {
|
||||
var self = this;
|
||||
return self;
|
||||
},
|
||||
args: ["aMessage"],
|
||||
source: "doesNotUnderstand: aMessage\x0a\x0a\x09\x22to-do\x0a\x0a\x09aham, blah blah\x0a\x0a\x09super doesNotUnderstand: aMessage\x22",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_inspectOn_",
|
||||
smalltalk.method({
|
||||
selector: "inspectOn:",
|
||||
category: 'actions',
|
||||
fn: function (anInspector) {
|
||||
var self = this;
|
||||
return self;
|
||||
},
|
||||
args: ["anInspector"],
|
||||
source: "inspectOn: anInspector\x0a\x0a\x09\x22to-do\x22\x0a\x0a\x09\x22this is a source of so much fun...\x22\x0a",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_printString",
|
||||
smalltalk.method({
|
||||
selector: "printString",
|
||||
category: 'actions',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return "this is a remote object";
|
||||
},
|
||||
args: [],
|
||||
source: "printString\x0a\x09^ 'this is a remote object'",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLSourceArea', smalltalk.Widget, ['editor', 'textarea', 'div', 'receiver', 'onDoIt'], 'Helios-Core');
|
||||
smalltalk.addMethod(
|
||||
"_clear",
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
smalltalk.addPackage('Helios-Environments', {});
|
||||
smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Environments');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1, $2;
|
||||
var $early = {};
|
||||
try {
|
||||
var compiler;
|
||||
compiler = smalltalk.send(smalltalk.Compiler || Compiler, "_new", []);
|
||||
smalltalk.send(function () {return smalltalk.send(compiler, "_parseExpression_", [someCode]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {$1 = smalltalk.send(window, "_alert_", [smalltalk.send(ex, "_messageText", [])]);throw $early = [$1];}]);
|
||||
$2 = smalltalk.send(smalltalk.send(smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compile_forClass_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [someCode]), "__comma", ["] value"]), smalltalk.DoIt || DoIt])]), "_fn", []), "_applyTo_arguments_", [aReceiver, []]);
|
||||
return $2;
|
||||
} catch (e) {
|
||||
if (e === $early) {
|
||||
return e[0];
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packages", []);
|
||||
return $1;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
smalltalk.send(self, "_notYetImplemented", []);
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
|
||||
smalltalk.addMethod(
|
||||
"_doesNotUnderstand_",
|
||||
smalltalk.method({
|
||||
selector: "doesNotUnderstand:",
|
||||
fn: function (aMessage) {
|
||||
var self = this;
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_inspectOn_",
|
||||
smalltalk.method({
|
||||
selector: "inspectOn:",
|
||||
fn: function (anInspector) {
|
||||
var self = this;
|
||||
return self;
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_printString",
|
||||
smalltalk.method({
|
||||
selector: "printString",
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return "this is a remote object";
|
||||
}
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
smalltalk.addPackage('Helios-Environments', {});
|
||||
smalltalk.addClass('HLEnvironment', smalltalk.Object, [], 'Helios-Environments');
|
||||
smalltalk.HLEnvironment.comment="Abstract class defining common behavior for local and remote environments"
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
category: 'actions',
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
},
|
||||
args: ["someCode", "aReceiver"],
|
||||
source: "eval: someCode on: aReceiver\x0a\x0a\x09^ self subclassResponsibility",
|
||||
messageSends: ["subclassResponsibility"],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
category: 'accessing',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(self, "_subclassResponsibility", []);
|
||||
return $1;
|
||||
},
|
||||
args: [],
|
||||
source: "packages\x0a\x0a\x09^ self subclassResponsibility",
|
||||
messageSends: ["subclassResponsibility"],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLLocalEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
category: 'actions',
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
var $1, $2;
|
||||
var $early = {};
|
||||
try {
|
||||
var compiler;
|
||||
compiler = smalltalk.send(smalltalk.Compiler || Compiler, "_new", []);
|
||||
smalltalk.send(function () {return smalltalk.send(compiler, "_parseExpression_", [someCode]);}, "_on_do_", [smalltalk.Error || Error, function (ex) {$1 = smalltalk.send(window, "_alert_", [smalltalk.send(ex, "_messageText", [])]);throw $early = [$1];}]);
|
||||
$2 = smalltalk.send(smalltalk.send(smalltalk.send(compiler, "_eval_", [smalltalk.send(compiler, "_compile_forClass_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [someCode]), "__comma", ["] value"]), smalltalk.DoIt || DoIt])]), "_fn", []), "_applyTo_arguments_", [aReceiver, []]);
|
||||
return $2;
|
||||
} catch (e) {
|
||||
if (e === $early) {
|
||||
return e[0];
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
args: ["someCode", "aReceiver"],
|
||||
source: "eval: someCode on: aReceiver\x0a\x09| compiler |\x0a\x09compiler := Compiler new.\x0a\x09[compiler parseExpression: someCode] on: Error do: [:ex |\x0a\x09\x09^window alert: ex messageText].\x0a\x09^(compiler eval: (compiler compile: 'doIt ^[', someCode, '] value' forClass: DoIt)) fn applyTo: aReceiver arguments: #()",
|
||||
messageSends: ["new", "on:do:", "alert:", "messageText", "parseExpression:", "applyTo:arguments:", "fn", "eval:", "compile:forClass:", ","],
|
||||
referencedClasses: ["Compiler", "Error", "DoIt"]
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
category: 'accessing',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
var $1;
|
||||
$1 = smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_packages", []);
|
||||
return $1;
|
||||
},
|
||||
args: [],
|
||||
source: "packages\x0a\x0a\x09^ Smalltalk current packages",
|
||||
messageSends: ["packages", "current"],
|
||||
referencedClasses: ["Smalltalk"]
|
||||
}),
|
||||
smalltalk.HLLocalEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteEnvironment', smalltalk.HLEnvironment, [], 'Helios-Environments');
|
||||
smalltalk.addMethod(
|
||||
"_eval_on_",
|
||||
smalltalk.method({
|
||||
selector: "eval:on:",
|
||||
category: 'actions',
|
||||
fn: function (someCode, aReceiver) {
|
||||
var self = this;
|
||||
smalltalk.send(self, "_notYetImplemented", []);
|
||||
return self;
|
||||
},
|
||||
args: ["someCode", "aReceiver"],
|
||||
source: "eval: someCode on: aReceiver\x0a\x0a\x09\x22Note for future self and friends:\x0a whatever way this compilation happens on the other side, \x0a it should return a proxy to the remote resulting object\x22\x0a \x0a self notYetImplemented",
|
||||
messageSends: ["notYetImplemented"],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_packages",
|
||||
smalltalk.method({
|
||||
selector: "packages",
|
||||
category: 'accessing',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return self;
|
||||
},
|
||||
args: [],
|
||||
source: "packages\x0a\x09\x22Answer the remote environment's packages\x22\x0a \x0a\x09\x22to-do\x22\x0a \x0a \x22Note for future self and friends:\x0a the problem with remote stuff is that the answers shouldn't be expected to be\x0a received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here\x22",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteEnvironment);
|
||||
|
||||
|
||||
|
||||
smalltalk.addClass('HLRemoteObject', smalltalk.Object, [], 'Helios-Environments');
|
||||
smalltalk.HLRemoteObject.comment="This is a local proxy to a remote object.\x0aTipically useful for evaluating and inspecting and interacting with instances of a remote VM.\x0a"
|
||||
smalltalk.addMethod(
|
||||
"_doesNotUnderstand_",
|
||||
smalltalk.method({
|
||||
selector: "doesNotUnderstand:",
|
||||
category: 'actions',
|
||||
fn: function (aMessage) {
|
||||
var self = this;
|
||||
return self;
|
||||
},
|
||||
args: ["aMessage"],
|
||||
source: "doesNotUnderstand: aMessage\x0a\x0a\x09\x22to-do\x0a\x0a\x09aham, blah blah\x0a\x0a\x09super doesNotUnderstand: aMessage\x22",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_inspectOn_",
|
||||
smalltalk.method({
|
||||
selector: "inspectOn:",
|
||||
category: 'actions',
|
||||
fn: function (anInspector) {
|
||||
var self = this;
|
||||
return self;
|
||||
},
|
||||
args: ["anInspector"],
|
||||
source: "inspectOn: anInspector\x0a\x0a\x09\x22to-do\x22\x0a\x0a\x09\x22this is a source of so much fun...\x22\x0a",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
smalltalk.addMethod(
|
||||
"_printString",
|
||||
smalltalk.method({
|
||||
selector: "printString",
|
||||
category: 'actions',
|
||||
fn: function () {
|
||||
var self = this;
|
||||
return "this is a remote object";
|
||||
},
|
||||
args: [],
|
||||
source: "printString\x0a\x09^ 'this is a remote object'",
|
||||
messageSends: [],
|
||||
referencedClasses: []
|
||||
}),
|
||||
smalltalk.HLRemoteObject);
|
||||
|
||||
|
||||
|
|
@ -1,101 +1,4 @@
|
|||
Smalltalk current createPackage: 'Helios-Core' properties: #{}!
|
||||
Object subclass: #HLEnvironment
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Core'!
|
||||
!HLEnvironment commentStamp!
|
||||
Abstract class defining common behavior for local and remote environments!
|
||||
|
||||
!HLEnvironment methodsFor: 'accessing'!
|
||||
|
||||
packages
|
||||
|
||||
^ self subclassResponsibility
|
||||
! !
|
||||
|
||||
!HLEnvironment methodsFor: 'actions'!
|
||||
|
||||
eval: someCode on: aReceiver
|
||||
|
||||
^ self subclassResponsibility
|
||||
! !
|
||||
|
||||
HLEnvironment subclass: #HLLocalEnvironment
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Core'!
|
||||
|
||||
!HLLocalEnvironment methodsFor: 'accessing'!
|
||||
|
||||
packages
|
||||
|
||||
^ Smalltalk current packages
|
||||
! !
|
||||
|
||||
!HLLocalEnvironment methodsFor: 'actions'!
|
||||
|
||||
eval: someCode on: aReceiver
|
||||
| compiler |
|
||||
compiler := Compiler new.
|
||||
[compiler parseExpression: someCode] on: Error do: [:ex |
|
||||
^window alert: ex messageText].
|
||||
^(compiler eval: (compiler compile: 'doIt ^[', someCode, '] value' forClass: DoIt)) fn applyTo: aReceiver arguments: #()
|
||||
! !
|
||||
|
||||
HLEnvironment subclass: #HLRemoteEnvironment
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Core'!
|
||||
|
||||
!HLRemoteEnvironment methodsFor: 'accessing'!
|
||||
|
||||
packages
|
||||
"Answer the remote environment's packages"
|
||||
|
||||
"to-do"
|
||||
|
||||
"Note for future self and friends:
|
||||
the problem with remote stuff is that the answers shouldn't be expected to be
|
||||
received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here"
|
||||
! !
|
||||
|
||||
!HLRemoteEnvironment methodsFor: 'actions'!
|
||||
|
||||
eval: someCode on: aReceiver
|
||||
|
||||
"Note for future self and friends:
|
||||
whatever way this compilation happens on the other side,
|
||||
it should return a proxy to the remote resulting object"
|
||||
|
||||
self notYetImplemented
|
||||
! !
|
||||
|
||||
Object subclass: #HLRemoteObject
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Core'!
|
||||
!HLRemoteObject commentStamp!
|
||||
This is a local proxy to a remote object.
|
||||
Tipically useful for evaluating and inspecting and interacting with instances of a remote VM.!
|
||||
|
||||
!HLRemoteObject methodsFor: 'actions'!
|
||||
|
||||
doesNotUnderstand: aMessage
|
||||
|
||||
"to-do
|
||||
|
||||
aham, blah blah
|
||||
|
||||
super doesNotUnderstand: aMessage"
|
||||
!
|
||||
|
||||
inspectOn: anInspector
|
||||
|
||||
"to-do"
|
||||
|
||||
"this is a source of so much fun..."
|
||||
!
|
||||
|
||||
printString
|
||||
^ 'this is a remote object'
|
||||
! !
|
||||
|
||||
Widget subclass: #HLSourceArea
|
||||
instanceVariableNames: 'editor textarea div receiver onDoIt'
|
||||
package: 'Helios-Core'!
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
Smalltalk current createPackage: 'Helios-Environments' properties: #{}!
|
||||
Object subclass: #HLEnvironment
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Environments'!
|
||||
!HLEnvironment commentStamp!
|
||||
Abstract class defining common behavior for local and remote environments!
|
||||
|
||||
!HLEnvironment methodsFor: 'accessing'!
|
||||
|
||||
packages
|
||||
|
||||
^ self subclassResponsibility
|
||||
! !
|
||||
|
||||
!HLEnvironment methodsFor: 'actions'!
|
||||
|
||||
eval: someCode on: aReceiver
|
||||
|
||||
^ self subclassResponsibility
|
||||
! !
|
||||
|
||||
HLEnvironment subclass: #HLLocalEnvironment
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Environments'!
|
||||
|
||||
!HLLocalEnvironment methodsFor: 'accessing'!
|
||||
|
||||
packages
|
||||
|
||||
^ Smalltalk current packages
|
||||
! !
|
||||
|
||||
!HLLocalEnvironment methodsFor: 'actions'!
|
||||
|
||||
eval: someCode on: aReceiver
|
||||
| compiler |
|
||||
compiler := Compiler new.
|
||||
[compiler parseExpression: someCode] on: Error do: [:ex |
|
||||
^window alert: ex messageText].
|
||||
^(compiler eval: (compiler compile: 'doIt ^[', someCode, '] value' forClass: DoIt)) fn applyTo: aReceiver arguments: #()
|
||||
! !
|
||||
|
||||
HLEnvironment subclass: #HLRemoteEnvironment
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Environments'!
|
||||
|
||||
!HLRemoteEnvironment methodsFor: 'accessing'!
|
||||
|
||||
packages
|
||||
"Answer the remote environment's packages"
|
||||
|
||||
"to-do"
|
||||
|
||||
"Note for future self and friends:
|
||||
the problem with remote stuff is that the answers shouldn't be expected to be
|
||||
received in a syncrhonous fashion. Everything network is asyc, so you *are going to deal with callbacks* here"
|
||||
! !
|
||||
|
||||
!HLRemoteEnvironment methodsFor: 'actions'!
|
||||
|
||||
eval: someCode on: aReceiver
|
||||
|
||||
"Note for future self and friends:
|
||||
whatever way this compilation happens on the other side,
|
||||
it should return a proxy to the remote resulting object"
|
||||
|
||||
self notYetImplemented
|
||||
! !
|
||||
|
||||
Object subclass: #HLRemoteObject
|
||||
instanceVariableNames: ''
|
||||
package: 'Helios-Environments'!
|
||||
!HLRemoteObject commentStamp!
|
||||
This is a local proxy to a remote object.
|
||||
Tipically useful for evaluating and inspecting and interacting with instances of a remote VM.!
|
||||
|
||||
!HLRemoteObject methodsFor: 'actions'!
|
||||
|
||||
doesNotUnderstand: aMessage
|
||||
|
||||
"to-do
|
||||
|
||||
aham, blah blah
|
||||
|
||||
super doesNotUnderstand: aMessage"
|
||||
!
|
||||
|
||||
inspectOn: anInspector
|
||||
|
||||
"to-do"
|
||||
|
||||
"this is a source of so much fun..."
|
||||
!
|
||||
|
||||
printString
|
||||
^ 'this is a remote object'
|
||||
! !
|
||||
|
Loading…
Reference in New Issue