Bugs item #2051271, was opened at 2008-08-14 13:22
Message generated for change (Comment added) made by mlkersten
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2051271&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core
Group: MonetDB5 CVS Head
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Fabian (mr-meltdown)
Assigned to: Martin Kersten (mlkersten)
Summary: M5: true, false and nil unavailable in a function
Initial Comment:
# observed 14-08-2008: true, false and nil are not available in a
# function, whereas they are locally
function user.myfunc(i:int):bit;
barrier ifpart := i == 1;
return(true);
exit ifpart;
barrier ifpart := i == 2;
return(false);
exit ifpart;
barrier ifpart := i == 3;
return(nil:bit);
exit ifpart;
end user.myfunc;
#!TypeException:user.myfunc[2]:'true' may not be used before being initialized
io.print(true);
p := user.myfunc(1);
io.print(p);
io.print(false);
p := user.myfunc(2);
io.print(p);
io.print(nil:bit);
p := user.myfunc(3);
io.print(p);
# no idea what this does
p := user.myfunc(4);
io.print(p);
Added as tests/BugReports/Tests/notruefalsenil
----------------------------------------------------------------------
>Comment By: Martin Kersten (mlkersten)
Date: 2008-08-17 08:23
Message:
Logged In: YES
user_id=490798
Originator: NO
Invalid part:
A missing module name is considered a reference to the current module.
This way all functions/patterns/... are associated with the module in
which
they are defined unless explicitly told otherwise.
This also applied to function calls.
Valid part: Stricter parsing and error handling is needed.
Error message for true/false/nil is improved
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2008-08-16 23:49
Message:
Logged In: YES
user_id=963970
Originator: YES
I don't really understand it, but it sounds like the bug is invalid then?
Also, I do not understand your change to the test.
First, by changing the test, you no longer IMO test the bug.
Second, it seems some "myfunc" is falling out of the air (I don't like the
assumption it's just equal to "user.myfunc").
Third, it seems the parser doesn't really return indicative error messages
judging by the changes made to this test.
----------------------------------------------------------------------
Comment By: Martin Kersten (mlkersten)
Date: 2008-08-16 20:00
Message:
Logged In: YES
user_id=490798
Originator: NO
A RETURN qualifier should be used in combination with an assignment.
A function should have at least on return statement at top level,
because you can not statically ensure it will be handled deeper.
These changes have been reflected in the test and stricter parsing.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2051271&group_id=56967
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs