From 7aec4ce019555b0c7113c585fda4a7ef18b84b5a Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 12 Jan 2010 20:15:36 +0100 Subject: [PATCH] allow simple value definitions with define*-public * module/ice-9/optargs.scm (define*-public): Allow (define*-public ID VAL). --- module/ice-9/optargs.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/ice-9/optargs.scm b/module/ice-9/optargs.scm index 06e2a169d..4e3267d49 100644 --- a/module/ice-9/optargs.scm +++ b/module/ice-9/optargs.scm @@ -1,6 +1,6 @@ ;;;; 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 ;;;; modify it under the terms of the GNU Lesser General Public @@ -253,9 +253,12 @@ ;; in the same way as lambda*. (define-syntax define*-public - (syntax-rules () - ((_ (id . args) b0 b1 ...) - (define-public id (lambda* args b0 b1 ...))))) + (lambda (x) + (syntax-case x () + ((_ (id . args) b0 b1 ...) + #'(define-public id (lambda* args b0 b1 ...))) + ((_ id val) (identifier? #'id) + #'(define-public id val))))) ;; defmacro* name args . body