[Top][All Lists]

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

Re: stumped by scm_car/scm_cdr

From: Han-Wen Nienhuys
Subject: Re: stumped by scm_car/scm_cdr
Date: Thu, 7 Oct 2004 20:52:58 +0200

address@hidden writes:
> > One more idea: it might be that you (harmlessly) used SCM_CAR or
> > SCM_CDR on a non-pair but scm_car/scm_cdr are now complaining about
> > this by throwing an error.  That error might happen in a context where
> > throwing does not work, or might lead to endless recursion, or some
> > other anomaly.  Try replacing the call to scm_wrong_type_arg_msg in
> > scm_car and scm_cdr with a simple abort.
> I tried to remove all fishy looking places where SCM_C[AD]R were used,
> and now it seems to work OK. You might want to consider just doing
> abort() or a something similar as a standard. If the C code uses the
> API incorrectly, then (IMO) this is not something that should be
> signaled at Scheme level using scm_error(), because no amount of
> Scheme coding can fixup such errors.

for the record, these fishy places were mostly in GC mark functions,
where I did

  smobbed_type * p = (smobbed_type*) SCM_CDR(scm) 


  smobbed_type * p = (smobbed_type*) SCM_GC_CELL_WORD1(scm) 


 Han-Wen Nienhuys   |   address@hidden   | 

reply via email to

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