2002-03-28 01:39:12 +00:00
|
|
|
;;; srfi-16.scm --- case-lambda
|
2001-05-14 19:07:51 +00:00
|
|
|
|
2014-01-14 02:19:52 -05:00
|
|
|
;; Copyright (C) 2001, 2002, 2006, 2009, 2014 Free Software Foundation, Inc.
|
2002-03-28 01:39:12 +00:00
|
|
|
;;
|
2003-04-05 19:15:35 +00:00
|
|
|
;; This library is free software; you can redistribute it and/or
|
|
|
|
|
;; modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
;; License as published by the Free Software Foundation; either
|
2009-06-17 22:30:26 +01:00
|
|
|
;; version 3 of the License, or (at your option) any later version.
|
2003-04-05 19:15:35 +00:00
|
|
|
;;
|
|
|
|
|
;; This library is distributed in the hope that it will be useful,
|
2002-03-28 01:39:12 +00:00
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2003-04-05 19:15:35 +00:00
|
|
|
;; Lesser General Public License for more details.
|
|
|
|
|
;;
|
|
|
|
|
;; You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
;; License along with this library; if not, write to the Free Software
|
2005-05-23 19:57:22 +00:00
|
|
|
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-05-14 19:07:51 +00:00
|
|
|
|
2002-03-28 01:39:12 +00:00
|
|
|
;;; Author: Martin Grabmueller
|
2001-05-14 19:07:51 +00:00
|
|
|
|
2002-03-28 01:39:12 +00:00
|
|
|
;;; Commentary:
|
2001-05-14 19:07:51 +00:00
|
|
|
|
2002-03-28 01:39:12 +00:00
|
|
|
;; Implementation of SRFI-16. `case-lambda' is a syntactic form
|
|
|
|
|
;; which permits writing functions acting different according to the
|
|
|
|
|
;; number of arguments passed.
|
|
|
|
|
;;
|
|
|
|
|
;; The syntax of the `case-lambda' form is defined in the following
|
|
|
|
|
;; EBNF grammar.
|
|
|
|
|
;;
|
|
|
|
|
;; <case-lambda>
|
|
|
|
|
;; --> (case-lambda <case-lambda-clause>)
|
|
|
|
|
;; <case-lambda-clause>
|
|
|
|
|
;; --> (<signature> <definition-or-command>*)
|
|
|
|
|
;; <signature>
|
|
|
|
|
;; --> (<identifier>*)
|
|
|
|
|
;; | (<identifier>* . <identifier>)
|
|
|
|
|
;; | <identifier>
|
|
|
|
|
;;
|
|
|
|
|
;; The value returned by a `case-lambda' form is a procedure which
|
|
|
|
|
;; matches the number of actual arguments against the signatures in
|
|
|
|
|
;; the various clauses, in order. The first matching clause is
|
|
|
|
|
;; selected, the corresponding values from the actual parameter list
|
|
|
|
|
;; are bound to the variable names in the clauses and the body of the
|
|
|
|
|
;; clause is evaluated.
|
2001-05-14 19:07:51 +00:00
|
|
|
|
|
|
|
|
;;; Code:
|
2002-03-28 01:39:12 +00:00
|
|
|
|
* lib.scm: Move module the system directives `export',
`export-syntax', `re-export' and `re-export-syntax' into the
`define-module' form. This is the recommended way of exporting
bindings.
* srfi-2.scm, srfi-4.scm, srfi-8.scm, srfi-9.scm, srfi-10.scm,
srfi-11.scm, srfi-14.scm, srfi-16.scm: Move module the system
directives `export', `export-syntax', `re-export' and
`re-export-syntax' into the `define-module' form. This is the
recommended way of exporting bindings.
* goops.scm, goops/active-slot.scm, goops/compile.scm,
goops/composite-slot.scm, goops/describe.scm, goops/dispatch.scm,
goops/old-define-method.scm, goops/save.scm, goops/util.scm: Move
module the system directives `export', `export-syntax',
`re-export' and `re-export-syntax' into the `define-module' form.
This is the recommended way of exporting bindings.
* slib.scm (array-indexes): New procedure.
(*features*): Extend. (Probably some of these options should be
set elsewhere.) (Thanks to Aubrey Jaffer.)
* and-let-star-compat.scm, and-let-star.scm, calling.scm,
channel.scm, common-list.scm, debug.scm, debugger.scm,
expect.scm, hcons.scm, lineio.scm, ls.scm, mapping.scm,
null.scm, optargs.scm, poe.scm, popen.scm, pretty-print.scm,
q.scm, r5rs.scm, rdelim.scm, regex.scm, runq.scm, safe-r5rs.scm,
safe.scm, session.scm, slib.scm, streams.scm, string-fun.scm,
syncase.scm, threads.scm: Move module the system directives
`export', `export-syntax', `re-export' and `re-export-syntax'
into the `define-module' form. This is the recommended way of
exporting bindings.
2001-10-21 09:49:19 +00:00
|
|
|
(define-module (srfi srfi-16)
|
2009-10-25 13:19:11 +01:00
|
|
|
#:re-export (case-lambda))
|
2001-05-14 19:07:51 +00:00
|
|
|
|
2014-01-14 02:19:52 -05:00
|
|
|
;; Case-lambda is now provided by core psyntax.
|