Subject: searching in arrays

From: Ludger Becker <[email-masked]>
Date: Fri, 9 Jul 93 04:49:53 -0700

We have defined a class containing information about our computers. 
One attribute describes (as char16[]) the aliases for each computer 
(e.g. "{"goedel","mailhost","math","finger"}"). Which query must be used 
to find the entry for a computer having an alias name matching a given 
name or regular expression (e.g. find the computer having alias "math")?

Ludger

---

From: [email-masked] (Paul M. Aoki)
Date: Fri, 09 Jul 93 14:37:24 -0700

Ludger Becker <[email-masked]> writes:,
> name or regular expression (e.g. find the computer having alias "math")?

postquel has no notion of array index range variables
(e.g., "retrieve (comp.name) where comp.alias[i] = "math"").
you would have to write a user-defined function in C that walks 
the array and does the search.  that, or unroll the test:
	retrieve (comp.name) where 
			comp.alias[1] = "math" or
			comp.alias[2] = "math" or
			...
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki