1
/*===========================================================================
2
* Filename : module-srfi55.c
3
* About : require-extension
5
* Copyright (c) 2007-2008 SigScheme Project <uim-en AT googlegroups.com>
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
13
* 1. Redistributions of source code must retain the above copyright
14
* notice, this list of conditions and the following disclaimer.
15
* 2. Redistributions in binary form must reproduce the above copyright
16
* notice, this list of conditions and the following disclaimer in the
17
* documentation and/or other materials provided with the distribution.
18
* 3. Neither the name of authors nor the names of its contributors
19
* may be used to endorse or promote products derived from this software
20
* without specific prior written permission.
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
23
* IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
26
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
===========================================================================*/
37
#include "sigscheme.h"
38
#include "sigschemeinternal.h"
40
/*=======================================
41
File Local Macro Definitions
42
=======================================*/
44
/*=======================================
45
File Local Type Definitions
46
=======================================*/
48
/*=======================================
50
=======================================*/
51
#include "functable-srfi55.c"
53
SCM_GLOBAL_VARS_BEGIN(static_srfi55);
55
static ScmObj l_sym_require_extension;
57
SCM_GLOBAL_VARS_END(static_srfi55);
58
#define l_sym_require_extension SCM_GLOBAL_VAR(static_srfi55, \
59
l_sym_require_extension)
60
SCM_DEFINE_STATIC_VARS(static_srfi55);
62
/*=======================================
63
File Local Function Declarations
64
=======================================*/
66
/*=======================================
68
=======================================*/
70
scm_initialize_srfi55(void)
72
scm_register_funcs(scm_functable_srfi55);
74
l_sym_require_extension = scm_intern("%require-extension");
76
scm_require_module("sscm-ext"); /* for 'provided?' and 'provide' */
77
scm_load_system_file("srfi-55.scm");
81
scm_s_srfi55_require_extension(ScmObj clauses, ScmObj env)
84
DECLARE_FUNCTION("require-extension", syntax_variadic_0);
86
/*=======================================================================
87
(require-extension <clause> ...)
89
<clause> ::= (<extension-identifier>)
90
| (<extension-identifier> <extension-argument> ...)
91
<extension-identifier> ::= <symbol>
92
<extension-argument> ::= <any Scheme value>
93
=======================================================================*/
94
proc = scm_symbol_value(l_sym_require_extension, SCM_INTERACTION_ENV);
96
return scm_call(proc, clauses);