"")
#define FUNC_NAME s_scm_vm_frame_p
{
- return SCM_BOOL (SCM_VM_FRAME_P (obj));
+ return scm_from_bool (SCM_VM_FRAME_P (obj));
}
#undef FUNC_NAME
struct scm_instruction *table = fetch_instruction_table ();
SCM op;
- if (SCM_UNLIKELY (SCM_FALSEP (instructions_by_name)))
- {
- int i;
- instructions_by_name = scm_permanent_object
- (scm_make_hash_table (SCM_I_MAKINUM (SCM_VM_NUM_INSTRUCTIONS)));
+ if (SCM_UNLIKELY (scm_is_false (instructions_by_name)))
+ {
+ unsigned int i;
+
+ instructions_by_name =
+ scm_make_hash_table (SCM_I_MAKINUM (SCM_VM_NUM_INSTRUCTIONS));
+
for (i = 0; i < SCM_VM_NUM_INSTRUCTIONS; i++)
if (scm_is_true (table[i].symname))
scm_hashq_set_x (instructions_by_name, table[i].symname,
SCM_I_MAKINUM (i));
}
-
+
op = scm_hashq_ref (instructions_by_name, name, SCM_UNDEFINED);
if (SCM_I_INUMP (op))
return &table[SCM_I_INUM (op)];
"")
#define FUNC_NAME s_scm_instruction_p
{
- return SCM_BOOL (scm_lookup_instruction_by_name (obj));
+ return scm_from_bool (scm_lookup_instruction_by_name (obj) != NULL);
}
#undef FUNC_NAME
"")
#define FUNC_NAME s_scm_objcode_p
{
- return SCM_BOOL (SCM_OBJCODE_P (obj));
+ return scm_from_bool (SCM_OBJCODE_P (obj));
}
#undef FUNC_NAME
{
static int print_error = 0;
- if (SCM_FALSEP (write_program) && scm_module_system_booted_p)
+ if (scm_is_false (write_program) && scm_module_system_booted_p)
write_program = scm_module_local_variable
(scm_c_resolve_module ("system vm program"),
scm_from_locale_symbol ("write-program"));
- if (SCM_FALSEP (write_program) || print_error)
+ if (scm_is_false (write_program) || print_error)
{
scm_puts ("#<program ", port);
scm_uintprint (SCM_CELL_WORD_1 (program), 16, port);
"")
#define FUNC_NAME s_scm_program_p
{
- return SCM_BOOL (SCM_PROGRAM_P (obj));
+ return scm_from_bool (SCM_PROGRAM_P (obj));
}
#undef FUNC_NAME
-/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008, 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 License
struct pre_unwind_data pre_unwind;
vm = scm_the_vm ();
- if (SCM_NFALSEP (vm))
+ if (scm_is_true (vm))
{
sp = SCM_VM_DATA (vm)->sp;
fp = SCM_VM_DATA (vm)->fp;
VM_DEFINE_FUNCTION (102, eq, "eq?", 2)
{
ARGS2 (x, y);
- RETURN (scm_from_bool (SCM_EQ_P (x, y)));
+ RETURN (scm_from_bool (scm_is_eq (x, y)));
}
VM_DEFINE_FUNCTION (103, not_eq, "not-eq?", 2)
{
ARGS2 (x, y);
- RETURN (scm_from_bool (!SCM_EQ_P (x, y)));
+ RETURN (scm_from_bool (!scm_is_eq (x, y)));
}
VM_DEFINE_FUNCTION (104, nullp, "null?", 1)
VM_DEFINE_FUNCTION (106, eqv, "eqv?", 2)
{
ARGS2 (x, y);
- if (SCM_EQ_P (x, y))
+ if (scm_is_eq (x, y))
RETURN (SCM_BOOL_T);
if (SCM_IMP (x) || SCM_IMP (y))
RETURN (SCM_BOOL_F);
VM_DEFINE_FUNCTION (107, equal, "equal?", 2)
{
ARGS2 (x, y);
- if (SCM_EQ_P (x, y))
+ if (scm_is_eq (x, y))
RETURN (SCM_BOOL_T);
if (SCM_IMP (x) || SCM_IMP (y))
RETURN (SCM_BOOL_F);
VM_DEFINE_FUNCTION (108, pairp, "pair?", 1)
{
ARGS1 (x);
- RETURN (scm_from_bool (SCM_CONSP (x)));
+ RETURN (scm_from_bool (scm_is_pair (x)));
}
VM_DEFINE_FUNCTION (109, listp, "list?", 1)
mod = scm_resolve_module (SCM_CAR (what));
if (scm_is_true (SCM_CADDR (what)))
mod = scm_module_public_interface (mod);
- if (SCM_FALSEP (mod))
+ if (scm_is_false (mod))
scm_misc_error (NULL, "no such module: ~S",
scm_list_1 (SCM_CAR (what)));
/* might longjmp */