hello-world.scm 590 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/guile -s
  2. !#
  3. (display "Hello World!")
  4. (newline)
  5. (define x 5)
  6. (set! x "Hello World!")
  7. (define call/cc call-with-current-continuation)
  8. (string-append "/home" "/" "joshua")
  9. (string-length "Hello World!")
  10. ;; This creates a function, that no one can really call.
  11. (lambda (x) x)
  12. ;;BUT this creates a function that is immediately called with the parameter 5
  13. ((lambda (x) x) 5)
  14. ;; This is the long way of creating a function using the lambda function
  15. (define add
  16. (lambda (x y)
  17. (+ x y)))
  18. ;; This is the shorthand way of making the same function
  19. (define (add x y)
  20. (+ x y))