scheme/yast/hello.scm

30 lines
508 B
Scheme
Raw Normal View History

2024-08-18 20:55:31 +02:00
;; 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)))
2024-08-20 19:10:43 +02:00
(define add1
(lambda (a)
(+ a 1)))
(define sub1
(lambda (b)
(- b 1)))
(display(string-append "sub1 to 2 is " (number->string(sub1 2)) "\n"))
2024-08-18 20:55:31 +02:00
;; display message on screen
2024-08-18 12:29:43 +02:00
(display "Hello World!")
2024-08-20 19:10:43 +02:00