From 2fb88465f7a25b1eac0cdbb78a05de9e78e68bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 23 Jun 2022 04:14:46 +0200 Subject: Normalize keyword syntax. --- module/calp/entry-points/text.scm | 3 +- module/calp/html/view/calendar/month.scm | 6 +- module/calp/html/view/calendar/week.scm | 3 +- module/calp/main.scm | 2 +- module/calp/terminal.scm | 59 ++++++------- module/calp/translation.scm | 3 +- module/crypto.scm | 6 +- module/datetime.scm | 7 +- module/hnh/util.scm | 136 +++++++++++++++--------------- module/hnh/util/exceptions.scm | 10 +-- module/hnh/util/tree.scm | 16 ++-- module/srfi/srfi-41/util.scm | 38 ++++----- module/sxml/html.scm | 15 ++-- module/text/flow.scm | 13 +-- module/text/numbers.scm | 5 +- module/vcomponent/base.scm | 5 +- module/vcomponent/control.scm | 6 +- module/vcomponent/datetime.scm | 40 ++++----- module/vcomponent/formats/ical/output.scm | 3 +- module/vcomponent/recurrence.scm | 12 +-- module/vcomponent/recurrence/display.scm | 3 +- module/vcomponent/recurrence/internal.scm | 20 ++--- module/vcomponent/recurrence/parse.scm | 24 +++--- module/vcomponent/util/control.scm | 6 +- module/vcomponent/util/group.scm | 16 ++-- module/vulgar.scm | 8 +- module/vulgar/components.scm | 6 +- module/vulgar/termios.scm | 7 +- module/web/http/make-routes.scm | 7 +- scripts/fetch-liu-map-index.scm | 3 +- scripts/use2dot/graphviz.scm | 108 ++++++++++++------------ tests/validate-html/run-validator.scm | 5 +- 32 files changed, 310 insertions(+), 291 deletions(-) diff --git a/module/calp/entry-points/text.scm b/module/calp/entry-points/text.scm index 921afb80..775245eb 100644 --- a/module/calp/entry-points/text.scm +++ b/module/calp/entry-points/text.scm @@ -6,6 +6,7 @@ :use-module (hnh util options) :use-module (calp translation) :use-module (sxml simple) + :use-module (srfi srfi-88) ) @@ -31,4 +32,4 @@ (current-input-port) (open-input-file fname))) (@ (ice-9 rdelim) read-string)) - #:width (or (string->number (option-ref opts 'width "")) 70)))) + width: (or (string->number (option-ref opts 'width "")) 70)))) diff --git a/module/calp/html/view/calendar/month.scm b/module/calp/html/view/calendar/month.scm index a19fcdb5..d7cd24ae 100644 --- a/module/calp/html/view/calendar/month.scm +++ b/module/calp/html/view/calendar/month.scm @@ -3,6 +3,7 @@ :use-module (srfi srfi-1) :use-module (srfi srfi-41) :use-module (srfi srfi-41 util) + :use-module (srfi srfi-88) :use-module (datetime) :use-module (calp html view calendar shared) :use-module (calp html config) @@ -19,7 +20,10 @@ ) ;; (stream event-group) -> sxml -(define* (render-calendar-table key: events start-date end-date pre-start post-end #:allow-other-keys) +(define* (render-calendar-table key: events + start-date end-date + pre-start post-end + allow-other-keys:) (define-values (long-events short-events) ;; TODO should be really-long-event? or event-spanning-midnight diff --git a/module/calp/html/view/calendar/week.scm b/module/calp/html/view/calendar/week.scm index 828dce41..ef630c36 100644 --- a/module/calp/html/view/calendar/week.scm +++ b/module/calp/html/view/calendar/week.scm @@ -3,6 +3,7 @@ :use-module (srfi srfi-1) :use-module (srfi srfi-41) :use-module (srfi srfi-71) + :use-module (srfi srfi-88) :use-module (rnrs records syntactic) :use-module (datetime) :use-module (calp html view calendar shared) @@ -26,7 +27,7 @@ ) -(define* (render-calendar key: calendars events start-date end-date #:allow-other-keys) +(define* (render-calendar key: calendars events start-date end-date allow-other-keys:) (let* ((long-events short-events (partition long-event? (stream->list (events-between start-date end-date events)))) (range (date-range start-date end-date))) `((script ,(lambda () (format #t "window.VIEW='week';"))) diff --git a/module/calp/main.scm b/module/calp/main.scm index d97d3d76..827dbf4e 100644 --- a/module/calp/main.scm +++ b/module/calp/main.scm @@ -104,7 +104,7 @@ zoneinfo database, but is currently broken.

