[Monetdb-developers] Simple bat operations

darabi at web.de darabi at web.de
Fri Oct 12 17:05:43 CEST 2007


> A more informative error mesage might help --- from a user's point of view,
> variable 'b' has been initialized before it is used.

I would second that. 

> In fact, the above
>	b:bat[:int,:int] := bbp.bind("test");
> is wrong --- or at least implies a silent cast from :oid to :int of the
> BAT's head --- since bind returns a bat[:oid,:any_1], i.e., only the tail
> type is "unknown" or "generic".

The type system seems to think that b is b:any and not b:bat[:any_1,:any_2].

When I do this:

mal>n := bat.new(:void,:str);
mal>bat.setName(n, "person_name");
mal>bat.setPersistent(n, true);
mal>transaction.commit();
mal>\q

then come back to bind person_name like this:

mal>pn := bbp.bind("person_name");
mal>i := bat.info(pn);
MAPI  = monetdb at localhost:50000
QUERY = i := bat.info(pn);
ERROR = !TypeException:user.main[1]:'bat.info' undefined in: i:any := bat.info(pn:any)
        !TypeException:user.main[1]:'pn' may not be used before being initialized

the first error message sounds like the 'function dispatch mechanism'
(whatever that might be) was searching for a function bat.info(pn:any)
and didn't find it.

Looking into the code, I see something which could possibly match in
function typeChecker (MonetDB5-server/MonetDB5/src/mal/mal_resolve.mx 
line 644).

So, bbp.bind(:str) didn't assign a bat to pn?

Is there a way in mal to output the type of a variable?

Thanks


Kambiz





More information about the developers-list mailing list