From 5623a9b4590618773e7969b512850cd92bfd79ed Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Tue, 14 Dec 1999 17:08:25 +0000 Subject: [PATCH] * guile-doc-snarf.awk: Removed. * guile-doc-snarf.awk.in: Added. * ports.c (s_scm_pt_member): Fixed validation. * guile-doc-snarf.in (filename): Use basename in order to strip away path. * debug.c (scm_make_iloc, s_scm_proc_to_mem): Added missing semicolon. (scm_memcons, scm_memcons, mem_to_proc): Renamed function name strings to new form. * backtrace.c (set_print_params_x): Fixed GUILE_PROC macro. * tags.h (SCM_UNBOUND): New iflag which is needed for some time to mark the unboundness of a GOOPS slot. (Added now in order to correct a oversight. Should probably be removed again and replaced with SCM_UNDEFINED when the corresponding code in GOOPS is rewritten.) * print.c (scm_isymnames): Added printed representation for SCM_UNBOUND. * eval.c (SCM_CEVAL): Bugfix: Added check for unbound slot in SCM_IM_SLOT_REF. --- libguile/ChangeLog | 30 +++++++++++++++++++ libguile/backtrace.c | 3 +- libguile/debug.c | 12 ++++---- libguile/eval.c | 9 ++++-- ...e-doc-snarf.awk => guile-doc-snarf.awk.in} | 0 libguile/guile-doc-snarf.in | 2 +- libguile/ports.c | 2 +- libguile/print.c | 4 ++- libguile/tags.h | 14 +++++++-- 9 files changed, 62 insertions(+), 14 deletions(-) rename libguile/{guile-doc-snarf.awk => guile-doc-snarf.awk.in} (100%) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 9b1b4fe02..383eb08f6 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,33 @@ +1999-12-14 Mikael Djurfeldt + + * guile-doc-snarf.awk: Removed. + + * guile-doc-snarf.awk.in: Added. + + * ports.c (s_scm_pt_member): Fixed validation. + + * guile-doc-snarf.in (filename): Use basename in order to strip + away path. + + * debug.c (scm_make_iloc, s_scm_proc_to_mem): Added missing + semicolon. + (scm_memcons, scm_memcons, mem_to_proc): Renamed function name + strings to new form. + + * backtrace.c (set_print_params_x): Fixed GUILE_PROC macro. + + * tags.h (SCM_UNBOUND): New iflag which is needed for some time to + mark the unboundness of a GOOPS slot. (Added now in order to + correct a oversight. Should probably be removed again and + replaced with SCM_UNDEFINED when the corresponding code in GOOPS + is rewritten.) + + * print.c (scm_isymnames): Added printed representation for + SCM_UNBOUND. + + * eval.c (SCM_CEVAL): Bugfix: Added check for unbound slot in + SCM_IM_SLOT_REF. + Mon Dec 13 17:23:22 1999 Greg J. Badros * strings.c: Fixed mistaken default value in diff --git a/libguile/backtrace.c b/libguile/backtrace.c index 71aadf5d4..a246e1903 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -286,7 +286,8 @@ static print_params_t *print_params = default_print_params; #ifdef GUILE_DEBUG GUILE_PROC(set_print_params_x, "set-print-params!", 1, 0, 0, - (SCM params) + (SCM params), +"") #define FUNC_NAME s_set_print_params_x { int i, n = scm_ilength (params); diff --git a/libguile/debug.c b/libguile/debug.c index 05ad8dab3..d88b055f0 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -286,7 +286,7 @@ GUILE_PROC (scm_make_iloc, "make-iloc", 3, 0, 0, #define FUNC_NAME s_scm_make_iloc { SCM_VALIDATE_INT(1,frame); - SCM_VALIDATE_INT(2,binding) + SCM_VALIDATE_INT(2,binding); return (SCM_ILOC00 + SCM_IFRINC * SCM_INUM (frame) + (SCM_NFALSEP (cdrp) ? SCM_ICDR : 0) @@ -312,7 +312,7 @@ GUILE_PROC (scm_memcons, "memcons", 2, 1, 0, { /*fixme* environments may be two different but equal top-level envs */ if (!SCM_UNBNDP (env) && SCM_MEMOIZED_ENV (car) != env) - scm_misc_error (s_memcons, + scm_misc_error (s_scm_memcons, "environment mismatch arg1 <-> arg3", scm_cons2 (car, env, SCM_EOL)); else @@ -322,7 +322,7 @@ GUILE_PROC (scm_memcons, "memcons", 2, 1, 0, if (SCM_NIMP (cdr) && SCM_MEMOIZEDP (cdr)) { if (!SCM_UNBNDP (env) && SCM_MEMOIZED_ENV (cdr) != env) - scm_misc_error (s_memcons, + scm_misc_error (s_scm_memcons, "environment mismatch arg2 <-> arg3", scm_cons2 (cdr, env, SCM_EOL)); else @@ -335,7 +335,7 @@ GUILE_PROC (scm_memcons, "memcons", 2, 1, 0, SCM_ASSERT (SCM_NULLP (env) || (SCM_NIMP (env) && SCM_CONSP (env)), env, SCM_ARG3, - s_make_iloc); + s_scm_make_iloc); return scm_make_memoized (scm_cons (car, cdr), env); } #undef FUNC_NAME @@ -350,7 +350,7 @@ GUILE_PROC (scm_mem_to_proc, "mem->proc", 1, 0, 0, env = SCM_MEMOIZED_ENV (obj); obj = SCM_MEMOIZED_EXP (obj); if (!(SCM_NIMP (obj) && SCM_CAR (obj) == SCM_IM_LAMBDA)) - scm_misc_error (s_mem_to_proc, + scm_misc_error (s_scm_mem_to_proc, "expected lambda expression", scm_cons (obj, SCM_EOL)); return scm_closure (SCM_CDR (obj), env); @@ -362,7 +362,7 @@ GUILE_PROC (scm_proc_to_mem, "proc->mem", 1, 0, 0, "") #define FUNC_NAME s_scm_proc_to_mem { - SCM_VALIDATE_CLOSURE(1,obj) + SCM_VALIDATE_CLOSURE (1, obj); return scm_make_memoized (scm_cons (SCM_IM_LAMBDA, SCM_CODE (obj)), SCM_ENV (obj)); } diff --git a/libguile/eval.c b/libguile/eval.c index a27b99868..029f2312d 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2340,7 +2340,12 @@ dispatch: case (SCM_ISYMNUM (SCM_IM_SLOT_REF)): x = SCM_CDR (x); t.arg1 = EVALCAR (x, env); - RETURN (SCM_STRUCT_DATA (t.arg1)[SCM_INUM (SCM_CADR (x))]); + proc = SCM_STRUCT_DATA (t.arg1)[SCM_INUM (SCM_CADR (x))]; + if (proc == SCM_UNBOUND) + scm_misc_error (NULL, + "Reference to unbound slot in %S", + SCM_LIST1 (t.arg1)); + RETURN (proc) case (SCM_ISYMNUM (SCM_IM_SLOT_SET_X)): x = SCM_CDR (x); @@ -2349,7 +2354,7 @@ dispatch: proc = SCM_CDR (x); SCM_STRUCT_DATA (t.arg1)[SCM_INUM (SCM_CAR (x))] = EVALCAR (proc, env); - RETURN (SCM_UNSPECIFIED); + RETURN (SCM_UNSPECIFIED) case (SCM_ISYMNUM (SCM_IM_NIL_COND)): proc = SCM_CDR (x); diff --git a/libguile/guile-doc-snarf.awk b/libguile/guile-doc-snarf.awk.in similarity index 100% rename from libguile/guile-doc-snarf.awk rename to libguile/guile-doc-snarf.awk.in diff --git a/libguile/guile-doc-snarf.in b/libguile/guile-doc-snarf.in index b779bf493..27f8f68fc 100755 --- a/libguile/guile-doc-snarf.in +++ b/libguile/guile-doc-snarf.in @@ -1,7 +1,7 @@ #!/bin/sh # Extract the initialization actions for builtin things. -filename=$1; shift +filename=`basename $1`; shift # we need to be sure that the .x file exists # since the .c/.cc file may include it diff --git a/libguile/ports.c b/libguile/ports.c index 274e9fafa..6e6be8b10 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -454,7 +454,7 @@ GUILE_PROC(scm_pt_member, "pt-member", 1, 0, 0, #define FUNC_NAME s_scm_pt_member { int i; - SCM_VALIDATE_INT_copy(1,member,i); + SCM_VALIDATE_INT_COPY (1,member,i); if (i < 0 || i >= scm_port_table_size) return SCM_BOOL_F; else diff --git a/libguile/print.c b/libguile/print.c index 42b8fbe14..c96853c25 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -116,7 +116,9 @@ char *scm_isymnames[] = "#@1-ify", "#@bind", - "#@delay" + "#@delay", + + "#" }; scm_option scm_print_opts[] = { diff --git a/libguile/tags.h b/libguile/tags.h index 65fdc4c9a..68d5d638c 100644 --- a/libguile/tags.h +++ b/libguile/tags.h @@ -500,12 +500,22 @@ extern char *scm_isymnames[]; /* defined in print.c */ #define SCM_IM_DELAY SCM_MAKISYM(32) +/* When a variable is unbound this is marked by the SCM_UNDEFINED + * value. The following is an unbound value which can be handled on + * the Scheme level, i.e., it can be stored in and retrieved from a + * Scheme variable. This value is only intended to mark an unbound + * slot in GOOPS. It is needed now, but we should probably rewrite + * the code which handles this value in C so that SCM_UNDEFINED can be + * used instead. It is not ideal to let this kind of unique and + * strange values loose on the Scheme level. + */ +#define SCM_UNBOUND SCM_MAKIFLAG(33) + #define SCM_UNBNDP(x) (SCM_UNDEFINED==(x)) -/* Dispatching aids: - */ +/* Dispatching aids: */ /* For cons pairs with immediate values in the CAR