Skip to content

Commit

Permalink
N-am chef de comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaimaruseac committed Dec 10, 2010
1 parent 0a3585e commit 26d6890
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion MaruseacMihai_341C3.scm
Expand Up @@ -7,14 +7,17 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; GLOBAL AUXILIARY FUNCS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; first, convert to Haskel-ish notations
(require srfi/1)
(define (oldtake l n) (take l n))
(define (olddrop l n) (drop l n))

; some auxiliary functions, used below
(define (nub-aux l seen) (if (null? l) seen (if (elem? (car l) seen) (nub-aux (cdr l) seen) (nub-aux (cdr l) (cons (car l) seen)))))
(define (andList l) (foldl (lambda (x y) (and x y)) #t l))
(define (orList l) (foldl (lambda (x y) (and x y)) #f l))
(define (stringCompare s1 s2) (string<? s1 s2))

(define (take n l) (oldtake l n))
(define (drop n l) (olddrop l n))
(define (head l) (if (null? l) '() (car l)))
Expand Down

0 comments on commit 26d6890

Please sign in to comment.