diff --git a/module/mes/scm.mes b/module/mes/scm.mes index 32fc13f6..805b0318 100644 --- a/module/mes/scm.mes +++ b/module/mes/scm.mes @@ -126,6 +126,11 @@ (define memv memq) +(define (member x lst) + (if (null? lst) #f + (if (equal? x (car lst)) lst + (member x (cdr lst))))) + ;;; Lists (define (make-list n . x) diff --git a/src/lib.c b/src/lib.c index 9fb74900..8b46898e 100644 --- a/src/lib.c +++ b/src/lib.c @@ -312,21 +312,3 @@ equal2_p (SCM a, SCM b) } return eq_p (a, b); } - -SCM -member (SCM x, SCM a) -{ - switch (TYPE (x)) - { - case TCHAR: - case TNUMBER: - case TKEYWORD: - case TSYMBOL: - case TSPECIAL: - return memq (x, a); - default: - while (a != cell_nil && equal2_p (x, CAR (a)) != cell_t) - a = CDR (a); - } - return a != cell_nil ? a : cell_f; -}