From 4d5dad807b629486aa0c4cbe5725a5bc1a61487d Mon Sep 17 00:00:00 2001 From: jmoenig Date: Tue, 8 Oct 2013 16:59:55 +0200 Subject: experimental MAP primitive reporter in lists category, visible in dev mode for now --- objects.js | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index dfdd826..74ea20c 100644 --- a/objects.js +++ b/objects.js @@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2013-October-04'; +modules.objects = '2013-October-08'; var SpriteMorph; var StageMorph; @@ -1045,6 +1045,13 @@ SpriteMorph.prototype.initBlocks = function () { defaults: [1, null, localize('thing')] }, + // MAP - experimental + reportMap: { + type: 'reporter', + category: 'lists', + spec: 'map %repRing over %l' + }, + // Code mapping - experimental doMapCodeOrHeader: { // experimental type: 'command', @@ -1850,6 +1857,22 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('doInsertInList')); blocks.push(block('doReplaceInList')); + // for debugging: /////////////// + + if (this.world().isDevMode) { + blocks.push('-'); + txt = new TextMorph(localize( + 'development mode \ndebugging primitives:' + )); + txt.fontSize = 9; + txt.setColor(this.paletteTextColor); + blocks.push(txt); + blocks.push('-'); + blocks.push(block('reportMap')); + } + + ///////////////////////////////// + blocks.push('='); if (StageMorph.prototype.enableCodeMapping) { @@ -4485,6 +4508,22 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(block('doInsertInList')); blocks.push(block('doReplaceInList')); + // for debugging: /////////////// + + if (this.world().isDevMode) { + blocks.push('-'); + txt = new TextMorph(localize( + 'development mode \ndebugging primitives:' + )); + txt.fontSize = 9; + txt.setColor(this.paletteTextColor); + blocks.push(txt); + blocks.push('-'); + blocks.push(block('reportMap')); + } + + ///////////////////////////////// + blocks.push('='); if (StageMorph.prototype.enableCodeMapping) { -- cgit v1.3.1