") b a)) (define (wrapped-main args) - (define opts (getopt-long args (getopt-opt options) #:stop-at-first-non-option #t)) + (define opts (getopt-long args (getopt-opt options) stop-at-first-non-option: #t)) (define stprof (option-ref opts 'statprof #f)) (define repl (option-ref opts 'repl #f)) (define altconfig (option-ref opts 'config #f)) diff --git a/module/calp/terminal.scm b/module/calp/terminal.scm index e74c5fb8..8f1b7fa9 100644 --- a/module/calp/terminal.scm +++ b/module/calp/terminal.scm @@ -1,36 +1,37 @@ (define-module (calp terminal) - #:use-module (srfi srfi-1) - #:use-module (datetime) - #:use-module (srfi srfi-17) - #:use-module (srfi srfi-26) - #:use-module ((srfi srfi-41) :select (stream-car)) - #:use-module (hnh util) - #:use-module (vulgar) - #:use-module (vulgar info) - #:use-module (vulgar color) - #:use-module (vulgar components) + :use-module (srfi srfi-1) + :use-module (datetime) + :use-module (srfi srfi-17) + :use-module (srfi srfi-26) + :use-module ((srfi srfi-41) :select (stream-car)) + :use-module (srfi srfi-88) + :use-module (hnh util) + :use-module (vulgar) + :use-module (vulgar info) + :use-module (vulgar color) + :use-module (vulgar components) - #:use-module (vcomponent) - #:use-module (vcomponent datetime) - #:use-module (vcomponent util search) - #:use-module (vcomponent util group) + :use-module (vcomponent) + :use-module (vcomponent datetime) + :use-module (vcomponent util search) + :use-module (vcomponent util group) - #:use-module (text util) - #:use-module (text flow) + :use-module (text util) + :use-module (text flow) - #:use-module (ice-9 format) - #:use-module (ice-9 readline) - #:use-module (ice-9 match) + :use-module (ice-9 format) + :use-module (ice-9 readline) + :use-module (ice-9 match) - #:use-module (vulgar termios) + :use-module (vulgar termios) - #:use-module (oop goops) - #:use-module (oop goops describe) - #:use-module (calp translation) + :use-module (oop goops) + :use-module (oop goops describe) + :use-module (calp translation) - #:autoload (vcomponent util instance) (global-event-object) + :autoload (vcomponent util instance) (global-event-object) - #:export (main-loop)) + :export (main-loop)) ;;; TODO change all hard coded escape sequences to proper markup @@ -45,7 +46,7 @@ (reduce (lambda (str done) (string-append done (string intersection) str)) "" (map (cut make-string <> line) lengths))) -(define* (display-event-table events #:key +(define* (display-event-table events key: (active-element -1) ;; (summary-width 30) (date-width 17) @@ -168,7 +169,7 @@ (date->string start)))) (format #t "~a~%" (unlines (take-to (flow-text (or (prop ev 'DESCRIPTION) "") - #:width (min 70 width)) + width: (min 70 width)) (- height 8 5 (length events) 5))))))) (define (get-line prompt) @@ -268,8 +269,8 @@ ;; display event list (display-event-table page - #:active-element (active-element this) - #:location-width 15) + active-element: (active-element this) + location-width: 15) (paginator->sub-list paginator (current-page this) diff --git a/module/calp/translation.scm b/module/calp/translation.scm index 77c947da..67189e7a 100644 --- a/module/calp/translation.scm +++ b/module/calp/translation.scm @@ -2,6 +2,7 @@ :use-module (ice-9 i18n) :use-module (ice-9 regex) :use-module (ice-9 match) + :use-module (srfi srfi-88) :export (_ translate yes-no-check)) (bindtextdomain "calp" "/home/hugo/code/calp/localization/") @@ -20,7 +21,7 @@ (define (_ . msg) (translate (string-join msg))) -(define* (yes-no-check string #:optional (locale %global-locale)) +(define* (yes-no-check string optional: (locale %global-locale)) (cond ((string-match (locale-yes-regexp locale) string) 'yes) ((string-match (locale-no-regexp locale) string) 'no) (else #f))) diff --git a/module/crypto.scm b/module/crypto.scm index 477014e9..df71ffbb 100644 --- a/module/crypto.scm +++ b/module/crypto.scm @@ -2,6 +2,7 @@ :use-module (rnrs bytevectors) :use-module (system foreign) :use-module (ice-9 format) + :use-module (srfi srfi-88) :export (sha256 checksum->string)) (define-once libcrypto (dynamic-link "libcrypto")) @@ -30,7 +31,6 @@ ((@ (system foreign) bytevector->pointer) md)) md) -(define* (checksum->string md #:optional port) - ((@ (ice-9 format) format) port - "~{~2'0x~}" (bytevector->u8-list md))) +(define* (checksum->string md optional: port) + (format port "~{~2'0x~}" (bytevector->u8-list md))) diff --git a/module/datetime.scm b/module/datetime.scm index de1495ec..e3d0a462 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -5,13 +5,14 @@ :use-module (srfi srfi-1) :use-module (srfi srfi-9) :use-module (srfi srfi-9 gnu) + :use-module (srfi srfi-41) :use-module (srfi srfi-71) + :use-module (srfi srfi-88) :use-module ((hnh util) :select (vector-last set! -> ->> swap case* set span-upto set->)) - :use-module (srfi srfi-41) :use-module (ice-9 i18n) :use-module (ice-9 format) :use-module (ice-9 regex) @@ -420,10 +421,10 @@ (define (datetime-max a b) (if (datetime< a b) b a)) -(define* (month+ date-object #:optional (change 1)) +(define* (month+ date-object optional: (change 1)) (date+ date-object (date month: change))) -(define* (month- date-object #:optional (change 1)) +(define* (month- date-object optional: (change 1)) (date- date-object (date month: change))) ;; https://projecteuclid.org/euclid.acta/1485888738 diff --git a/module/hnh/util.scm b/module/hnh/util.scm index 1e79781f..b0e6b81a 100644 --- a/module/hnh/util.scm +++ b/module/hnh/util.scm @@ -1,69 +1,69 @@ (define-module (hnh util) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-71) - #:use-module (srfi srfi-88) ; postfix keywords - #:use-module ((sxml fold) #:select (fold-values)) - #:use-module ((srfi srfi-9 gnu) #:select (set-fields)) - #:re-export (fold-values) - #:export (aif - awhen - for - begin1 - print-and-return - swap - case* - set/r! - label - sort* sort*! - find-extreme find-min find-max - filter-sorted - != - take-to - string-take-to - string-first - string-last - as-symb - enumerate - unval - flatten - let-lazy - map/dotted - - assq-merge - kvlist->assq - assq-limit - - group-by - split-by - - span-upto - cross-product - - string-flatten - intersperse - insert-ordered - - -> ->> - set set-> - and=>> - - downcase-symbol - group - iterate - valued-map - - assoc-ref-all - assq-ref-all - assv-ref-all - - vector-last - - ->str ->string ->quoted-string - - catch* - ) - #:replace (set! define-syntax - when unless)) + :use-module (srfi srfi-1) + :use-module (srfi srfi-71) + :use-module (srfi srfi-88) ; postfix keywords + :use-module ((sxml fold) :select (fold-values)) + :use-module ((srfi srfi-9 gnu) :select (set-fields)) + :re-export (fold-values) + :export (aif + awhen + for + begin1 + print-and-return + swap + case* + set/r! + label + sort* sort*! + find-extreme find-min find-max + filter-sorted + != + take-to + string-take-to + string-first + string-last + as-symb + enumerate + unval + flatten + let-lazy + map/dotted + + assq-merge + kvlist->assq + assq-limit + + group-by + split-by + + span-upto + cross-product + + string-flatten + intersperse + insert-ordered + + -> ->> + set set-> + and=>> + + downcase-symbol + group + iterate + valued-map + + assoc-ref-all + assq-ref-all + assv-ref-all + + vector-last + + ->str ->string ->quoted-string + + catch* + ) + :replace (set! define-syntax + when unless)) ((@ (guile) define-syntax) define-syntax (syntax-rules () @@ -212,14 +212,14 @@ ;; This function borrowed from web-ics (calendar util) -(define* (sort* items comperator #:optional (get identity)) +(define* (sort* items comperator optional: (get identity)) "A sort function more in line with how python's sorted works" (sort items (lambda (a b) (comperator (get a) (get b))))) ;; Sorts the list @var{items}. @emph{May} destroy the input list in the process -(define* (sort*! items comperator #:optional (get identity)) +(define* (sort*! items comperator optional: (get identity)) "A sort function more in line with how python's sorted works" (sort! items (lambda (a b) (comperator (get a) @@ -284,7 +284,7 @@ ;; Takes a procedure returning multiple values, and returns a procedure which ;; takes the same arguments as the original procedure, but only returns one of ;; the return values. Which value to return can be sent as an additional parameter. -(define* (unval proc #:optional (n 0)) +(define* (unval proc optional: (n 0)) (lambda args (call-with-values (lambda () (apply proc args)) (lambda args (list-ref args n))))) diff --git a/module/hnh/util/exceptions.scm b/module/hnh/util/exceptions.scm index 36b018d1..344eb27a 100644 --- a/module/hnh/util/exceptions.scm +++ b/module/hnh/util/exceptions.scm @@ -1,10 +1,10 @@ (define-module (hnh util exceptions) - #:use-module (srfi srfi-1) - #:use-module (hnh util) - #:use-module (ice-9 format) + :use-module (srfi srfi-1) + :use-module (hnh util) + :use-module (ice-9 format) - #:use-module ((system vm frame) - :select (frame-bindings binding-ref)) + :use-module ((system vm frame) + :select (frame-bindings binding-ref)) :export (warning-handler warnings-are-errors diff --git a/module/hnh/util/tree.scm b/module/hnh/util/tree.scm index 34e10365..8b41609b 100644 --- a/module/hnh/util/tree.scm +++ b/module/hnh/util/tree.scm @@ -1,12 +1,12 @@ (define-module (hnh util tree) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-71) - #:use-module (hnh util) - #:export (make-tree left-subtree - right-subtree - tree-node - length-of-longst-branch - tree-map)) + :use-module (srfi srfi-1) + :use-module (srfi srfi-71) + :use-module (hnh util) + :export (make-tree left-subtree + right-subtree + tree-node + length-of-longst-branch + tree-map)) ;; Constructs a binary tree where each node's children is partitioned ;; into a left and right branch using @var{pred?}. diff --git a/module/srfi/srfi-41/util.scm b/module/srfi/srfi-41/util.scm index bc7a480d..d938ec4e 100644 --- a/module/srfi/srfi-41/util.scm +++ b/module/srfi/srfi-41/util.scm @@ -1,23 +1,23 @@ (define-module (srfi srfi-41 util) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-41) - #:use-module (srfi srfi-71) - #:use-module ((ice-9 sandbox) :select (call-with-time-limit)) - #:use-module (hnh util) ; find-min - #:export (stream-car+cdr - interleave-streams - stream-insert - filter-sorted-stream - filter-sorted-stream* - get-stream-interval - stream-find - stream-remove - stream->values - repeating-naturals - stream-partition - stream-split - stream-paginate - stream-timeslice-limit)) + :use-module (srfi srfi-1) + :use-module (srfi srfi-41) + :use-module (srfi srfi-71) + :use-module ((ice-9 sandbox) :select (call-with-time-limit)) + :use-module (hnh util) ; find-min + :export (stream-car+cdr + interleave-streams + stream-insert + filter-sorted-stream + filter-sorted-stream* + get-stream-interval + stream-find + stream-remove + stream->values + repeating-naturals + stream-partition + stream-split + stream-paginate + stream-timeslice-limit)) (define (stream-car+cdr stream) (values (stream-car stream) diff --git a/module/sxml/html.scm b/module/sxml/html.scm index 473cfd9e..88dfa5b8 100644 --- a/module/sxml/html.scm +++ b/module/sxml/html.scm @@ -17,12 +17,13 @@ ;; https://dthompson.us/rendering-html-with-sxml-and-gnu-guile.html (define-module (sxml html) - #:use-module (sxml simple) - #:use-module (srfi srfi-26) - #:use-module (ice-9 match) - #:use-module (ice-9 format) - #:use-module (ice-9 hash-table) - #:export (sxml->html)) + :use-module (sxml simple) + :use-module (srfi srfi-26) + :use-module (srfi srfi-88) + :use-module (ice-9 match) + :use-module (ice-9 format) + :use-module (ice-9 hash-table) + :export (sxml->html)) (define %void-elements '(area @@ -350,7 +351,7 @@ ist ATTRS and the child nodes in BODY." (define (pi->html type body port) (format port "" type body)) -(define* (sxml->html tree #:optional (port (current-output-port))) +(define* (sxml->html tree optional: (port (current-output-port))) "Write the serialized HTML form of TREE to PORT." (match tree (() *unspecified*) diff --git a/module/text/flow.scm b/module/text/flow.scm index 315bea06..77f39a9f 100644 --- a/module/text/flow.scm +++ b/module/text/flow.scm @@ -8,21 +8,22 @@ :use-module (text util) :use-module (srfi srfi-1) :use-module (srfi srfi-71) + :use-module (srfi srfi-88) :export (flow-text)) ;; str -> (str) -(define* (flow-text str #:key (width 70)) +(define* (flow-text str key: (width 70)) (flatten - (map (lambda (line) (justify-line line #:width width)) + (map (lambda (line) (justify-line line width: width)) (lines str)))) -;; Splits and justifies the given line to @var{#:width}. +;; Splits and justifies the given line to @var{width:}. ;; Returns a list of justified strings. ;; str -> (str) -(define* (justify-line line #:key (width 70)) +(define* (justify-line line key: (width 70)) (let recur ((lst (words line))) (let ((head tail (span (let ((w 0)) @@ -36,11 +37,11 @@ ;; than our max width. Add it as is and continue ;; (while crying). (cons (car tail) (recur (cdr tail)))) - (else (cons (justify-line-helper head #:width width) + (else (cons (justify-line-helper head width: width) (recur tail))))))) ;; (str) -> str -(define* (justify-line-helper words #:key (width 70)) +(define* (justify-line-helper words key: (width 70)) (let* ((phrase-length (true-string-length (string-concatenate/shared words))) (needed-spaces (- width phrase-length)) (slots (1- (length words))) diff --git a/module/text/numbers.scm b/module/text/numbers.scm index 168d267e..c45016bc 100644 --- a/module/text/numbers.scm +++ b/module/text/numbers.scm @@ -1,4 +1,5 @@ (define-module (text numbers) + :use-module (srfi srfi-88) :export (number->string-cardinal number->string-ordinal each-string)) @@ -17,11 +18,11 @@ 2))) (define* (number->string-cardinal - n #:optional (language (resolve-language))) + n optional: (language (resolve-language))) ((get language 'number->string-cardinal) n)) (define* (number->string-ordinal - n #:optional (language (resolve-language))) + n optional: (language (resolve-language))) ((get language 'number->string-ordinal) n)) ;; TODO change API to allow language, and stop having random extra diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index e79a4d5c..b62d45c2 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -4,6 +4,7 @@ :use-module (srfi srfi-9) :use-module (srfi srfi-9 gnu) :use-module (srfi srfi-17) + :use-module (srfi srfi-88) :use-module (ice-9 hash-table) :export (make-vline vline? @@ -70,7 +71,7 @@ (make-procedure-with-setter get-source set-source!)) -(define* (make-vline key value #:optional (ht (make-hash-table))) +(define* (make-vline key value optional: (ht (make-hash-table))) (make-vline% key value ht)) (define-record-type @@ -94,7 +95,7 @@ (make-procedure-with-setter get-component-parent set-component-parent!)) -(define* (make-vcomponent #:optional (type 'VIRTUAL)) +(define* (make-vcomponent optional: (type 'VIRTUAL)) (make-vcomponent% type '() #f (make-hash-table))) (define (add-child! parent child) diff --git a/module/vcomponent/control.scm b/module/vcomponent/control.scm index 63f1e1e3..0869543d 100644 --- a/module/vcomponent/control.scm +++ b/module/vcomponent/control.scm @@ -1,7 +1,7 @@ (define-module (vcomponent util control) - #:use-module (hnh util) - #:use-module (vcomponent) - #:export (with-replaced-properties)) + :use-module (hnh util) + :use-module (vcomponent) + :export (with-replaced-properties)) (eval-when (expand load) ; No idea why I must have load here. diff --git a/module/vcomponent/datetime.scm b/module/vcomponent/datetime.scm index 5fb1148c..73d74363 100644 --- a/module/vcomponent/datetime.scm +++ b/module/vcomponent/datetime.scm @@ -1,31 +1,31 @@ (define-module (vcomponent datetime) - #:use-module (srfi srfi-1) - #:use-module (vcomponent base) - #:use-module (datetime) - #:use-module (datetime timespec) - #:use-module (datetime zic) - #:use-module (hnh util) + :use-module (srfi srfi-1) + :use-module (vcomponent base) + :use-module (datetime) + :use-module (datetime timespec) + :use-module (datetime zic) + :use-module (hnh util) :use-module (ice-9 curried-definitions) - #:export (#;parse-datetime - event-overlaps? - overlapping? - event-contains? - event-zero-length? - ev-timevtimezone - )) + zoneinfo->vtimezone + )) ;;; date time pointer #; diff --git a/module/vcomponent/formats/ical/output.scm b/module/vcomponent/formats/ical/output.scm index fbb9c862..da891fa6 100644 --- a/module/vcomponent/formats/ical/output.scm +++ b/module/vcomponent/formats/ical/output.scm @@ -10,6 +10,7 @@ :use-module (srfi srfi-1) :use-module (srfi srfi-41) :use-module (srfi srfi-41 util) + :use-module (srfi srfi-88) :use-module (vcomponent) :use-module (vcomponent datetime) :use-module (vcomponent geo) @@ -118,7 +119,7 @@ ;; not a problem. ;; Setting the wrap-len to slightly lower than allowed also help ;; us not overshoot. -(define* (ical-line-fold string #:key (wrap-len 70)) +(define* (ical-line-fold string key: (wrap-len 70)) (cond [(< wrap-len (string-length string)) (format #f "~a\r\n ~a" (string-take string wrap-len) diff --git a/module/vcomponent/recurrence.scm b/module/vcomponent/recurrence.scm index 29cbbc64..ffda0e7f 100644 --- a/module/vcomponent/recurrence.scm +++ b/module/vcomponent/recurrence.scm @@ -1,7 +1,7 @@ (define-module (vcomponent recurrence) - #:use-module (vcomponent recurrence generate) - #:use-module (vcomponent recurrence parse) - #:use-module (vcomponent recurrence internal) - #:re-export (generate-recurrence-set - parse-recurrence-rule - repeating? make-recur-rule)) + :use-module (vcomponent recurrence generate) + :use-module (vcomponent recurrence parse) + :use-module (vcomponent recurrence internal) + :re-export (generate-recurrence-set + parse-recurrence-rule + repeating? make-recur-rule)) diff --git a/module/vcomponent/recurrence/display.scm b/module/vcomponent/recurrence/display.scm index 8a9f33e6..8aa9f506 100644 --- a/module/vcomponent/recurrence/display.scm +++ b/module/vcomponent/recurrence/display.scm @@ -1,10 +1,11 @@ (define-module (vcomponent recurrence display) :use-module (vcomponent recurrence display common) :use-module (hnh util language) + :use-module (srfi srfi-88) :re-export (rrule-month->string) :export (format-recurrence-rule)) -(define* (format-recurrence-rule rrule #:optional (language (resolve-language))) +(define* (format-recurrence-rule rrule optional: (language (resolve-language))) ((module-ref (resolve-interface `(vcomponent recurrence display ,language)) 'format-recurrence-rule) rrule)) diff --git a/module/vcomponent/recurrence/internal.scm b/module/vcomponent/recurrence/internal.scm index 9cb6b115..94c4cccf 100644 --- a/module/vcomponent/recurrence/internal.scm +++ b/module/vcomponent/recurrence/internal.scm @@ -1,14 +1,14 @@ (define-module (vcomponent recurrence internal) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-71) - #:use-module (srfi srfi-88) ; better keywords - #:use-module ((vcomponent base) :select (prop)) - #:use-module (ice-9 i18n) - #:use-module (srfi srfi-9) - #:use-module (srfi srfi-9 gnu) - #:use-module (ice-9 format) - #:use-module (hnh util) - #:use-module (datetime) + :use-module (srfi srfi-1) + :use-module (srfi srfi-71) + :use-module (srfi srfi-88) ; better keywords + :use-module ((vcomponent base) :select (prop)) + :use-module (ice-9 i18n) + :use-module (srfi srfi-9) + :use-module (srfi srfi-9 gnu) + :use-module (ice-9 format) + :use-module (hnh util) + :use-module (datetime) :replace (count) :export (repeating? diff --git a/module/vcomponent/recurrence/parse.scm b/module/vcomponent/recurrence/parse.scm index 91209dc7..12b6a622 100644 --- a/module/vcomponent/recurrence/parse.scm +++ b/module/vcomponent/recurrence/parse.scm @@ -1,16 +1,16 @@ (define-module (vcomponent recurrence parse) - #:duplicates (last) ; Replace @var{count} - - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-71) - #:use-module (datetime) - #:use-module (srfi srfi-26) - #:use-module (vcomponent recurrence internal) - #:use-module (hnh util) - #:use-module (hnh util exceptions) - #:use-module (ice-9 match) - - #:export (rfc->datetime-weekday + :duplicates (last) ; Replace @var{count} + + :use-module (srfi srfi-1) + :use-module (srfi srfi-71) + :use-module (datetime) + :use-module (srfi srfi-26) + :use-module (vcomponent recurrence internal) + :use-module (hnh util) + :use-module (hnh util exceptions) + :use-module (ice-9 match) + + :export (rfc->datetime-weekday parse-recurrence-rule)) diff --git a/module/vcomponent/util/control.scm b/module/vcomponent/util/control.scm index 63f1e1e3..0869543d 100644 --- a/module/vcomponent/util/control.scm +++ b/module/vcomponent/util/control.scm @@ -1,7 +1,7 @@ (define-module (vcomponent util control) - #:use-module (hnh util) - #:use-module (vcomponent) - #:export (with-replaced-properties)) + :use-module (hnh util) + :use-module (vcomponent) + :export (with-replaced-properties)) (eval-when (expand load) ; No idea why I must have load here. diff --git a/module/vcomponent/util/group.scm b/module/vcomponent/util/group.scm index 89ec47a1..4001c590 100644 --- a/module/vcomponent/util/group.scm +++ b/module/vcomponent/util/group.scm @@ -1,12 +1,12 @@ (define-module (vcomponent util group) - #:use-module (vcomponent) - #:use-module (vcomponent datetime) - #:use-module (datetime) - #:use-module (srfi srfi-41) - #:use-module (srfi srfi-41 util) - #:export (group-stream - get-groups-between - group->event-list)) + :use-module (vcomponent) + :use-module (vcomponent datetime) + :use-module (datetime) + :use-module (srfi srfi-41) + :use-module (srfi srfi-41 util) + :export (group-stream + get-groups-between + group->event-list)) ;; TODO templetize this (define-stream (group-stream in-stream) diff --git a/module/vulgar.scm b/module/vulgar.scm index ed24ee97..bbb030e5 100644 --- a/module/vulgar.scm +++ b/module/vulgar.scm @@ -5,10 +5,10 @@ ;;; Code: (define-module (vulgar) - #:use-module (srfi srfi-60) - #:use-module (vulgar termios) - #:use-module (hnh util) - #:export (cls set-cursor-pos with-vulgar)) + :use-module (srfi srfi-60) + :use-module (vulgar termios) + :use-module (hnh util) + :export (cls set-cursor-pos with-vulgar)) (define (cls) ;; [H]ome, [J]: clear everything after diff --git a/module/vulgar/components.scm b/module/vulgar/components.scm index 3242ec8c..74420f18 100644 --- a/module/vulgar/components.scm +++ b/module/vulgar/components.scm @@ -1,7 +1,7 @@ (define-module (vulgar components) - #:use-module (datetime) - #:use-module (hnh util) - #:export (display-calendar-header!)) + :use-module (datetime) + :use-module (hnh util) + :export (display-calendar-header!)) (define (display-calendar-header! date) (let ((day (number->string (day date))) diff --git a/module/vulgar/termios.scm b/module/vulgar/termios.scm index 713c9875..3486e000 100644 --- a/module/vulgar/termios.scm +++ b/module/vulgar/termios.scm @@ -6,6 +6,7 @@ :use-module (ice-9 format) :use-module (ice-9 rdelim) :use-module (srfi srfi-9) ; records + :use-module (srfi srfi-88) :use-module (c cpp) :use-module (hnh util) :export (make-termios @@ -49,7 +50,7 @@ (ptr as-ptr) (list as-list)) -(define* (make-termios #:optional (data (empty-values struct-termios))) +(define* (make-termios optional: (data (empty-values struct-termios))) (%make-termios (make-c-struct struct-termios data) data)) (define (copy-termios termios) @@ -156,7 +157,7 @@ (define-foreign (tcsetattr int int *) → int (dynamic-func "tcsetattr" lib)) -(define* (tcsetattr! termios #:optional +(define* (tcsetattr! termios optional: (port (current-input-port)) (when TCSANOW)) (with-termios termios (lambda (ptr) (tcsetattr (port->fdes port) when ptr)))) @@ -165,7 +166,7 @@ (define-foreign (tcgetattr int *) → int (dynamic-func "tcgetattr" lib)) -(define* (tcgetattr! termios #:optional (port (current-input-port))) +(define* (tcgetattr! termios optional: (port (current-input-port))) (with-termios termios (lambda (ptr) (tcgetattr (port->fdes port) ptr)))) diff --git a/module/web/http/make-routes.scm b/module/web/http/make-routes.scm index 3005200b..aa3be1ed 100644 --- a/module/web/http/make-routes.scm +++ b/module/web/http/make-routes.scm @@ -5,6 +5,7 @@ :use-module (ice-9 curried-definitions) :use-module (srfi srfi-1) :use-module (srfi srfi-71) + :use-module (srfi srfi-88) :export (parse-endpoint-string make-routes) ) @@ -53,8 +54,8 @@ ;; Those parameters which were present in the template uri ((lambda ,intersect ;; Those that only are in the query string - (lambda* (,@(unless (null? diff) `(#:key ,@diff #:allow-other-keys)) - #:rest rest) + (lambda* (,@(unless (null? diff) `(key: ,@diff allow-other-keys:)) + rest: rest) ,@body)) ,@(unless (null? intersect) (map (lambda (i) @@ -70,7 +71,7 @@ (map cadr routes))) `(let ,(map cdr routes-regexes) - (lambda* (request body #:optional state) + (lambda* (request body optional: state) ;; (format (current-error-port) "~a~%" request) ;; All these bindings generate compile time warnings since the expansion ;; of the macro might not use them. This isn't really a problem. diff --git a/scripts/fetch-liu-map-index.scm b/scripts/fetch-liu-map-index.scm index da012cf3..31db3844 100755 --- a/scripts/fetch-liu-map-index.scm +++ b/scripts/fetch-liu-map-index.scm @@ -11,6 +11,7 @@ ;;; Code: (use-modules (srfi srfi-1) + (srfi srfi-88) (web client) (web response) (ice-9 rdelim) @@ -51,7 +52,7 @@ ;; Open a HTTP request to the given URL, and return the ;; response body as a port. (define (open-input-url url) - (define-values (response body) (http-get url #:streaming? #t)) + (define-values (response body) (http-get url streaming?: #t)) (unless (= 200 (response-code response)) (format #t "Fetching index failed with ~a ~a~%" diff --git a/scripts/use2dot/graphviz.scm b/scripts/use2dot/graphviz.scm index 0c75f3ff..9355d723 100644 --- a/scripts/use2dot/graphviz.scm +++ b/scripts/use2dot/graphviz.scm @@ -16,68 +16,68 @@ ;;; https://github.com/roelj/graphviz-guile/blob/master/graphviz.scm (define-module (graphviz) - #:export (;; New graphs - graph - digraph - strictgraph - strictdigraph - readstring - read + :export (;; New graphs + graph + digraph + strictgraph + strictdigraph + readstring + read - ;; New nodes/edges - node - edge + ;; New nodes/edges + node + edge - ;; Setting/getting attribute values - setv - getv + ;; Setting/getting attribute values + setv + getv - ;; Finding and obtaining names - nameof - findsubg - findnode - findedge - findattr + ;; Finding and obtaining names + nameof + findsubg + findnode + findedge + findattr - ;; Graph navigators - headof - tailof - graphof - rootof + ;; Graph navigators + headof + tailof + graphof + rootof - ;; Obtain handles of proto node/edge for setting attribute values - protonode - protoedge + ;; Obtain handles of proto node/edge for setting attribute values + protonode + protoedge - ;; Iterators - ok - firstsubg - nextsubg - firstsupg - nextsupg - firstedge - nextedge - firstout - nextout - firsthead - nexthead - firstin - nextin - firstnode - nextnode - firstattr - nextattr + ;; Iterators + ok + firstsubg + nextsubg + firstsupg + nextsupg + firstedge + nextedge + firstout + nextout + firsthead + nexthead + firstin + nextin + firstnode + nextnode + firstattr + nextattr - ;; Remove graph objects - rm + ;; Remove graph objects + rm - ;; Layout - layout - render - renderresult - renderchannel - renderdata - write)) + ;; Layout + layout + render + renderresult + renderchannel + renderdata + write)) ;; (load-extension "libgv_guile.so" "SWIG_init") diff --git a/tests/validate-html/run-validator.scm b/tests/validate-html/run-validator.scm index 7e3c9f76..bd96c32d 100755 --- a/tests/validate-html/run-validator.scm +++ b/tests/validate-html/run-validator.scm @@ -14,6 +14,7 @@ exec $GUILE -e main -s "$0" -- "$@" (ice-9 regex) (ice-9 popen) (ice-9 format) + (srfi srfi-88 ((hnh util) :select (group-by ->))) (define (error-string error) @@ -63,8 +64,8 @@ exec $GUILE -e main -s "$0" -- "$@" "raw.xhtml" )) (define data (xml->sxml pipe - #:trim-whitespace? #t - #:namespaces + trim-whitespace?: #t + namespaces: '((nu . "http://n.validator.nu/messages/") (xhtml . "http://www.w3.org/1999/xhtml")))) (close-pipe pipe) -- cgit v1.2.3