diff options
| author | jmoenig <jens@moenig.org> | 2013-09-16 12:06:38 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-09-16 12:06:38 +0200 |
| commit | ee30d63201e13ce3fb28f5731274341497158810 (patch) | |
| tree | 99a42e179f5be4c1931c7648322c8181cc3e00c0 | |
| parent | aa0b54986303ff563d4465b94e163adbf26e9d6f (diff) | |
| download | snap-ee30d63201e13ce3fb28f5731274341497158810.tar.gz snap-ee30d63201e13ce3fb28f5731274341497158810.zip | |
New SPLIT primitive reporter activated
this should come in handy when importing text files that should be
converted to lists, as in the hangman lab
| -rw-r--r-- | objects.js | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -124,7 +124,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2013-August-12'; +modules.objects = '2013-September-16'; var SpriteMorph; var StageMorph; @@ -926,6 +926,12 @@ SpriteMorph.prototype.initBlocks = function () { category: 'operators', spec: 'is %s identical to %s ?' }, + reportTextSplit: { + type: 'reporter', + category: 'operators', + spec: 'split %s by %delim', + defaults: [localize('hello') + ' ' + localize('world'), " "] + }, reportTypeOf: { // only in dev mode for debugging type: 'reporter', category: 'operators', @@ -938,12 +944,6 @@ SpriteMorph.prototype.initBlocks = function () { spec: '%txtfun of %s', defaults: [null, "Abelson & Sussman"] }, - reportTextSplit: { // only in dev mode - experimental - type: 'reporter', - category: 'operators', - spec: 'split %s by %delim', - defaults: ["foo bar baz", " "] - }, /* reportScript: { @@ -1722,6 +1722,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportFalse')); blocks.push('-'); blocks.push(block('reportJoinWords')); + blocks.push(block('reportTextSplit')); blocks.push(block('reportLetter')); blocks.push(block('reportStringSize')); blocks.push('-'); @@ -1744,7 +1745,6 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push('-'); blocks.push(block('reportTypeOf')); blocks.push(block('reportTextFunction')); - blocks.push(block('reportTextSplit')); } ///////////////////////////////// @@ -4359,6 +4359,7 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportFalse')); blocks.push('-'); blocks.push(block('reportJoinWords')); + blocks.push(block('reportTextSplit')); blocks.push(block('reportLetter')); blocks.push(block('reportStringSize')); blocks.push('-'); @@ -4381,7 +4382,6 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push('-'); blocks.push(block('reportTypeOf')); blocks.push(block('reportTextFunction')); - blocks.push(block('reportTextSplit')); } ////////////////////////////////// |
