Skip to content

Instantly share code, notes, and snippets.

@sepisoad
Last active December 11, 2015 18:48
Show Gist options
  • Save sepisoad/4643799 to your computer and use it in GitHub Desktop.
Save sepisoad/4643799 to your computer and use it in GitHub Desktop.
;;; chicken scheme
;;; 002
;;; how to create local variables
;;; how to use them in functions
;;; how to return a value from a function
(define number1 5)
(define number2 10)
(define add
(lambda (a b)
(let ((res 0))
(set! res (+ a b))
res))) ;;; this line sets the returns value of our add function
(display "number1 + number2 = ")
(display (add number1 number2))
(newline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment