diff --git a/module/srfi/srfi-1.mes b/module/srfi/srfi-1.mes index e3b904a7..5069e885 100644 --- a/module/srfi/srfi-1.mes +++ b/module/srfi/srfi-1.mes @@ -1,7 +1,7 @@ ;;; -*-scheme-*- ;;; Mes --- Maxwell Equations of Software -;;; Copyright © 2016 Jan Nieuwenhuizen +;;; Copyright © 2016,2017 Jan Nieuwenhuizen ;;; ;;; This file is part of Mes. ;;; @@ -40,6 +40,12 @@ (define (append-map f lst) (apply append (map f lst))) +(define (filter-map f lst) + (if (null? lst) (list) + (let ((r (f (car lst)))) + (if r (cons r (filter-map f (cdr lst))) + (filter-map f (cdr lst)))))) + ;;; nyacc requirements (define (fold proc init lst1 . rest)