WIP optargs disaster
This commit is contained in:
parent
5116f45fbb
commit
ce94c4d3a2
|
@ -59,16 +59,17 @@
|
|||
|
||||
(define-module (ice-9 optargs)
|
||||
#:use-module (system base pmatch)
|
||||
#:replace (lambda*)
|
||||
#:export-syntax (let-optional
|
||||
let-optional*
|
||||
let-keywords
|
||||
let-keywords*
|
||||
define*
|
||||
define*-public
|
||||
defmacro*
|
||||
defmacro*-public))
|
||||
|
||||
#:export (lambda*
|
||||
let-optional
|
||||
let-optional*
|
||||
let-keywords
|
||||
let-keywords*
|
||||
define*
|
||||
define*-public
|
||||
defmacro*
|
||||
defmacro*-public
|
||||
define-macro*))
|
||||
;
|
||||
;; let-optional rest-arg (binding ...) . body
|
||||
;; let-optional* rest-arg (binding ...) . body
|
||||
;; macros used to bind optional arguments
|
||||
|
@ -419,6 +420,9 @@
|
|||
(defmacro* ,NAME ,ARGLIST ,@BODY)
|
||||
(export-syntax ,NAME)))
|
||||
|
||||
(define-macro (define-macro* NAME+ARGLIST . BODY)
|
||||
`(define-macro ,(car NAME+ARGLIST) #f (lambda* ,(cdr NAME+ARGLIST) ,@BODY)))
|
||||
|
||||
;;; Support for optional & keyword args with the interpreter.
|
||||
(define *uninitialized* (list 'uninitialized))
|
||||
(define (parse-lambda-case spec inits predicate args)
|
||||
|
|
|
@ -25,14 +25,4 @@
|
|||
;;; Code:
|
||||
|
||||
(mes-use-module (mes scm))
|
||||
|
||||
(define-macro (defmacro name args . body)
|
||||
`(define-macro ,(cons name args) ,@body))
|
||||
|
||||
(define-macro (set-procedure-property! proc key value)
|
||||
proc)
|
||||
|
||||
(include-from-path "mes/optargs.scm")
|
||||
|
||||
(define-macro (define-macro* NAME+ARGLIST . BODY)
|
||||
`(define-macro ,(car NAME+ARGLIST) #f (lambda* ,(cdr NAME+ARGLIST) ,@BODY)))
|
||||
|
|
|
@ -24,8 +24,7 @@ exec ${MES-bin/mes} --no-auto-compile -L ${0%/*} -L module -C module -e '(tests
|
|||
;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (tests optargs)
|
||||
#:use-module (mes optargs)
|
||||
#:use-module (mes mes-0)
|
||||
;;#:use-module (ice-9 optargs)
|
||||
#:use-module (mes test))
|
||||
|
||||
(cond-expand
|
||||
|
|
Loading…
Reference in New Issue