Subject: Functions in querys

From: [email-masked]
Date: Wed, 28 Apr 93 23:47:47 -0700

Suppose you wish to compute some function of an attribute which
requires as input the results of some other computation on an
attribute.  For example, suppose you have a function

    define function atype_foo
      (language = c, returntype = aType)
      arg is (aAtrType)
      as "atype.so"

which returns the ``fooishness'' of an attribute of type aAtrType.
Suppose you have another function:

    define function atype_fee
      (language = c, returntype = anotherType)
      arg is (aAtrType,aType)
      as "atype.so"

which returns the ``feeishness'' of an attribut of type aAtrType,
given the ``fooishness''.  Assume both functions take lots of time to
compute. 

How do you query to get both of these values in one pass?

What I want to do is something like

  retrieve (foo=atype_foo(i.attr),fee=atype_fee(i.attr,foo)) from i in
   CLASS;

But that doesn't work (in 4.0.1).  Is there a general solution for
this type of thing?

---
 Robert Withrow, Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: [email-masked]
 R.W. Withrow Associates, 21 Railroad Ave, Swampscott MA 01907-1821 USA