1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 20:30:28 +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:
Marius Vollmer 2005-01-17 19:04:54 +00:00
parent 332036c18a
commit ba96ba4cdc
3 changed files with 7 additions and 0 deletions

View file

@ -2377,6 +2377,7 @@ create_standard_classes (void)
scm_class_class, scm_class_class,
scm_list_2 (scm_class_input_port, scm_class_output_port), scm_list_2 (scm_class_input_port, scm_class_output_port),
SCM_EOL); SCM_EOL);
scm_classes_initialized = 1;
} }
/********************************************************************** /**********************************************************************

View file

@ -78,6 +78,8 @@ SCM scm_class_unknown;
SCM *scm_port_class = 0; SCM *scm_port_class = 0;
SCM *scm_smob_class = 0; SCM *scm_smob_class = 0;
int scm_classes_initialized = 0;
SCM scm_no_applicable_method; SCM scm_no_applicable_method;
/* This function is used for efficient type dispatch. */ /* This function is used for efficient type dispatch. */
@ -86,6 +88,9 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0,
"Return the class of @var{x}.") "Return the class of @var{x}.")
#define FUNC_NAME s_scm_class_of #define FUNC_NAME s_scm_class_of
{ {
if (!scm_classes_initialized)
scm_misc_error (FUNC_NAME, "GOOPS not loaded yet.", SCM_EOL);
switch (SCM_ITAG3 (x)) switch (SCM_ITAG3 (x))
{ {
case scm_tc3_int_1: case scm_tc3_int_1:

View file

@ -207,6 +207,7 @@ extern SCM scm_class_real, scm_class_complex, scm_class_integer;
extern SCM scm_class_unknown; extern SCM scm_class_unknown;
extern SCM *scm_port_class; extern SCM *scm_port_class;
extern SCM *scm_smob_class; extern SCM *scm_smob_class;
extern int scm_classes_initialized;
extern SCM scm_no_applicable_method; extern SCM scm_no_applicable_method;