15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
(string->number (alist-ref "event_time" item equal?))))
dat)))
(sorted (sort name-time (lambda (a b)(> (cdr a)(cdr b)))))
(last-name (if (null? sorted)
#f
(caar sorted))))
last-name))))
;; example of how to set up and write target mappers
;;
(define *target-mappers*
`((prefix-contour . ,(lambda (target run-name area area-path reason contour mode-patt)
(conc contour "/" target)))
(prefix-area-contour . ,(lambda (target run-name area area-path reason contour mode-patt)
(conc area "/" contour "/" target)))))
(define *runname-mappers*
`((corporate-ww . ,(lambda (target run-name area area-path reason contour mode-patt)
(let* ((last-name (get-last-runname area-path target))
(last-letter (if (string? last-name)
(let ((len (string-length last-name)))
(substring last-name (- len 1) len))
"a"))
(next-letter (list->string (list (integer->char (+ (char->integer (string-ref last-letter 0)) 1)))))) ;; surely there is an easier way?
(conc (seconds->wwdate (current-seconds)) next-letter))))))
|
|
|
>
|
|
>
>
|
|
|
>
|
|
|
|
|
|
>
>
>
|
>
|
>
>
>
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
(string->number (alist-ref "event_time" item equal?))))
dat)))
(sorted (sort name-time (lambda (a b)(> (cdr a)(cdr b)))))
(last-name (if (null? sorted)
#f
(caar sorted))))
last-name))))
;; example of how to set up and write target mappers
;;
(hash-table-set! *target-mappers*
'prefix-contour
(lambda (target run-name area area-path reason contour mode-patt)
(conc contour "/" target)))
(hash-table-set! *target-mappers*
'prefix-area-contour
(lambda (target run-name area area-path reason contour mode-patt)
(conc area "/" contour "/" target)))
(hash-table-set! *runname-mappers*
'corporate-ww
(lambda (target run-name area area-path reason contour mode-patt)
(let* ((last-name (get-last-runname area-path target))
(last-letter (if (string? last-name)
(let ((len (string-length last-name)))
(substring last-name (- len 1) len))
"a"))
(next-letter (list->string
(list
(integer->char
(+ (char->integer (string-ref last-letter 0)) 1)))))) ;; surely there is an easier way?
;; (print "last-name: " last-name " last-letter: " last-letter " next-letter: " next-letter)
(conc (seconds->wwdate (current-seconds)) next-letter))))
(print "Got here!")
|