Vector operations
A stack-oriented programming language suitable for code golfing
Status: Alpha
Brought to you by:
aditsu
Being able to vectorize operations would be useful quite frequently.
Since a . between an array and an operator currently has no meaning, we could borrow the syntax from Octave/MATLAB:
[1 2 3] [7 6 2] .+ " yields [8 8 5] ";
Preferably, vectorizing would work for all two-argument (and maybe three-) operators.
I was already planning that for a future version, but I was thinking of using a "v" prefix. The dot might be a better idea, I'll consider it.
Implemented
.with binary operators, will be released in 0.6.5.I'll think about ternary operators too.
How should it work with ternary operators when the arrays have different sizes?