; File: yesorno.scm ; optional arguments as many as you want ; instead of (lambda (x) body..) write (lambda x body ..) ; (func-opt-args 2 3 4 5) -> (2 3 4 5) ; (func-opt-args) -> () (define func-opt-args (lambda x (display x)) ) ;> (yes-or-no?) ;(Y/N)? y ;#t ;> (yes-or-no? "continue") ;("continue")(Y/N)? y ;#t (define yes-or-no? (lambda text ; text is optional (if (not (null? text)) (write text)) ; if there is no text - do not type anything (display "(Y/N)? ") (if (member (read) '(y yes da d ok t true)) #t #f) ))