added "map" and "for each" primitives to List category

pull/89/head
jmoenig 2019-04-09 18:49:48 +02:00
rodzic 4e40745485
commit f86c0c7bdd
2 zmienionych plików z 11 dodań i 9 usunięć

Wyświetl plik

@ -25,6 +25,7 @@
* new "get graphic effect" reporter
* new "get pen attribute" reporter
* new "write" command in pen category (used to be "label" in tools)
* new "map" and "for each" primitives in list category
* added "neg" selector to monadic function reporter in "Operators" category
* added "log2" selector to monadic function reporter in "Operators" category
* added "^" reporter (power of) in the Operators category
@ -77,6 +78,7 @@
* Objects: added reporter for graphic effects
* Objects, Blocks: added pen attribute reporter
* Objects: added "write" command to Pen category (same as "label" from tools
* Objects: added "map" and "for each" primitives to List category
### 2019-04-08
* Blocks, Objects, Threads: new "getSoundAttribute" reporter primitive

Wyświetl plik

@ -1264,7 +1264,7 @@ SpriteMorph.prototype.initBlocks = function () {
defaults: [1, null, localize('thing')]
},
// MAP - experimental
// HOFs - experimental
reportMap: {
dev: true,
type: 'reporter',
@ -1275,8 +1275,8 @@ SpriteMorph.prototype.initBlocks = function () {
dev: true,
type: 'command',
category: 'lists',
spec: 'for %upvar in %l %cla',
defaults: [localize('each item')]
spec: 'for each %upvar in %l %cla',
defaults: [localize('item')]
},
// Tables - experimental
@ -2411,6 +2411,9 @@ SpriteMorph.prototype.blockTemplates = function (category) {
blocks.push(block('reportListLength'));
blocks.push(block('reportListContainsItem'));
blocks.push('-');
blocks.push(block('doForEach'));
blocks.push(block('reportMap'));
blocks.push('-');
blocks.push(block('doAddToList'));
blocks.push(block('doDeleteFromList'));
blocks.push(block('doInsertInList'));
@ -2427,9 +2430,6 @@ SpriteMorph.prototype.blockTemplates = function (category) {
txt.setColor(this.paletteTextColor);
blocks.push(txt);
blocks.push('-');
blocks.push(block('reportMap'));
blocks.push('-');
blocks.push(block('doForEach'));
blocks.push(block('doShowTable'));
}
@ -7930,6 +7930,9 @@ StageMorph.prototype.blockTemplates = function (category) {
blocks.push(block('reportListLength'));
blocks.push(block('reportListContainsItem'));
blocks.push('-');
blocks.push(block('doForEach'));
blocks.push(block('reportMap'));
blocks.push('-');
blocks.push(block('doAddToList'));
blocks.push(block('doDeleteFromList'));
blocks.push(block('doInsertInList'));
@ -7946,9 +7949,6 @@ StageMorph.prototype.blockTemplates = function (category) {
txt.setColor(this.paletteTextColor);
blocks.push(txt);
blocks.push('-');
blocks.push(block('reportMap'));
blocks.push('-');
blocks.push(block('doForEach'));
blocks.push(block('doShowTable'));
}