Skip to content

Instantly share code, notes, and snippets.

@theodesp
Last active August 22, 2018 14:01
Show Gist options
  • Save theodesp/c561d8a2b4b6ec6c35f9ad9789fc83e3 to your computer and use it in GitHub Desktop.
Save theodesp/c561d8a2b4b6ec6c35f9ad9789fc83e3 to your computer and use it in GitHub Desktop.
Safe first #scheme
(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