From 6fa1fcd87637cae8f0ad76951b7b389db6bfa969 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 31 Jul 2013 15:15:27 +0200 Subject: experimental text SPLIT primitive in the operators category (currently only accessible in dev mode) --- threads.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'threads.js') diff --git a/threads.js b/threads.js index 0674d94..6b73164 100644 --- a/threads.js +++ b/threads.js @@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/ // Global stuff //////////////////////////////////////////////////////// -modules.threads = '2013-July-30'; +modules.threads = '2013-July-31'; var ThreadManager; var Process; @@ -2000,6 +2000,18 @@ Process.prototype.reportUnicodeAsLetter = function (num) { return String.fromCharCode(code); }; +Process.prototype.reportTextSplit = function (string, delimiter) { + var str = (string || '').toString(), + del; + + if (this.inputOption(delimiter) === '--line--') { + del = '\n'; + } else { + del = (delimiter || '').toString(); + } + return new List(str.split(del)); +}; + // Process debugging Process.prototype.alert = function (data) { -- cgit v1.3.1