home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0963.lha
/
SIOD
/
scm
/
merge2.scm
< prev
next >
Wrap
Text File
|
1993-05-08
|
408b
|
12 lines
(define (merge x y test)
(define tmp y)
(if (test (car y) (car x))
(begin (set! x y) (set! y tmp)))
(do ((x-ptr x (cdr x-ptr))
(y-ptr y))
((or (null? x-ptr) (null? y-ptr)) x)
(if (test (car y) (car x))
(begin (set! tmp (cdr x-ptr))
(set-cdr! x-ptr y)
(set! y-ptr tmp)))))