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

Using timezone: Central European Time
* CIA-5 leaves09:40
* CIA-3 joins10:03
* arjanb joins10:31
* rubber joins12:32
hello
someone online?
Well, ok, let me explain the problem; someone probably will read the log:12:34
package testsg;
class P<T> {
() -> T p;
?T get() {
}
}
Uuups, one line got not through my client... once again:
package testsg;
class P<T> {
() -> T p;
?T get() {
return (p)();12:35
}
}
<arjanb>hello
<rubber>Incorrect return type:
Found : T'<t103>
Expected: ?T
Hello Arjan :-)
That error with the latest dev version. I could'nt even compile the latest cvs version ...
Still online?12:38
<arjanb>i can reproduce the error but have no idea what wrong12:39
<rubber>Ok, good.
<arjanb>do you have this error with older versions too?
<rubber>Yes.
latest "older version":12:40
Nice compiler version 0.9.7 (build 2004.03.15, 15:43:09 UTC)
Compiled using JDK 1.3.1
well, that is the latest version, I tried.
Do you think it will hurd to use cast()?
I've also found out, that recompile_all does not work in all cases! I need to delete the package.nicei on my own.12:42
<arjanb>no
<rubber>And the actuall make complete ends with:12:43
make[1]: *** [nicedoc] Error 2
<arjanb>can you comment out the nicedoc part in the makefile12:46
the problem of the bug looks similar to http://sourceforge.net/tracker/index.php?func=detail&aid=738496&group_id=12788&atid=36278812:47
the following works for me:12:48
class P<T> {
() -> T p;
<V | T <: ?V> ?V get() {
return (p)();
}
}
<rubber>:)12:50
That does work for me too. Now that I now about the ?T <-> T issue.12:53
Ok, if I remove nicedoc, the compiler get's generated (except for a new ANT-TASKdef, cause this includes references to nicedoc).12:55
<CIA-3>03arjanb * 10Nice/src/nice/tools/doc/htmlwriter.nice: make nicedoc compile again.13:09
<rubber>:)13:11
Fix does work.13:29
How would you do something like:14:02
class C {
() -> C = () => this;
}
ahh, a custom constr. should work...14:03
No.
new C() {14:04
C c = new C(c: cast(null));
c.c = () => c;
return c;
}
<arjanb>what are you trying to do?
<rubber>but that does not work?14:05
The last statement must be a call to 'this' constructor14:06
is the error for the above constr.
Th code is a simplified example.14:07
<arjanb>yes a custom constructor can only call other constructors
what is the use of a function that returns 'this'?
<rubber>The function c constructs other objects with reference to "this".14:08
It a callback situation.
I now, why this is undefined, but it would be possible to use it.14:09
...since the object this is already loaded if I'm going to use this.14:10
Do you know a way out?
<arjanb>hmm i find it strange you can't use this there14:13
<rubber>if I would be able to use return in a custom constr. it would work, but that only with cast(null).
Well, this must be undefined, because you would be able to access fields, that are not already defined.14:14
<arjanb>class C {
()->C c = () => throw new Exception();
{ // initializer
c = () => this;
}
}
<rubber>Great. Just forgot about the initialisers.14:15
Can we use more than one { } construct in one class?14:16
or is only one allowed?
Seems so, as if we are allowed to use more than one {}; which order?14:17
<arjanb>multiple are possible but they just get concatted by the compiler in order of declaration i think
<rubber>Ok.14:18
Thnx14:24
void release(?T t) {14:29
if (t != null) {
s.push(t);
Arguments (nice.lang.Stack<T'<t3630>>, !T) do not fit:14:31
<T> T push(nice.lang.Stack<T>, T)
what do you think about that?14:32
Arguments (de.xantro.e3m.lite.os.Pool<de.xantro.e3m.lite.os.Worker>, ?de.xantro.e3m.lite.os.Worker) do not fit:14:33
<T> nice.lang.void release(de.xantro.e3m.lite.os.Pool<T> this, ?T t)
Why does that not fit?
everytime I'm using ? I run into trouble.14:34
<arjanb>which type has s?14:56
for type params with a ? you can better use constraints as in your first problem14:58
<rubber>Stack<T> s = new Stack();15:00
<arjanb>so same problem again15:01
<rubber><V | T <: ?V> void release(V t) {15:02
if (t != null) {
nice.lang.Stack.push(s,t);
Arguments (nice.lang.Stack<T'<t3629'<t3635>>>, !t3634) do not fit:
<T> T push(nice.lang.Stack<T>, T)15:03
<arjanb>the second V needs a ? too
<rubber>Ok, then I didn't understand, what that does mean...
Arguments (nice.lang.Stack<T'<t3628>>, !V) do not fit:15:04
<T> T push(nice.lang.Stack<T>, T)
<arjanb>it's a argument now so you need to swap the constraint15:05
?V <: T
<rubber>:?
?Worker w = ...15:07
wp.release(w);15:08
Arguments (de.xantro.e3m.lite.os.Pool<de.xantro.e3m.lite.os.Worker>, ?de.xantro.e3m.lite.os.Worker) do not fit:
<V, T | ?V <: T> nice.lang.void release(de.xantro.e3m.lite.os.Pool<T> this, ?V t)
<arjanb>now i'm confused too15:09
<rubber>:)
<arjanb>the combination of option types and type params really needs to be improved before 1.015:12
<rubber>It would be better. 15:14
Should I send you the file; maybe you find a solution if you've got the whole overview?15:15
<arjanb>not needed i think
<rubber>Do you have an idea already?
I've send you the file anyway...15:18
<arjanb>not needed i think15:25
grmbl i have tried all combination that make sense to me15:26
<rubber>I've changed the code, but this is really a weird thing15:27
<arjanb>i found an ugly workaround15:34
<T> void release(X<!T> this, ?T t) 15:35
{
if (t != null)
this.s.push(t);
}
<T> void release(X<?T> this, ?T t)
{
if (t != null)
this.s.push(t);
}
<rubber>Hmmm, this I recognized alraedy sometimes, that if defined outside the class it works...15:37
...why?
<arjanb>class type params do already have a nullness part15:38
and method type params have any type15:39
<rubber>Ah.15:41
<arjanb>*away for 2 hours*16:02
* Bluelive leaves16:46
<rubber>Ok, I'll leave for today... Thnx for your help16:51
bye
* rubber leaves
* CIA-3 leaves20:19
* CIA-3 joins20:42
* CIA-3 leaves20:47
* CIA-6 joins

Generated by Sualtam