[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: typechecking

From: Marius Vollmer
Subject: Re: typechecking
Date: Mon, 10 May 2004 23:34:52 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Han-Wen Nienhuys  <address@hidden> writes:

> I've added the stricter typechecking code to the SCM_UNPACK macro in
> CVS HEAD. It caught a few glitches in goops.h and backtrace.h , which
> I corrected.


> I propose that the old
> is removed, as it provides little extra strictness.

Hmm, I don't agree.  That setting is much stricter than the default
one: Guile itself has many places that would need to be fixed for
STRICTNESS == 2.  For example, code like

    SCM x;

    if (x == SCM_EOL)

does not compile with STRICTNESS == 2, and it is indeed not completely
correct.  (It should be SCM_EQ_P (x, SCM_EOL) or SCM_NULLP (x).)

It would be a nice little (?) project to make Guile compile with
STRICTNESS == 2.  Some places, like 

    switch (ISYMNUM (SCM_CAR (x)))
      case (ISYMNUM (SCM_IM_AND)):

in eval.c might be hard to fix, tho.

> Also, I think that DEBUG_TYPING_STRICTNESS==0 should go too. The code
> contained a thinko (leading to loads of compile errors).  This
> suggests that the code has never been tested since its inception a few
> years ago.

Can you elaborate?  Guile itself compiles fine with STRICTNESS==0.
Indeed, this strictness level offers no type checking.

When I say "type checking" what really mean is that the compiler
checks whether the user only uses SCM values in the way we want it to,
like, no direct arithmetic, no direct use in conditional tests, only
direct assignment.

GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405

reply via email to

[Prev in Thread] Current Thread [Next in Thread]