[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Parsing HTML, best practice with Chicken

From: Mario Domenech Goulart
Subject: Re: [Chicken-users] Parsing HTML, best practice with Chicken
Date: Mon, 29 Dec 2014 11:21:18 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)


On Mon, 29 Dec 2014 12:12:22 +0100 Kooda <address@hidden> wrote:

>> ;; --- member? returns #t if elemnt x is in list lst.
>> ;; --- ref:
>> ;; --- 
>> ;; --- use: (member? "a" (list "a" 1)) --> #t
>> (define (member? x lst)
>>   (fold (lambda (e r)
>>           (or r (equal? e x)))
>>         #f lst))
> This function already exists, it’s called `member` and is in the
> srfi-1 library.

It's actually in the Scheme specification:

`member' from SRFI-1 provides an extension to allow the equality
procedure to be passed in as an extra argument.

Best wishes.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]