untabify
This commit is contained in:
parent
89ba2d6aef
commit
838b9bf5f1
18
parking.scm
18
parking.scm
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
(define (sort-via less-than? fn ln)
|
(define (sort-via less-than? fn ln)
|
||||||
(sort ln (lambda (a b)
|
(sort ln (lambda (a b)
|
||||||
(less-than? (fn a) (fn b)))))
|
(less-than? (fn a) (fn b)))))
|
||||||
|
|
||||||
(define (display-newline str)
|
(define (display-newline str)
|
||||||
(display str)
|
(display str)
|
||||||
@ -36,16 +36,16 @@
|
|||||||
|
|
||||||
(define (->string a)
|
(define (->string a)
|
||||||
(cond ((string? a) a)
|
(cond ((string? a) a)
|
||||||
((symbol? a) (symbol->string a))
|
((symbol? a) (symbol->string a))
|
||||||
((number? a) (number->string a))
|
((number? a) (number->string a))
|
||||||
((char? a) (string a))))
|
((char? a) (string a))))
|
||||||
|
|
||||||
(define (format-assoc statement ln)
|
(define (format-assoc statement ln)
|
||||||
(apply string-append
|
(apply string-append
|
||||||
(map (lambda (directive)
|
(map (lambda (directive)
|
||||||
(if (symbol? directive)
|
(if (symbol? directive)
|
||||||
(->string (value directive ln))
|
(->string (value directive ln))
|
||||||
directive)) statement)))
|
directive)) statement)))
|
||||||
|
|
||||||
(define (simple-json-request uri)
|
(define (simple-json-request uri)
|
||||||
(with-input-from-request uri #f read-json))
|
(with-input-from-request uri #f read-json))
|
||||||
@ -70,6 +70,6 @@
|
|||||||
(display-newline "Parking spaces available:")
|
(display-newline "Parking spaces available:")
|
||||||
(let ((lots (sort-via string-ci<? (curry value 'Name) (get-parking-lots))))
|
(let ((lots (sort-via string-ci<? (curry value 'Name) (get-parking-lots))))
|
||||||
(map (compose display-newline (curry format-assoc '(Name ": " ParkingSpacesAvailable "/" ParkingSpaces)))
|
(map (compose display-newline (curry format-assoc '(Name ": " ParkingSpacesAvailable "/" ParkingSpaces)))
|
||||||
(filter (conjoin computerized? (complement only-has-handicap-spots?)) lots))))
|
(filter (conjoin computerized? (complement only-has-handicap-spots?)) lots))))
|
||||||
|
|
||||||
(main)
|
(main)
|
||||||
|
Loading…
Reference in New Issue
Block a user