Last active
December 11, 2015 18:48
-
-
Save sepisoad/4643799 to your computer and use it in GitHub Desktop.
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
;;; 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