diff --git a/tekuti/git.scm b/tekuti/git.scm index aac6a6e..96e7383 100644 --- a/tekuti/git.scm +++ b/tekuti/git.scm @@ -334,11 +334,15 @@ (define (with-output-to-blob* thunk) (git-hash-object (with-output-to-string thunk))) -(define-macro (with-output-to-blob . forms) - `(,with-output-to-blob* (lambda () ,@forms))) +(define-syntax with-output-to-blob + (syntax-rules () + ((_ f f* ...) + (with-output-to-blob* (lambda () f f* ...))))) (define (with-input-from-blob* sha1 thunk) (with-input-from-string (git "show" sha1) thunk)) -(define-macro (with-input-from-blob sha1 . forms) - `(,with-input-from-blob* ,sha1 (lambda () ,@forms))) +(define-syntax with-input-from-blob + (syntax-rules () + ((_ sha1 f f* ...) + (with-input-from-blob* sha1 (lambda () f f* ...))))) diff --git a/tekuti/match-bind.scm b/tekuti/match-bind.scm index c3f87e7..35a28b4 100644 --- a/tekuti/match-bind.scm +++ b/tekuti/match-bind.scm @@ -113,6 +113,7 @@ Here is a short example: ((_ regex str vars consequent) #'(match-bind regex str vars consequent (if #f #f))) ((_ regex str vars consequent alternate) + (string? (syntax->datum #'regex)) (let ((m #'m)) (with-syntax ((m m) (((var val) ...) diff --git a/tekuti/util.scm b/tekuti/util.scm index 025a180..9b86a30 100644 --- a/tekuti/util.scm +++ b/tekuti/util.scm @@ -97,13 +97,12 @@ (define-syntax match-lines (syntax-rules () ((_ string pattern bindings expr) - (let ((rx (irregex pattern))) - (fold - (lambda (line seed) - (match-bind rx line bindings - (cons expr seed) - seed)) - '() (string-split string #\newline)))))) + (fold + (lambda (line seed) + (match-bind pattern line bindings + (cons expr seed) + seed)) + '() (string-split string #\newline))))) (define (dbg fmt . args) (apply format (current-error-port) fmt args))