Beispiel #1
0
int
scm_recordtype_initialize(ScmObj type, ScmObj name)
{
  scm_assert(scm_recordtype_p(type));
  scm_assert(scm_symbol_p(name));

  SCM_RECORDTYPE_SET_NAME(type, name);
  return 0;
}
Beispiel #2
0
ScmObj
scm_recordtype_new(scm_mem_type_t mtype, ScmObj name)
{
  ScmObj type = SCM_OBJ_INIT;

  SCM_REFSTK_INIT_REG(&name,
                      &type);

  scm_assert(scm_symbol_p(name));

  type = scm_alloc_mem(&SCM_RECORDTYPE_TYPE_INFO, 0, mtype);
  if (scm_obj_null_p(type)) return SCM_OBJ_NULL;

  if (scm_recordtype_initialize(type, name) < 0)
    return SCM_OBJ_NULL;

  return type;
}
Beispiel #3
0
bool
xscm_is_symbol(SCM x)
{
    return scm_is_true (scm_symbol_p (x));
}