mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 10:10:23 +02:00
* objects.h, objects.c (scm_classes_initialized): New.
(scm_class_of): Signal error when scm_classes_initialized is zero. * goops.c (create_standard_classes): Set scm_classes_initialized to one.
This commit is contained in:
parent
009c6b9c89
commit
526982f570
3 changed files with 7 additions and 0 deletions
|
@ -2437,6 +2437,7 @@ create_standard_classes (void)
|
|||
scm_class_class,
|
||||
scm_list_2 (scm_class_input_port, scm_class_output_port),
|
||||
SCM_EOL);
|
||||
scm_classes_initialized = 1;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -51,6 +51,8 @@ SCM scm_class_vector, scm_class_null;
|
|||
SCM scm_class_integer, scm_class_real, scm_class_complex, scm_class_fraction;
|
||||
SCM scm_class_unknown;
|
||||
|
||||
int scm_classes_initialized = 0;
|
||||
|
||||
SCM *scm_port_class = 0;
|
||||
SCM *scm_smob_class = 0;
|
||||
|
||||
|
@ -62,6 +64,9 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0,
|
|||
"Return the class of @var{x}.")
|
||||
#define FUNC_NAME s_scm_class_of
|
||||
{
|
||||
if (!scm_classes_initialized)
|
||||
scm_misc_error (NULL, "GOOPS not loaded yet.", SCM_EOL);
|
||||
|
||||
switch (SCM_ITAG3 (x))
|
||||
{
|
||||
case scm_tc3_int_1:
|
||||
|
|
|
@ -194,6 +194,7 @@ SCM_API SCM scm_class_fraction;
|
|||
SCM_API SCM scm_class_unknown;
|
||||
SCM_API SCM *scm_port_class;
|
||||
SCM_API SCM *scm_smob_class;
|
||||
SCM_API int scm_classes_initialized;
|
||||
|
||||
SCM_API SCM scm_no_applicable_method;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue