make safe-second really safe (don't loose on an empty list)

This commit is contained in:
interp 2002-03-29 16:44:04 +00:00
parent 4c90514e9c
commit f7e43506bb
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
;; ecm-utilities.scm -- Utility procedures for ecm-net code ;; ecm-utilities.scm -- Utility procedures for ecm-net code
;; ;;
;; $Id: ecm-utilities.scm,v 1.3 2001/12/18 18:08:08 interp Exp $ ;; $Id: ecm-utilities.scm,v 1.4 2002/03/29 16:44:04 interp Exp $
;; ;;
;; Please send suggestions and bug reports to <emarsden@mail.dotcom.fr> ;; Please send suggestions and bug reports to <emarsden@mail.dotcom.fr>
@ -29,7 +29,7 @@
;; prefer this to :optional ;; prefer this to :optional
(define (safe-first x) (and (not (null? x)) (car x))) (define (safe-first x) (and (not (null? x)) (car x)))
(define (safe-second x) (and (not (null? (cdr x))) (cadr x))) (define (safe-second x) (and (not (null? x)) (not (null? (cdr x))) (cadr x)))
(define (write-crlf port) (define (write-crlf port)
(write-string "\r\n" port) (write-string "\r\n" port)