Subject: Re: Case independence and (case) From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx> Date: Fri, 17 Apr 1998 22:35:05 -0400 (EDT) |
At 17 Apr 1998 19:12 -0400, Russell Steven Shawn O'Connor wrote: > On Fri, 17 Apr 1998, Chris Maden wrote: > > > (assoc) isn't part of dsssl-o, and Jade 1.1's documentation doesn't > > list it among the supported additional procedures. Otherwise yes, it > > would be perfect for what I'm trying to do in this case. > > Everytime I find that Jade doesn't support a function in the standard > that I want to use, I write my own: > > (define (assoc elm lst) > (cond ((null? lst) #f) > ((equal? elm (caar lst)) (car lst)) > (#t (assoc elm (cdr lst))) > ) > ) There is also a version of assoc in the DSSSL procedure library (part of the DSSSL documentation project) at http://www.mulberrytech.com/dsssl/dsssldoc/procedures (define (assoc obj alist) ;; Given an associative list, returns the pair that has obj as a car ;; or #f if no such pair exists ;; (("a" "b") ("c" "d")), "a" => ("a" "b") (let loop ((al alist)) (if (null? al) #f (if (equal? obj (car (car al))) (car al) (loop (cdr al)))))) Contributions (marked up to DocBook 3.0) are always welcome. Regards, Tony Graham ======================================================================= Tony Graham Mulberry Technologies, Inc. Phone: 301-315-9632 17 West Jefferson Street, Suite 207 Fax: 301-315-8285 Rockville, MD USA 20850 email: tgraham@xxxxxxxxxxxxxxxx ======================================================================= DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Case independence and (case), Russell Steven Shawn | Thread | Re: Case independence and (case), Russell Steven Shawn |
Re: Case independence and (case), Russell Steven Shawn | Date | Re: DSSSL design choices - question, Paul Prescod |
Month |