mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-23 20:05:32 +02:00
This set of patches eliminates the dependency between the
implementation of evaluator specific memoization codes and special constants like #f, '() etc. ('flags'), which are not evaluator specific. The goal is to remove definitions of evaluator memoization codes completely from the public interface. This will make it possible to experiment more freely with optimizations of guile's internal representation of memoized code. * objects.c (scm_class_of): Eliminate dependency on SCM_ISYMNUM. * print.c (iflagnames): New array, holding the printed names of guile's special constants ('flags'). (scm_isymnames): Now holds only the printed names of the memoization codes. (scm_iprin1): Separate the handling of memoization codes and guile's special constants. * tags.h (scm_tc9_flag, SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA, SCM_IFLAGNUM): new (scm_tc8_char, scm_tc8_iloc, SCM_BOOL_F, SCM_BOOL_T, SCM_UNDEFINED, SCM_EOF_VAL, SCM_EOL, SCM_UNSPECIFIED, SCM_UNBOUND, SCM_ELISP_NIL, SCM_IM_DISPATCH, SCM_IM_SLOT_REF, SCM_IM_SLOT_SET_X, SCM_IM_DELAY, SCM_IM_FUTURE, SCM_IM_CALL_WITH_VALUES, SCM_IM_NIL_COND, SCM_IM_BIND): Changed values. (SCM_IFLAGP): SCM_IFLAGP now only tests for flags. (SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Generalized to use the tc9 macros and scm_tc9_flag.
This commit is contained in:
parent
cd56b18192
commit
e17d318faa
4 changed files with 139 additions and 92 deletions
|
@ -49,9 +49,29 @@
|
|||
* This table must agree with the declarations in scm.h: {Immediate Symbols}.
|
||||
*/
|
||||
|
||||
/* This table must agree with the list of flags in tags.h. */
|
||||
static const char *iflagnames[] =
|
||||
{
|
||||
"#f",
|
||||
"#t",
|
||||
"#<undefined>",
|
||||
"#<eof>",
|
||||
"()",
|
||||
"#<unspecified>",
|
||||
|
||||
/* Unbound slot marker for GOOPS. For internal use in GOOPS only. */
|
||||
"#<unbound>",
|
||||
|
||||
/* Elisp nil value. This is its Scheme name; whenever it's printed in
|
||||
* Elisp, it should appear as the symbol `nil'. */
|
||||
"#nil"
|
||||
};
|
||||
|
||||
/* This table must agree with the list of SCM_IM_ constants in tags.h */
|
||||
char *scm_isymnames[] =
|
||||
{
|
||||
/* This table must agree with the list of SCM_IM_ constants in tags.h */
|
||||
/* Short instructions */
|
||||
|
||||
"#@and",
|
||||
"#@begin",
|
||||
"#@case",
|
||||
|
@ -65,39 +85,23 @@ char *scm_isymnames[] =
|
|||
"#@or",
|
||||
"#@quote",
|
||||
"#@set!",
|
||||
|
||||
|
||||
/* Long instructions */
|
||||
|
||||
"#@define",
|
||||
"#@apply",
|
||||
"#@call-with-current-continuation",
|
||||
|
||||
/* user visible ISYMS */
|
||||
/* other keywords */
|
||||
/* Flags */
|
||||
|
||||
"#f",
|
||||
"#t",
|
||||
"#<undefined>",
|
||||
"#<eof>",
|
||||
"()",
|
||||
"#<unspecified>",
|
||||
"#@dispatch",
|
||||
"#@slot-ref",
|
||||
"#@slot-set!",
|
||||
|
||||
/* Multi-language support */
|
||||
|
||||
"#@nil-cond",
|
||||
"#@bind",
|
||||
|
||||
"#@delay",
|
||||
"#@future",
|
||||
"#@call-with-values",
|
||||
|
||||
"#<unbound>",
|
||||
|
||||
/* Elisp nil value. This is its Scheme name; whenever it's printed
|
||||
in Elisp, it should appear as the symbol `nil'. */
|
||||
|
||||
"#nil"
|
||||
/* Multi-language support */
|
||||
"#@nil-cond",
|
||||
"#@bind"
|
||||
};
|
||||
|
||||
scm_t_option scm_print_opts[] = {
|
||||
|
@ -434,8 +438,15 @@ scm_iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
|||
scm_putc (i, port);
|
||||
}
|
||||
else if (SCM_IFLAGP (exp)
|
||||
&& ((size_t) SCM_IFLAGNUM (exp) < (sizeof iflagnames / sizeof (char *))))
|
||||
{
|
||||
scm_puts (iflagnames [SCM_IFLAGNUM (exp)], port);
|
||||
}
|
||||
else if (SCM_ISYMP (exp)
|
||||
&& ((size_t) SCM_ISYMNUM (exp) < (sizeof scm_isymnames / sizeof (char *))))
|
||||
{
|
||||
scm_puts (SCM_ISYMCHARS (exp), port);
|
||||
}
|
||||
else if (SCM_ILOCP (exp))
|
||||
{
|
||||
scm_puts ("#@", port);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue