Swan Programming Language
Swan
Elegant Programming Language
Compiled, indented
Statically typed
It has different syntax for assignment operator
a - b | a instead of a = a - b
.swn extension
module euclid
fun int a, int b | euclid int // subroutine declaration
while b != 0
if a > b
a - b | a
else
b - a | b
// while
return a
// subroutine
main
int a, b // type can be on left or right side of variable
in | a b | euclid | out
// combined input output
// a b | euclid - subroutine call
Comments
Post a Comment