This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SuperKlasse { | |
// this is the interface in Object | |
// if an object does not understand, | |
// we look which of the two the class implements, | |
// and call the appropriate one. | |
doesNotUnderstand { |selector ... args| | |
"I am the super class, doesNotUnderstand. I have received the following arguments:\n%\n%\n".format(selector, args).postln; | |
"I'll forward to doesNotUnderstandAbout".postln; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
var flop = { |dict, keys| | |
var values, size; | |
keys = keys ?? { dict.keys.asArray }; // in terms of performance, this is the main bottleneck | |
values = keys.collect { |x| dict.at(x) }; // and this. | |
values = values.flop: | |
size = values.first.size; | |
values.collect { |xs| | |
var each = dict.copy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
these should be dice: ⚂⚁ | |
if not, there is something wrong with you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the groups of inserted items are kept as arrays for easier reading | |
// eventually we use something like the insertAll function to embed them instead | |
( | |
var insertAll; | |
insertAll = { |i, list, insertedList| | |
j = (i - 1).clip(0, list.size - 1); | |
list[0..j] ++ insertedList ++ list[j+1..] | |
}; |