scheme/yast/hello.scm
Geir Okkenhaug Jerstad 4a5b13324f a little scheme
2024-08-20 19:10:43 +02:00

30 lines
508 B
Scheme

;; Hello world as a variable
(define vhello "Hello world")
;; Hello World as a function
(define fhello (lambda ()
"hello world"))
;; hello with name
(define hello
(lambda (name)
(string-append "hello " name "!")))
;; sum of three numbers
(define sum3
(lambda (a b c)
(+ a b c)))
(define add1
(lambda (a)
(+ a 1)))
(define sub1
(lambda (b)
(- b 1)))
(display(string-append "sub1 to 2 is " (number->string(sub1 2)) "\n"))
;; display message on screen
(display "Hello World!")