[Monetdb-developers] Simple bat operations
darabi at web.de
darabi at web.de
Fri Oct 12 17:14:40 CEST 2007
Sorry, I had sent out this mail, before I received Martin's
mail with the clarifying information:
> If you would have packaged both instructions in a function, it would
> work as expected,
> because io.print can handle any BAT thanks for being a 'pattern'
----- Original Message -----
From: darabi at web.de
To: monetdb-developers at lists.sourceforge.net
Cc: "Martin Kersten" <Martin.Kersten at cwi.nl>
Sent: Freitag, 12. Oktober 2007 17.05 Uhr (GMT+0100) Europe/Berlin
Subject: Re: [Monetdb-developers] Simple bat operations
> 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);
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:'bat.info' undefined in: i:any := bat.info(pn:any)
!TypeException:user.main:'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
So, bbp.bind(:str) didn't assign a bat to pn?
Is there a way in mal to output the type of a variable?
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Monetdb-developers mailing list
Monetdb-developers at lists.sourceforge.net
More information about the developers-list