|
@@ -1,4 +1,4 @@
|
|
|
-define("lyst/Lyst", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections"], function($boot){
|
|
|
+define("lyst/Lyst", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections"], function($boot){"use strict";
|
|
|
var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
$core.addPackage('Lyst');
|
|
|
$core.packages["Lyst"].innerEval = function (expr) { return eval(expr); };
|
|
@@ -497,6 +497,33 @@ messageSends: ["inject:into:", "atYndexIn:ifAbsent:", "value"]
|
|
|
}),
|
|
|
$globals.Object);
|
|
|
|
|
|
+$core.addMethod(
|
|
|
+$core.method({
|
|
|
+selector: "atLyst:ifAbsent:put:",
|
|
|
+protocol: '*Lyst',
|
|
|
+fn: function (aCollection,aBlock,value){
|
|
|
+var self=this;
|
|
|
+var penultimate;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+var $1;
|
|
|
+penultimate=self._atLyst_ifAbsent_($recv(aCollection)._allButLast(),aBlock);
|
|
|
+$1=$recv($recv(aCollection)._last())._atYndexIn_ifAbsent_put_(penultimate,aBlock,value);
|
|
|
+return $1;
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"atLyst:ifAbsent:put:",{aCollection:aCollection,aBlock:aBlock,value:value,penultimate:penultimate},$globals.Object)});
|
|
|
+//>>excludeEnd("ctx");
|
|
|
+},
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
+args: ["aCollection", "aBlock", "value"],
|
|
|
+source: "atLyst: aCollection ifAbsent: aBlock put: value\x0a\x09| penultimate |\x0a\x09penultimate := self atLyst: aCollection allButLast ifAbsent: aBlock.\x0a\x09^ aCollection last atYndexIn: penultimate ifAbsent: aBlock put: value",
|
|
|
+referencedClasses: [],
|
|
|
+//>>excludeEnd("ide");
|
|
|
+messageSends: ["atLyst:ifAbsent:", "allButLast", "atYndexIn:ifAbsent:put:", "last"]
|
|
|
+}),
|
|
|
+$globals.Object);
|
|
|
+
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "atYndexIn:ifAbsent:",
|