-
Notifications
You must be signed in to change notification settings - Fork 4
Example syntax
clemahieu edited this page Mar 19, 2013
·
1 revision
function example-1
[] :(Takes no arguments:)
[] :(Does nothing:)
[ [] ] :(Returns no data:)
function example-2
[int32 parameter-1] :(Takes an integer 32 bits wide as an argument:)
[]
[ [] ]
function example-3
[int8 parameter-1]
[
let result-1 [parameter-1] :(Labels parameter-1 as result-1.:)
:(There is absolutely no difference between using the identifier result-1 or parameter-1 as a result:)
]
[ [result-1] ]
function example-4
[int1 parameter-1]
[
let result-false result-true [ [if parameter-1] ] :(The instruction `if' returns two branches.:)
:(Branches are now labeled `result-false' and `result-true':)
]
[ [result-false][result-true] ] :(example-4 returns two possible ways:)