diff --git a/tk/listlogic.scm b/tk/listlogic.scm index 9c11da8..73e83df 100644 --- a/tk/listlogic.scm +++ b/tk/listlogic.scm @@ -2,7 +2,8 @@ #:export (flatten lp& l& - if-some) + if-some + if-some-else) #:duplicates (warn-override-core warn )) (define (flatten-helper lst acc stk) @@ -48,3 +49,7 @@ ;; Returns the argument if it isn't #f, otherwise returns the empty list (define (if-some $cond) (if $cond $cond '())) + +;; Returns the first argument if it isn't #f, otherwise returns the second. +(define (if-some-else $cond $else) + (if $cond $cond $else))