[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SCM_BOOL_T became #nil ?
From: |
nalaginrut |
Subject: |
SCM_BOOL_T became #nil ? |
Date: |
Tue, 22 Feb 2011 14:09:55 +0800 |
hi all.
I found SCM_BOOL_T will convert to #nil in the Guile.
If we write c-function like this:
============================
SCM_DEFINE(scm_my_init, "my-init", 1, 0, 0,
(SCM flags),
"Initializes my env.")
#define FUNC_NAME s_scm_my_init
{
SCM_ASSERT(scm_is_integer(flags), flags, SCM_ARG1, FUNC_NAME);
if( init_somthing(scm_to_ulong(flags)) == -1 )
return SCM_BOOL_F;
else
return SCM_BOOL_T;
}
#undef FUNC_NAME
=============================
If init_something success, return true, else false.
And I call this "my-init" function in the Guile:
---------------------------
(if (not (my-init flags))
(error "init failed!")
(format #f "init ok!~%")
)
---------------------------
The problem is SCM_BOOL_T convert to #nil, and (not #nil)==>#t ! So I
can't get a logical result.
Is this conversion accepted? Or I made some mistakes?
Any help would be appreciated! Thanks!
--
GNU Powered it
GPL Protected it
GOD Blessed it
HFG - NalaGinrut
- SCM_BOOL_T became #nil ?,
nalaginrut <=
- Re: SCM_BOOL_T became #nil ?, Andy Wingo, 2011/02/22
- Re: SCM_BOOL_T became #nil ?, Hans Aberg, 2011/02/22
- Re: SCM_BOOL_T became #nil ?, nalaginrut, 2011/02/22
- Re: SCM_BOOL_T became #nil ?, Hans Aberg, 2011/02/22
- Re: SCM_BOOL_T became #nil ?, Ken Raeburn, 2011/02/22
- Re: SCM_BOOL_T became #nil -- et al. ?, Bruce Korb, 2011/02/23
- scm_listofnull, Ludovic Courtès, 2011/02/23
- Re: SCM_BOOL_T became #nil -- et al. ?, Ken Raeburn, 2011/02/24
- Re: SCM_BOOL_T became #nil -- et al. ?, Bruce Korb, 2011/02/24
- Re: SCM_BOOL_T became #nil -- et al. ?, Andy Wingo, 2011/02/25