scheme function declaration
function.scm
In (cube x), cube is the function name, x is the function parameter.
(* x x x) is the function body.
(cube 10) calls the function with 10 as the function parameter.
[code language=”text”]
(define (cube x) (* x x x))
(cube 10)
[/code]
Output:
[code language=”text”]
;Loading "function.scm"… done
;Value: 1000
[/code]
Search within Codexpedia
Custom Search
Search the entire web
Custom Search
Related Posts