added hook for "crossproduct" in threads

pull/95/head
jmoenig 2021-02-08 16:37:03 +01:00
rodzic c9764aca69
commit 5cd2d58063
2 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -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'));

Wyświetl plik

@ -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');