[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, 17 May 2004 20:31:24 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) |
Han-Wen Nienhuys <address@hidden> writes:
> that doesn't really answer my question. It seems to me that
>
> if (obj == gh_symbol2scm("bla"))
> ...
>
> is safe.
It does currently work, and will likely continue to work for a very
long time. (Even with the strange nil/#f/() tryptich planned for
getting Elisp into Guile.) However, for a proper abstract data type
like SCM, it would be cleaner to use SCM_EQ_P. Setting
DEBUG_TYPE_STRICTNESS to 2 will not allow direct comparisons.
> Do I understand correctly that disallowing this is a side
> effect of trying to disallow
>
> if (obj)
> ...
No, I don't think so. The two cases seem very different to me. "if
(obj)" will never be correct since the SCM encoding that is considered
false by C will never occur, and more importantly, SCM_BOOL_F is not
false when seen directy by C.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
- Re: typechecking, Marius Vollmer, 2004/05/10
- Re: typechecking, Dale P. Smith, 2004/05/10
- Re: typechecking, Han-Wen Nienhuys, 2004/05/10
- Re: typechecking, Dirk Herrmann, 2004/05/15
- Re: typechecking, Han-Wen Nienhuys, 2004/05/16
- Re: typechecking,
Marius Vollmer <=
- Re: typechecking, Han-Wen Nienhuys, 2004/05/26
- Re: typechecking, Dirk Herrmann, 2004/05/30
- Re: typechecking, Han-Wen Nienhuys, 2004/05/30
- Re: typechecking, Dirk Herrmann, 2004/05/31
- Re: typechecking, Andy Wingo, 2004/05/30