From 7b5804ceb3e8a6725bce7d38d4bd2fe4629bbe70 Mon Sep 17 00:00:00 2001
From: Fredrik Noring <noring@nocrew.org>
Date: Mon, 24 Jan 2000 15:00:30 +0100
Subject: [PATCH] Added some new ideas on _has_index and _has_value.

Rev: src/builtin_functions.c:1.231
---
 src/builtin_functions.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/builtin_functions.c b/src/builtin_functions.c
index 76dc3ac7d8..2bbc39263f 100644
--- a/src/builtin_functions.c
+++ b/src/builtin_functions.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #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,9 +501,13 @@ void f_has_index(INT32 args)
       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,6 +549,10 @@ void f_has_value(INT32 args)
 	 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. */
-- 
GitLab