Skip to content

Instantly share code, notes, and snippets.

@pbalduino
Created July 30, 2011 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbalduino/1115038 to your computer and use it in GitHub Desktop.
Save pbalduino/1115038 to your computer and use it in GitHub Desktop.
Passing a function as parameter to another in Lucio
; first function receives another function and two values
; second function returns the average of two values
(define calculate
(fun
([op v1 v2]
(op v1 v2))))
(define average
(fun
([a b]
(/ (+ a b) 2))))
(calculate average 3 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment