summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-10-08 16:59:55 +0200
committerjmoenig <jens@moenig.org>2013-10-08 16:59:55 +0200
commit4d5dad807b629486aa0c4cbe5725a5bc1a61487d (patch)
treeb0067238b5a3bdc7bda9f7a6614424482ef1d459 /objects.js
parent39ea1d542d72194b887efd57e2ccde7174b9d17c (diff)
downloadsnap-byow-4d5dad807b629486aa0c4cbe5725a5bc1a61487d.tar.gz
snap-byow-4d5dad807b629486aa0c4cbe5725a5bc1a61487d.zip
experimental MAP primitive reporter
in lists category, visible in dev mode for now
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js41
1 files changed, 40 insertions, 1 deletions
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) {