1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

Inline SRFI-9 constructors too.

* module/srfi/srfi-9.scm (define-record-type)[constructor]: Use
  `define-inlinable' instead of `define'.

* test-suite/lib.scm (exception:syntax-pattern-unmatched): New variable.

* test-suite/tests/srfi-9.test ("constructor")["foo 0 args (inline)",
  "foo 2 args (inline)"]: New tests.
  ["foo 0 args", "foo 2 args"]: Adjust to constructor inlining.

* testsuite/t-records.scm: Remove wrong-arg-count case.
This commit is contained in:
Ludovic Courtès 2010-01-30 22:54:20 +01:00
parent 61cbfff509
commit 30a700c8c1
4 changed files with 21 additions and 7 deletions

View file

@ -1,6 +1,6 @@
;;; srfi-9.scm --- define-record-type
;; Copyright (C) 2001, 2002, 2006, 2009 Free Software Foundation, Inc.
;; Copyright (C) 2001, 2002, 2006, 2009, 2010 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
@ -119,7 +119,7 @@
(ctor-args (map (lambda (field)
(cons (syntax->datum field) field))
#'(field ...))))
#`(define #,constructor-spec
#`(define-inlinable #,constructor-spec
(make-struct #,type-name 0
#,@(unfold
(lambda (field-num)