Created
February 1, 2023 06:56
-
-
Save anandology/c8ff9836e541da642c1645a3d20abb1f to your computer and use it in GitHub Desktop.
Austral Modules example.
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
import Square (square); | |
module body Main is | |
function main(): ExitCode is | |
let n: Int32 := 5; | |
let n2:Int32 := square(n); | |
printLn(n2); | |
return ExitSuccess(); | |
end; | |
end module body. |
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
module Square is | |
function square(n: Int32): Int32; | |
end module. |
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
module body Square is | |
function square(n: Int32): Int32 is | |
return n*n; | |
end; | |
end module body. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment