Welcome to the CHICKEN Scheme pasting service

define srfi-1 member added by gahr on Mon Jun 10 13:43:39 2024

$ cat member.scm
(import (except scheme member))
(define (member x lst cmp)
  (let loop ((lst lst))
    (cond ((null? lst) #f)
          ((cmp x (car lst)) #t)
          (else (loop (cdr lst))))))



$ chicken-csc member.scm

Warning: (member.scm:2) - assignment to imported value binding `member'

Warning: Invalid assignment
  At the toplevel,
  In assignment:

    (set! scheme#member (lambda (x lst cmp) ((let ... ...) lst)))

  Variable `member' is assigned invalid value.

  The assigned value has this type:

    (procedure (* * *) . *)

  The declared type of `member' from module `scheme' is:

    ('a (list-of 'b) -> (or false (pair 'a (list-of 'b))))

Warning: redefinition of standard binding: scheme#member

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Name of the language CHICKEN compiles to:
Visually impaired? Let me spell it for you (wav file) download WAV