diff --git a/src/api.js b/src/api.js index 248c6cdf..7638bf98 100644 --- a/src/api.js +++ b/src/api.js @@ -27,7 +27,7 @@ prerequisites: -------------- - needs gui.js and morphic.js + needs gui.js, lists.js and morphic.js documentation @@ -54,6 +54,10 @@ - IDE_Morph.prototype.getVar() - IDE_Morph.prototype.setVar() + Create and Modify Lists + + - IDE_Morph.prototype.newList() + Getting hold of an ide can usually be achieved by evaluating: @@ -192,11 +196,11 @@ */ -/*global modules, IDE_Morph, isString, Map*/ +/*global modules, IDE_Morph, isString, Map, List*/ // Global stuff //////////////////////////////////////////////////////// -modules.api = '2020-April-27'; +modules.api = '2020-July-06'; // IDE_Morph external communication API - experimental /* @@ -303,3 +307,9 @@ IDE_Morph.prototype.setVar = function (name, value) { // raise an error if no global variable of that name exists this.stage.globalVariables().setVar(name, value); }; + +IDE_Morph.prototype.newList = function (array) { + // return a new Snap list the shape of the given array, if any + // nested array will not be automatically converted to nested lists + return new List(array); +};