kopia lustrzana https://github.com/backface/turtlestitch
added hook for "crossproduct" in threads
rodzic
c9764aca69
commit
5cd2d58063
|
@ -1741,7 +1741,6 @@ SpriteMorph.prototype.blockAlternatives = {
|
|||
doShowVar: ['doHideVar'],
|
||||
doHideVar: ['doShowVar'],
|
||||
|
||||
// lists
|
||||
// HOFs
|
||||
reportMap: ['reportKeep', 'reportFindFirst'],
|
||||
reportKeep: ['reportFindFirst', 'reportMap'],
|
||||
|
@ -2786,7 +2785,6 @@ SpriteMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push('-');
|
||||
blocks.push(block('reportConcatenatedLists'));
|
||||
blocks.push(block('reportReshape'));
|
||||
// blocks.push(block('reportTranspose'));
|
||||
blocks.push('-');
|
||||
blocks.push(block('doAddToList'));
|
||||
blocks.push(block('doDeleteFromList'));
|
||||
|
@ -8948,7 +8946,6 @@ StageMorph.prototype.blockTemplates = function (category) {
|
|||
blocks.push('-');
|
||||
blocks.push(block('reportConcatenatedLists'));
|
||||
blocks.push(block('reportReshape'));
|
||||
// blocks.push(block('reportTranspose'));
|
||||
blocks.push('-');
|
||||
blocks.push(block('doAddToList'));
|
||||
blocks.push(block('doDeleteFromList'));
|
||||
|
|
|
@ -1955,6 +1955,15 @@ Process.prototype.reportTranspose = function (list) {
|
|||
return list.transpose();
|
||||
};
|
||||
|
||||
Process.prototype.reportCrossproduct = function (lists) {
|
||||
this.assertType(lists, 'list');
|
||||
if (lists.isEmpty()) {
|
||||
return lists;
|
||||
}
|
||||
this.assertType(lists.at(1), 'list');
|
||||
return lists.crossproduct();
|
||||
};
|
||||
|
||||
Process.prototype.reportReshape = function (list, shape) {
|
||||
this.assertType(list, 'list');
|
||||
this.assertType(shape, 'list');
|
||||
|
|
Ładowanie…
Reference in New Issue