"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "comlist.scm" between
slib-3b5.tar.gz and slib-3b6.tar.gz

About: SLIB is a portable "scheme" (algorithmic language) library meant to provide compatibiliy and utility functions for all standard "scheme" implementations.

comlist.scm  (slib-3b5):comlist.scm  (slib-3b6)
skipping to change at line 235 skipping to change at line 235
(cond ((negative? k) lst) ;(slib:error "negative argument to butnthcdr" k) (cond ((negative? k) lst) ;(slib:error "negative argument to butnthcdr" k)
; SIMSYNCH FIFO8 uses negative k. ; SIMSYNCH FIFO8 uses negative k.
((or (zero? k) (null? lst)) '()) ((or (zero? k) (null? lst)) '())
(else (let ((ans (list (car lst)))) (else (let ((ans (list (car lst))))
(do ((lst (cdr lst) (cdr lst)) (do ((lst (cdr lst) (cdr lst))
(tail ans (cdr tail)) (tail ans (cdr tail))
(k (+ -2 k) (+ -1 k))) (k (+ -2 k) (+ -1 k)))
((or (negative? k) (null? lst)) ans) ((or (negative? k) (null? lst)) ans)
(set-cdr! tail (list (car lst)))))))) (set-cdr! tail (list (car lst))))))))
;@
(define (butnth k lst)
(cond ((negative? k) lst)
((null? lst) lst)
((zero? k) (cdr lst))
(else (let ((ans (list (car lst))))
(do ((lst (cdr lst) (cdr lst))
(tail ans (cdr tail))
(k (+ -2 k) (+ -1 k)))
((or (negative? k) (null? lst))
(cond ((not (null? lst))
(set-cdr! tail (cdr lst))))
ans)
(set-cdr! tail (list (car lst))))))))
;;;; CONDITIONALS ;;;; CONDITIONALS
;@ ;@
(define (and? . args) (define (and? . args)
(cond ((null? args) #t) (cond ((null? args) #t)
((car args) (apply comlist:and? (cdr args))) ((car args) (apply comlist:and? (cdr args)))
(else #f))) (else #f)))
;@ ;@
(define (or? . args) (define (or? . args)
(cond ((null? args) #f) (cond ((null? args) #f)
((car args) #t) ((car args) #t)
skipping to change at line 327 skipping to change at line 342
(define comlist:member-if member-if) (define comlist:member-if member-if)
;;(define comlist:remove remove) ;;(define comlist:remove remove)
;;(define comlist:remove-if remove-if) ;;(define comlist:remove-if remove-if)
;;(define comlist:remove-if-not remove-if-not) ;;(define comlist:remove-if-not remove-if-not)
(define comlist:nconc nconc) (define comlist:nconc nconc)
;;(define comlist:nreverse nreverse) ;;(define comlist:nreverse nreverse)
;;(define comlist:last last) ;;(define comlist:last last)
;;(define comlist:butlast butlast) ;;(define comlist:butlast butlast)
(define comlist:nthcdr nthcdr) (define comlist:nthcdr nthcdr)
(define comlist:butnthcdr butnthcdr) (define comlist:butnthcdr butnthcdr)
(define comlist:butnth butnth)
(define comlist:and? and?) (define comlist:and? and?)
(define comlist:or? or?) (define comlist:or? or?)
(define comlist:has-duplicates? has-duplicates?) (define comlist:has-duplicates? has-duplicates?)
;;(define comlist:remove-duplicates remove-duplicates) ;;(define comlist:remove-duplicates remove-duplicates)
;;(define comlist:delete-if-not delete-if-not) ;;(define comlist:delete-if-not delete-if-not)
;;(define comlist:delete-if delete-if) ;;(define comlist:delete-if delete-if)
;;(define comlist:delete delete) ;;(define comlist:delete delete)
;;(define comlist:atom? atom?) ;;(define comlist:atom? atom?)
;;(define atom atom?) ;;(define atom atom?)
;;(define comlist:atom atom?) ;;(define comlist:atom atom?)
 End of changes. 2 change blocks. 
0 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)