Last active
August 22, 2018 14:01
-
-
Save theodesp/c561d8a2b4b6ec6c35f9ad9789fc83e3 to your computer and use it in GitHub Desktop.
Safe first #scheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import (rnrs (6))) | |
(use-modules ((rnrs) :version (6))) | |
(define (safe-first sent) | |
;; Return first if not empty | |
(if (empty? sent) | |
'() | |
(first sent))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment