Solution is a compiler for an array-oriented language, providing the cognition of APL in an accessible, compiled, and open-source platform. The Solution Language is inspired by the work of Kenneth Iverson.
The following demonstrates Solution's implicit typing system, Demo
is automatically typed as Int×Int
and takes the minimum of the two arguments to the power of the maximum using a dyadic train.
The second function calculates the average of a numeric vector using a similar 3-arity dyadic train, however the leftmost side of this train is a function-operator combination, +/
which is equivalent to a sum.
@Package dev;
Main Int → Void {
8 Demo 2;
dev::Avg 1 3 99;
}
Demo → Void {
Println α (⌊*⌈) ω;
}
Avg → Void {
Println (+/÷≢) ω;
}