Skip to content

Commit

Permalink
added "min", "max" and "atan2" reporters to the OPERATORS palette
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoenig committed Nov 24, 2023
1 parent a6d4b3d commit b1f7d09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* **New Features:**
* new 'text' list conversion selector, recursively joins all text and number leaf elements with spaces in between, filtering out and ignoring whitespace
* added "write" command to the stage's PEN primitives palette - prints text in proportional font at specified size wrapping lines "scrolling" to the end
* added "min", "max" and "atan2" reporters to the OPERATORS palette
* **Notable Changes:**
* "reshape" now treats zero-ish (0, "", false) values in its dimension input as place-holders to accomodate the whole source list
* updated "Just Words" library for the new "text" list selector, removed now redundant "append words" reporter
Expand All @@ -19,6 +20,7 @@
* lists: turned off experimental list indices wrapping by default, not sure whether this is a good idea after all
* blocks: fixed "relabel" for HOF primitives (MAP, FIND, KEEP, COMBINE)
* objects: added "write" command to the stage's PEN primitives palette - prints text in proportional font at specified size wrapping lines "scrolling" to the end
* objects: added "min", "max" and "atan2" reporters to the OPERATORS palette

2023-11-23
* lists, gui: let list indices wrap around bounds, e.g. 0 returns the last element, -1 the second last etc.
Expand Down
15 changes: 15 additions & 0 deletions src/objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,13 @@ SpriteMorph.prototype.initBlockMigrations = function () {

SpriteMorph.prototype.newPrimitivesSince = function (version) {
var selectors = ['reportJSFunction'];
if (version < 9.1) {
selectors.push(
'reportAtan2',
'reportVariadicMin',
'reportVariadicMax'
);
}
// 9: no new primitives
// 8.2: no new primitives
if (version < 8.1) {
Expand Down Expand Up @@ -2900,8 +2907,12 @@ SpriteMorph.prototype.blockTemplates = function (
blocks.push(block('reportPower'));
blocks.push('-');
blocks.push(block('reportModulus'));
blocks.push(block('reportVariadicMin'));
blocks.push(block('reportVariadicMax'));
blocks.push('-');
blocks.push(block('reportRound'));
blocks.push(block('reportMonadic'));
blocks.push(block('reportAtan2'));
blocks.push(block('reportRandom'));
blocks.push('-');
blocks.push(block('reportVariadicLessThan'));
Expand Down Expand Up @@ -9770,8 +9781,12 @@ StageMorph.prototype.blockTemplates = function (
blocks.push(block('reportPower'));
blocks.push('-');
blocks.push(block('reportModulus'));
blocks.push(block('reportVariadicMin'));
blocks.push(block('reportVariadicMax'));
blocks.push('-');
blocks.push(block('reportRound'));
blocks.push(block('reportMonadic'));
blocks.push(block('reportAtan2'));
blocks.push(block('reportRandom'));
blocks.push('-');
blocks.push(block('reportVariadicLessThan'));
Expand Down

0 comments on commit b1f7d09

Please sign in to comment.