[Monetdb-developers] bat.new undefined

Fabian Groffen Fabian.Groffen at cwi.nl
Thu Nov 15 09:59:22 CET 2007


On 15-11-2007 09:55:33 +0100, Martin Kersten wrote:
> > The observation is that you cannot reuse variables, unless you want to
> > reuse them for something which has exactly the same type.  The
> > assignment makes that counter intuitive, because it /does/ work when the
> > variable has never been referenced before.
> > 
> The orginal example showed that the variable was already declared, i.e.
> type was frozen.
> mal>        s := bat.new(:void,:oid);
> mal>        bat.setName(s, "schema");
> mal>        bat.setPersistent(s);
> mal>
> mal>        s := bat.new(:void,:void);
> mal>        bat.setName(s, "version");
> mal>        bat.setPersistent(s);

Which is my point.

The first assignment to s succeeds, while the type must mismatch,
because it is still unknown, while the second assignment fails.

I would expect either this:

  declare s[:void,:oid];
  s := bat.new(:void,:oid)

or both assignments to succeed.





More information about the developers-list mailing list