mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
define-inlinable marks residualized procedure as maybe-unused
* module/ice-9/boot-9.scm (define-inlinable): * module/srfi/srfi-9.scm (define-tagged-inlinable): Add maybe-unused declaration. Also require at least one body expr, otherwise the metadata declaration could escape as the proc body.
This commit is contained in:
parent
1f70d597db
commit
19c7969fff
2 changed files with 9 additions and 7 deletions
|
@ -4608,21 +4608,22 @@ when none is available, reading FILE-NAME with READER."
|
|||
'-procedure)))
|
||||
|
||||
(syntax-case x ()
|
||||
((_ (name formals ...) body ...)
|
||||
((_ (name formals ...) body0 body ...)
|
||||
(identifier? #'name)
|
||||
(with-syntax ((proc-name (make-procedure-name #'name))
|
||||
((args ...) (generate-temporaries #'(formals ...))))
|
||||
#`(begin
|
||||
(define (proc-name formals ...)
|
||||
#((maybe-unused))
|
||||
(syntax-parameterize ((name (identifier-syntax proc-name)))
|
||||
body ...))
|
||||
body0 body ...))
|
||||
(define-syntax-parameter name
|
||||
(lambda (x)
|
||||
(syntax-case x ()
|
||||
((_ args ...)
|
||||
#'((syntax-parameterize ((name (identifier-syntax proc-name)))
|
||||
(lambda (formals ...)
|
||||
body ...))
|
||||
body0 body ...))
|
||||
args ...))
|
||||
((_ a (... ...))
|
||||
(syntax-violation 'name "Wrong number of arguments" x))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; srfi-9.scm --- define-record-type
|
||||
|
||||
;; Copyright (C) 2001-2002, 2006, 2008-2014, 2018-2019
|
||||
;; Copyright (C) 2001-2002, 2006, 2008-2014, 2018-2019, 2023
|
||||
;; Free Software Foundation, Inc.
|
||||
;;
|
||||
;; This library is free software; you can redistribute it and/or
|
||||
|
@ -108,20 +108,21 @@
|
|||
'-procedure)))
|
||||
|
||||
(syntax-case x ()
|
||||
((_ ((key value) ...) (name formals ...) body ...)
|
||||
((_ ((key value) ...) (name formals ...) body0 body ...)
|
||||
(identifier? #'name)
|
||||
(with-syntax ((proc-name (make-procedure-name #'name))
|
||||
((args ...) (generate-temporaries #'(formals ...))))
|
||||
#`(begin
|
||||
(define (proc-name formals ...)
|
||||
body ...)
|
||||
#((maybe-unused))
|
||||
body0 body ...)
|
||||
(define-syntax name
|
||||
(lambda (x)
|
||||
(syntax-case x (%%on-error key ...)
|
||||
((_ (%%on-error err) key s) #'(ck s 'value)) ...
|
||||
((_ args ...)
|
||||
#'((lambda (formals ...)
|
||||
body ...)
|
||||
body0 body ...)
|
||||
args ...))
|
||||
((_ a (... ...))
|
||||
(syntax-violation 'name "Wrong number of arguments" x))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue