bug-guile
[Top][All Lists]
Advanced

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

uniform arrays & vectors


From: Martin Grabmueller
Subject: uniform arrays & vectors
Date: Tue, 19 Jun 2001 20:19:24 +0200

Hello list,

well, we all know that Guile's uniform vectors & arrays are strange,
but the following is really buggy, isn't it? (taken from unif.c:315)

I suppose adding a break after before each `case' claus is sufficient,
but maybe someone who uses arrays can confirm that?

      switch (SCM_TYP7 (v))
        {
        case scm_tc7_bvect:
          protp = (SCM_EQ_P (prot, SCM_BOOL_T));
        case scm_tc7_string:
          protp = SCM_CHARP(prot) && (SCM_CHAR (prot) != '\0');
        case scm_tc7_byvect:
          protp = SCM_EQ_P (prot, SCM_MAKE_CHAR ('\0'));
        case scm_tc7_uvect:
          protp = SCM_INUMP(prot) && SCM_INUM(prot)>0;
        case scm_tc7_ivect:
          protp = SCM_INUMP(prot) && SCM_INUM(prot)<=0;
          
        case scm_tc7_svect:
          protp = SCM_SYMBOLP (prot)
            && (1 == SCM_SYMBOL_LENGTH (prot))
            && ('s' == SCM_SYMBOL_CHARS (prot)[0]);
#ifdef HAVE_LONG_LONGS
        case scm_tc7_llvect:
          protp = SCM_SYMBOLP (prot)
            && (1 == SCM_SYMBOL_LENGTH (prot))
            && ('s' == SCM_SYMBOL_CHARS (prot)[0]);
#endif
        case scm_tc7_fvect:
          protp = singp (prot);
        case scm_tc7_dvect:
          protp = SCM_REALP(prot);
        case scm_tc7_cvect:
          protp = SCM_COMPLEXP(prot);
        case scm_tc7_vector:
        case scm_tc7_wvect:
          protp = SCM_NULLP(prot);
        default:
          /* no default */
          ;
        }
      return SCM_BOOL(protp);


Regards,
  'martin



reply via email to

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