1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

allow simple value definitions with define*-public

* module/ice-9/optargs.scm (define*-public): Allow (define*-public ID
  VAL).
This commit is contained in:
Andy Wingo 2010-01-12 20:15:36 +01:00
parent 0d782201bf
commit 7aec4ce019

View file

@ -1,6 +1,6 @@
;;;; optargs.scm -- support for optional arguments ;;;; optargs.scm -- support for optional arguments
;;;; ;;;;
;;;; Copyright (C) 1997, 1998, 1999, 2001, 2002, 2004, 2006, 2009 Free Software Foundation, Inc. ;;;; Copyright (C) 1997, 1998, 1999, 2001, 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
;;;; ;;;;
;;;; This library is free software; you can redistribute it and/or ;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public ;;;; modify it under the terms of the GNU Lesser General Public
@ -253,9 +253,12 @@
;; in the same way as lambda*. ;; in the same way as lambda*.
(define-syntax define*-public (define-syntax define*-public
(syntax-rules () (lambda (x)
((_ (id . args) b0 b1 ...) (syntax-case x ()
(define-public id (lambda* args b0 b1 ...))))) ((_ (id . args) b0 b1 ...)
#'(define-public id (lambda* args b0 b1 ...)))
((_ id val) (identifier? #'id)
#'(define-public id val)))))
;; defmacro* name args . body ;; defmacro* name args . body