forked from vizziv/Dwimiykwim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.scm
31 lines (24 loc) · 935 Bytes
/
utils.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(declare (usual-integrations))
(define (identity x) x)
(define (any? x) #t)
(define (compose f g)
(lambda args
(f (apply g args))))
(define (partial-apply f . args)
(lambda more-args
(apply f (append args more-args))))
(define (list-of-twos->two-lists pairs)
(list (map car pairs) (map cadr pairs)))
;;; This is to keep the Scheme printer from going into an infinite
;;; loop if you try to print a circular data structure, such as an
;;; environment. This is complicated by the fact that there was
;;; a recent change to MIT/GNU system fluid variables, and this must
;;; work in multiple versions. Sorry!
(if (or (not *unparser-list-depth-limit*)
(number? *unparser-list-depth-limit*))
(begin
(set! *unparser-list-depth-limit* 10)
(set! *unparser-list-breadth-limit* 10))
(begin
(set-fluid! *unparser-list-depth-limit* 10)
(set-fluid! *unparser-list-breadth-limit* 10)))