Branch: Tag:

2000-01-24

2000-01-24 14:00:30 by Fredrik Noring <noring@nocrew.org>

Added some new ideas on _has_index and _has_value.

Rev: src/builtin_functions.c:1.231

5:   \*/   /**/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.230 2000/01/24 03:03:27 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.231 2000/01/24 14:00:30 noring Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
501:    break;       case T_OBJECT: -  /* FIXME: If the object behaves like an array, it will -  throw an error for non-valid indices. Maybe this is -  the way to go (faster)? +  /* FIXME: If the object behaves like an array, it will throw an +  error for non-valid indices. Therefore it's not a good idea +  to use the index operator. +  +  Maybe we should use object->_has_index(index) provided that +  the object implements it. +     /Noring */       /* Fall-through. */
545:    with `values' in case of objects. The problem is that we cannot    use `search' directly since it's undefined weather it returns    -1 (array) or 0 (mapping) during e.g. some data type emulation. +  +  Maybe we should use object->_has_value(value) provided that +  the object implements it. +     /Noring */       /* Fall-through. */