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
;; P01 (*) Find the last box of a list. | |
;; Example: | |
;; * (my-last '(a b c d)) | |
;; (D) | |
(define (my-last lst) | |
(if (null? lst) | |
'() | |
(let ((tail (cdr lst))) | |
(if (null? tail) | |
lst | |
(my-last tail))))) |
0 件のコメント:
コメントを投稿