mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
case-lambda, case-lambda* in psyntax
* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Add implementations of these, present in the base environment. * module/ice-9/psyntax-pp.scm: Regenerated. * module/srfi/srfi-16.scm (case-lambda): Replace the core's case-lambda definition with our own. We're not quite ready to switch yet.
This commit is contained in:
parent
8b65211204
commit
647117cd35
3 changed files with 6395 additions and 6190 deletions
File diff suppressed because it is too large
Load diff
|
@ -2054,6 +2054,32 @@
|
|||
(build-case-lambda s docstring lcase))))
|
||||
(_ (syntax-violation 'lambda "bad lambda*" e)))))
|
||||
|
||||
(global-extend 'core 'case-lambda
|
||||
(lambda (e r w s mod)
|
||||
(syntax-case e ()
|
||||
((_ (args e1 e2 ...) (args* e1* e2* ...) ...)
|
||||
(call-with-values
|
||||
(lambda ()
|
||||
(chi-lambda-case e r w s mod
|
||||
lambda-formals
|
||||
#'((args e1 e2 ...) (args* e1* e2* ...) ...)))
|
||||
(lambda (docstring lcase)
|
||||
(build-case-lambda s docstring lcase))))
|
||||
(_ (syntax-violation 'case-lambda "bad case-lambda" e)))))
|
||||
|
||||
(global-extend 'core 'case-lambda*
|
||||
(lambda (e r w s mod)
|
||||
(syntax-case e ()
|
||||
((_ (args e1 e2 ...) (args* e1* e2* ...) ...)
|
||||
(call-with-values
|
||||
(lambda ()
|
||||
(chi-lambda-case e r w s mod
|
||||
lambda*-formals
|
||||
#'((args e1 e2 ...) (args* e1* e2* ...) ...)))
|
||||
(lambda (docstring lcase)
|
||||
(build-case-lambda s docstring lcase))))
|
||||
(_ (syntax-violation 'case-lambda "bad case-lambda*" e)))))
|
||||
|
||||
(global-extend 'core 'let
|
||||
(let ()
|
||||
(define (chi-let e r w s mod constructor ids vals exps)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; srfi-16.scm --- case-lambda
|
||||
|
||||
;; Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2001, 2002, 2006, 2009 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
|
||||
|
@ -46,7 +46,7 @@
|
|||
;;; Code:
|
||||
|
||||
(define-module (srfi srfi-16)
|
||||
:export-syntax (case-lambda))
|
||||
#:replace (case-lambda))
|
||||
|
||||
(cond-expand-provide (current-module) '(srfi-16))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue