Log of the #nice channel on irc.freenode.net

Using timezone: Central European Time
* arjanb leaves02:09
* CIA-2 leaves12:07
* CIA-2 joins12:08
* rubber joins12:23
hello.
No one in here.
Maybe someone reads the logs...
Why does the following not work?:12:24
class C {}
class D extends C {}
Iterator<D> getIt(List<C> dq) {12:25
List<D> d = dq.filter(C j => j instanceof D);
return d.iterator();
}
Incorrect type in assignment to d
Found : <U', t112' | U' < nice.lang.Maybe, nice.lang.Sure < U', testsg.C < t112'> nice.lang.List<U'<t112'>>
Expected: nice.lang.List<testsg.D>
*standby*12:28
* arjanb joins13:02
hello
<rubber>hello
Have you read the log?
I just found another bug!13:03
<arjanb>reading now
<rubber>let (User) -> (Job -> ?OscoccoJob) oscocco_job_filter = (User u) => (Job j => {13:04
if (j instanceof OscoccoJob) {
} else return null;
Sorry, one line again gets eaten up by my client :(13:05
once again:
let (User) -> (Job -> ?OscoccoJob) oscocco_job_filter = (User u) => (Job j => {
if (j instanceof OscoccoJob) {
if (j.u.equals(u)) return j;
else return null;
} else return null;
});
this throws an npe:
[nicec] Stack trace:
[nicec] Exception in thread "main" java.lang.NullPointerException
[nicec] at gnu.expr.LambdaExp.declareClosureEnv(LambdaExp.java:378)
[nicec] at gnu.expr.LambdaExp.allocChildClasses(LambdaExp.java:936)
[nicec] at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1516)
[nicec] at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:563)
[nicec] at gnu.expr.LambdaExp.compile(LambdaExp.java:656)
[nicec] at nice.lang.inline.Return.compile(Return.java:43)13:06
[nicec] at gnu.expr.ApplyExp.compile(ApplyExp.java:180)
...
<arjanb>the first goes wrong because the compiler isn't so smart13:08
<rubber>What does that mean?13:09
Is it wrong syntax?
Or have I not used the right "type" semantics?13:10
<arjanb>instanceof and filter don't work together
<rubber>ah, ok. :(
Will it ever?13:11
Anyway; then I proceed and used the T->?U filter.
And then I got this NPE...
<arjanb>it's almost impossible to have the compiler figure this out
<rubber>Ok; so I'll stay with the T-?U filter.13:12
I want a function variable that is a function to create a function. That should work, should'nt it?13:13
<arjanb>yes
<rubber>So, is the syntax wrong, that the compiler get stuck?13:14
I've already played around with the parenthesis, but I haven't had luck until now.13:15
<arjanb>i get the same npe13:16
<rubber>Ok. But can we also find a solution with NPE ;)
withOUT
Uups, this already works again:13:18
let User -> Job -> ?OscoccoJob oscocco_job_filter = User u => Job j => {
return null;
};
<arjanb>it goes wrong when the outer argument is used13:23
<rubber>Ah, ok.
You're right.
Can you fix it?13:24
<arjanb>how often do you need this construct?13:31
<rubber>Well, about 9-15 times this special one; but I just started loving functions that create other functions.13:32
The code becomes much shorter, cleaner and more readable.
<arjanb>i see :-)13:33
as a workaroud you could make it a toplevel function13:48
<rubber>?13:49
How to make it a toplevel function?
<arjanb>Job -> ?OscoccoJob oscocco_job_filter(User u) = Job j => ...13:50
<rubber>Ah, ok. Understand13:53
But that is less elegant.13:54
<arjanb>why?13:55
<rubber>a -> ... -> hhh ff is more readable.13:56
..than a -> ... ff(...)...
<arjanb>it's a matter of taste14:02
<rubber>True.
But the toplovel function does work.
Do you think, the error is fixable?
<arjanb>i can easily avoid the NPE but i don't know what side effects that has14:03
<rubber>If you don't, I also don't.14:05
<arjanb>i have tried a few but they all cause some exception elsewhere14:23
<rubber>:(14:24
weird
<CIA-2>03arjanb * 10Nice/testsuite/compiler/functions/clotures.testsuite: Testcase for a code generation bug (NPE when compiling a global constant with nested anon functions aa value).14:28
<arjanb>just got mail from daniel: "I'll be inFrance for about 10 days, so I will have only access to internet once in a while."14:30
<rubber>Good to hear.14:31
<CIA-2>03arjanb * 10Nice/testsuite/compiler/functions/clotures.testsuite: Don't forget the bug marker.14:34
<rubber>Ok, I'll 've to leave.15:29
CU
bye
<arjanb>cu
* rubber leaves
* fcb joins16:33
hello arjan16:34
<arjanb>hello
<fcb>how are you going?
<arjanb>good16:35
<fcb>I was hoping to ask about docString
oh, and sorry for my silly bugfix request btw16:36
<arjanb>np
<fcb>basically, docString often doesn't return anything16:38
<arjanb>yes because most methods don't have any documentation yet
<fcb>I am testing on my own code - ie, using nicedoc to document nicedoc :)16:39
so I put comments in but they don't get returned16:40
<arjanb>do they start with /** ?
<fcb> /**16:41
* Default implementation - does nothing
* @param d a definition to document
* @param packageName the name of the package this definition is in.
*/
void write(Definition d, String packageName) {
}
docString returns null for this
<arjanb>strange16:42
<fcb>yeah16:43
<arjanb>does it always return null?
<fcb>no it worked for "nice.lang.int OK = 0", but that's the only one that seems to have worked16:45
but I don't seem to have the source for this file16:47
<arjanb>it seems to work here17:02
<CIA-2>03fbarber * 10Nice/src/nice/tools/doc/htmlwriter.nice: htmlwriter now dumps the docString to the page for classes, methods, and global vars. However, docString doesn't seem to be working properly.
<fcb>oh?17:03
what have you tried it on?17:05
<arjanb>just some testcode
have you tried to put a doc comment before the class def?17:06
<fcb>no\
I tried a method
<arjanb>are you sure that the documents are regenerated17:08
<fcb>they had the right timestamp (I put a comment in with the time the page was generated)17:10
ok, it worked for the class, but not the for method17:11
the method is declared inside a class - is that having an impact do you think?
<arjanb>could be there are multiple kinds of methods definitions17:14
<fcb>you mean that I have17:16
void write(Definition d, String packageName) {
write(c@ClassDefinition.Class, packageName) {
write(gv@GlobalVarDeclaration, packageName) {17:17
...
<arjanb>why don't you put some println in the default implementation of write to see you don't skip some case
<fcb>ok17:18
<arjanb>System.err.println("Ignoring " + d.getName() + " (class: " + d.getClass().getName() + ") with docString: "+ d.docString());
<fcb>nearly all the docStrings where null17:21
anyway, its getting late over here - I need some sleep
* CIA-2 leaves
<fcb>perhaps we could take this up again later
<arjanb>ok good night17:22
<fcb>cya
* fcb leaves
* CIA-3 joins18:23
* khc joins23:48

Generated by Sualtam