remove mmacros, SCM_SYNTAX snarf macro
[bpt/guile.git] / libguile / macros.h
CommitLineData
99027e3c
MD
1/* classes: h_files */
2
22a52da1
DH
3#ifndef SCM_MACROS_H
4#define SCM_MACROS_H
0527e687 5
9f09b127 6/* Copyright (C) 1998,2000,2001,2002,2003, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
0527e687 7 *
73be1d9e 8 * This library is free software; you can redistribute it and/or
53befeb7
NJ
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
0527e687 12 *
53befeb7
NJ
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
73be1d9e
MV
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
0527e687 17 *
73be1d9e
MV
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
53befeb7
NJ
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA
73be1d9e 22 */
0527e687 23
99027e3c
MD
24\f
25
26#include "libguile/__scm.h"
27
28\f
29
160bb34a 30#define SCM_ASSYNT(_cond, _msg, _subr) \
e11208ca 31 if (!(_cond)) scm_misc_error (_subr, _msg, SCM_EOL);
99027e3c 32
5a0132b3
AW
33#define SCM_MACRO_TYPE_BITS (3)
34#define SCM_MACRO_TYPE_MASK ((1<<SCM_MACRO_TYPE_BITS)-1)
35#define SCM_F_MACRO_EXTENDED (1<<SCM_MACRO_TYPE_BITS)
36
f5710d53 37#define SCM_MACROP(x) SCM_SMOB_PREDICATE (scm_tc16_macro, (x))
5a0132b3
AW
38#define SCM_MACRO_TYPE(m) (SCM_SMOB_FLAGS (m) & SCM_MACRO_TYPE_MASK)
39#define SCM_MACRO_IS_EXTENDED(m) (SCM_SMOB_FLAGS (m) & SCM_F_MACRO_EXTENDED)
3b88ed2a 40#define SCM_BUILTIN_MACRO_P(x) (SCM_MACROP (x) && SCM_MACRO_TYPE (x) == 3)
5a0132b3 41#define SCM_SYNCASE_MACRO_P(x) (SCM_MACROP (x) && SCM_MACRO_TYPE (x) == 4)
f5710d53 42#define SCM_MACRO_CODE(m) SCM_SMOB_OBJECT (m)
22a52da1 43
33b001fd 44SCM_API scm_t_bits scm_tc16_macro;
99027e3c 45
bab98046 46SCM_INTERNAL SCM scm_i_makbimacro (const char *name, SCM (*fn)(SCM,SCM));
5a0132b3
AW
47SCM_API SCM scm_make_syncase_macro (SCM type, SCM binding);
48SCM_API SCM scm_make_extended_syncase_macro (SCM builtin, SCM type,
49 SCM binding);
33b001fd
MV
50SCM_API SCM scm_macro_p (SCM obj);
51SCM_API SCM scm_macro_type (SCM m);
52SCM_API SCM scm_macro_name (SCM m);
53SCM_API SCM scm_macro_transformer (SCM m);
5a0132b3
AW
54SCM_API SCM scm_syncase_macro_type (SCM m);
55SCM_API SCM scm_syncase_macro_binding (SCM m);
102dbb6f 56SCM_INTERNAL void scm_init_macros (void);
99027e3c 57
3063e30a 58
0527e687 59#endif /* SCM_MACROS_H */
89e00824
ML
60
61/*
62 Local Variables:
63 c-file-style: "gnu"
64 End:
65*/