home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0963.lha
/
SIOD
/
scm
/
scambia-all.scm
< prev
next >
Wrap
Text File
|
1993-02-22
|
634b
|
19 lines
(define (scambia-all lis x y)
(define pila (make-pila))
(define l lis)
(do ()
((and (null? l) (empty-pila? pila)) lis)
(cond ((null? l)
(set! l (top pila))
(pop pila))
((pair? (car l))
(push (cdr l) pila)
(set! l (car l)))
((eq? x (car l))
(set-car! l y)
(set! l (cdr l)))
((eq? y (car l))
(set-car! l x)
(set! l (cdr l)))
(else (set! l (cdr l))))))