summaryrefslogtreecommitdiff
path: root/module/srfi
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-01-05 15:18:16 +0100
committerAndy Wingo <wingo@pobox.com>2018-01-05 15:18:16 +0100
commit7486806ba3981df0a862054054fee2f41731329f (patch)
treebf2fb9894e3be512a0c69e05c47788525f5dc1ec /module/srfi
parenta8210424803ffb777325bb4b8d2e358685a634be (diff)
downloadguile-7486806ba3981df0a862054054fee2f41731329f.tar.gz
Improve compilation of make-vector without init
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Add expansion for one-argument make-vector.
Diffstat (limited to 'module/srfi')
-rw-r--r--module/srfi/srfi-43.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/module/srfi/srfi-43.scm b/module/srfi/srfi-43.scm
index 153b0cbcd..e1bf19e9d 100644
--- a/module/srfi/srfi-43.scm
+++ b/module/srfi/srfi-43.scm
@@ -1,6 +1,6 @@
;;; srfi-43.scm -- SRFI 43 Vector library
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2018 Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@@ -41,10 +41,14 @@
(cond-expand-provide (current-module) '(srfi-43))
-(define (error-from who msg . args)
- (apply error
- (string-append (symbol->string who) ": " msg)
- args))
+(define-syntax error-from
+ (lambda (stx)
+ (syntax-case stx (quote)
+ ((_ 'who msg arg ...)
+ #`(error #,(string-append (symbol->string (syntax->datum #'who))
+ ": "
+ (syntax->datum #'msg))
+ arg ...)))))
(define-syntax-rule (assert-nonneg-exact-integer k who)
(unless (and (exact-integer? k)