diff --git a/history.txt b/history.txt index a31b5652..3668320b 100755 --- a/history.txt +++ b/history.txt @@ -3367,3 +3367,7 @@ Fixes: 170209 ------ * Blocks: fixed #1406 + +170214 +------ +* Lists: remove experimental methods for object-use diff --git a/lists.js b/lists.js index 51a979b4..799a9283 100644 --- a/lists.js +++ b/lists.js @@ -62,7 +62,7 @@ CellMorph, ArrowMorph, MenuMorph, snapEquals, Morph, isNil, localize, MorphicPreferences, TableDialogMorph, SpriteBubbleMorph, SpeechBubbleMorph, TableFrameMorph, TableMorph, Variable, isSnapObject*/ -modules.lists = '2017-January-31'; +modules.lists = '2017-February-14'; var List; var ListWatcherMorph; @@ -314,68 +314,6 @@ List.prototype.version = function (startRow, rows) { return v; }; -// List object use (hierarchical dictionary) -// *very* experimental and ineffective as hell -// don't rely on any of this to stay around, -Jens - -function snapObject(parent) { - return new List([new List(['__proto__', parent])]); -} - -List.prototype.setAttribute = function (key, value) { - var assoc = this.assoc(key); - if (assoc) { - assoc.put(value, 2); - this.changed(); - } else { - this.add(new List([key, value])); - } -}; - -List.prototype.getAttribute = function (key) { - var assoc = this.assoc(key), - proto; - if (assoc) { - return assoc.at(2); - } - proto = this.getAttribute('__proto__'); - if (proto) { - return proto.getAttribute(key); - } - throw new Error('unknown attribute: ' + key.toString()); -}; - -List.prototype.removeAttribute = function (key) { - var i, assoc; - for (i = 1; i <= this.length(); i += 1) { - assoc = this.at(i); - if (snapEquals(assoc.at(1), key)) { - this.remove(i); - return; - } - } -}; - -List.prototype.attributes = function () { - var i, arr = []; - for (i = 1; i <= this.length(); i += 1) { - arr.push(this.at(i).at(1)); - } - return new List(arr); -}; - -List.prototype.assoc = function (key) { - // private - var i, assoc; - for (i = 1; i <= this.length(); i += 1) { - assoc = this.at(i); - if (snapEquals(assoc.at(1), key)) { - return assoc; - } - } - return null; -}; - // List conversion: List.prototype.asArray = function () {