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

Using timezone: Central European Time
* rubber joins08:44
* rubber leaves09:33
* bonniot joins10:11
* rubber joins10:49
Hi
* rubber_ joins10:51
* rubber leaves10:53
* rubber__ joins
<rubber>well, now I'm double in here :?10:54
<bonniot>hi rubbers!10:57
* rubber leaves11:14
* rubber__ leaves
* rubber joins11:15
Hi
Now I'm back... :/
Alone...!
<bonniot>:-)11:20
<CIA-6>03bonniot * 10Nice/ (3 files in 3 dirs): Handle catch blocks that have an anonymous function capturing the exception.12:01
<rubber>:)12:05
Only small changes, but great results...?!
<bonniot>that's the definition of the perfect fix ;-)12:10
<rubber>Yeah. Now all errors from beginning of the month are gone?12:11
* arjanb joins12:15
<rubber>hi12:16
<bonniot>hi
<arjanb>hello
<bonniot>rubber: i don't know if all are handled. the best way to keep track of these is to open bug reports
at least all testcases added by arjan are working12:17
was there naything else?12:18
<rubber>Ah, the thing with the tuples... Not a bug, but mabye something missing...12:22
(String, String, String, boolean)[] b = ...?12:23
new (String[], String[], String[], boolean[]);
new (String, String, String, boolean)[length];
Both don't work...
<bonniot>the second would be logical12:28
i guess it cannot even be parsed
<arjanb>yes12:29
<bonniot>you could write a generic function returning a T[], and use it to create the array
<T> T[] array(int length) = new T[length];12:30
<rubber>Incorrect return type:
Found : <nullness, Traw | nullness < nice.lang.Maybe, nullness<Traw> <: T, T <: nullness<Traw>> ?Traw[]
Expected: T[]
<bonniot>right, new T[] would be filled with null12:31
<arjanb><T> ?T[] createArray(int len) = cast(new T[len]);
<bonniot>do you know the values to put into b?
<arjanb>gives this error:
Arguments (<nullness, Traw | nullness < nice.lang.Maybe, nullness<Traw> <: T, T <: nullness<Traw>> ?12:32
Traw[]) do not fit:
<T, U> U cast(T)
<rubber>Got something similar.
<arjanb>quite strange
<rubber>(The values I don't now at once)...12:33
(...know...)
<bonniot>so you want ? elements?
arjanb: if you put ?T[], why would you need to cast?
<rubber>No... cast and init them and after that they are all initialised.12:34
<arjanb>because it doesn't work without cast either12:35
<bonniot>rubber: where do you get the values from?
<rubber>I read the values from a stream iterative...12:36
...at the moment I have "traversed" the storage...12:37
I'm now using a tuple of arrays... But a array of tuples would be "nice"er.
Arjan gave me the hint with the traversed way...12:38
<bonniot>and you know the number in advance?
<rubber>Yes.
<bonniot>you could use a List and toArray
<rubber>But why does <T> ?T[] array(int l) = new T[l]; not work?12:39
Does ?T[] mean, that the complete returned array might be null?
or each part of the array is null?12:40
(not is, but maybe
<arjanb>?T[] == (?T)[]
<rubber>Ok.
And how to express that complete null is returned?12:41
"not is!", but maybe...
<bonniot>?(T[])
<rubber>Ok, thnx for the clarification.
<bonniot><T> ?T[] array(int l) = new T[l];12:42
<rubber>But then <T> ?T[] createArray(int len) = cast(new T[len]); should work, should'nt it?
even without the cast.... Yes, as your example...
<arjanb>you can also use Array<?T> or ?Array<T> to avoid confusion12:43
<bonniot>this works: <T, U | T <: ?U <: T> ?U[] array(int length) = new T[length];
<rubber>*LOL*
<bonniot>it has to do with the distinction between types with nullness markers and raw types
<rubber>T <: ?U <: T <-- ???12:44
<bonniot>same thing as mixing T and ?T in the same type or inside a class declaration
<: means subtype
<arjanb>but then why does the one with a cast fail?
<rubber>Yes, but why T <: ?U and <: T
<bonniot>that means T = ?U12:45
that expresses that U is the raw type inside T
<rubber>Yes, that is what I understand; but why can't I simply write ?U ?!
<bonniot>you mean ?T12:46
<rubber>Yes.
<bonniot>because T is a type, so it already has a nullness marker
so ?T would have two12:47
this should work. i'm just saying why it doesn't at the moment
<rubber>Ah, ok...
<bonniot>you can always workaround, but it would be more elegant
if this was accepted12:48
<rubber>And what about the cast?
<bonniot>arjanb: the cast is not needed, and even if you use it, the "mismatch" is still there
T is used at two different levels
<rubber>Well, have a look at http://confer09.condor-edv.com/nice@freenode/2004-04-02.html 17:32-17:37...12:49
<bonniot>:-)12:50
i "refuge" ?
<rubber>That should have been a joke...12:51
<bonniot>i know ;-)
<rubber>to take refuge fl?chten
Haven't I took the right words???12:52
<bonniot>i never used refuge as a verb
<rubber>Ok, <T, U | T <: U <: T> U[] array(int length) = cast(new T[length]); does also work.
<bonniot>now i see it means "to protect"12:53
you should not use a cast when it's not needed
<rubber>Ah, ok... Isn't it correct.... ? protect, really?
I want a array of length T for a tuple with all values ... And after initilisation, I does not want to use ?T, but T...12:54
<arjanb>if you have the ?T array you can use the fill function12:55
<bonniot>what is "stream iterative" ?
<rubber>read from the stream all values one by one...12:56
<bonniot>InputStream?12:57
<rubber>Well, fill does also use a cast, doesn't it?
DataInput.
<bonniot>fill is safe, it does not matter how it is implemented :-)
<rubber>;-)12:58
<bonniot>the interest of not writing cast yourself is that you have a guarnatee of no runtime error
(or if there is, you know somebody else to beat upon ;-)
<rubber>;-))
<bonniot>i think I would use an ArrayList in this case
<rubber>This part has to be real fast... maybe implementing it native? :-)13:00
<bonniot>fill should work too, you can read one more element in the anonymous function
i would be surprised if the IO is not the blocking aspect, no?13:01
<rubber>right. just kidding.
<bonniot>:-)
you never know...
<rubber>all streams are compressed and encrypted... this was a real speed improvement with the native libs. 13:02
So to come back to the native issue. What do you think, is the first release, nice has support for it?13:03
<bonniot>arjan, you think it's simple to implement?13:04
<rubber>and what about the syntax for the initialisation of tuplearrays...13:05
<bonniot>what is that?13:06
<arjanb>i don't know because i never have used jni but the bytecode side looks simple
<rubber>(String, String, int)[] b = ...
I could sent you some simple examples and instructions for jni...
...but working with gcc would make it much simpler (at least for my instructions)...13:07
<bonniot>ok, could you write a wiki page then?13:08
<rubber>For native code in JAVA?
<bonniot>(String, String, int)[] b =
that already works no?
<rubber>Yes, that`s fine. let (String, String, int)[] b = array(5);
<bonniot>what you want is new (a,b)[] ?
<rubber>yes, ok, then with ?b...13:09
<bonniot>what is ?b ?
<rubber>I meant ?(a,b)[] b = new (a,b)[length];...13:10
...or similar...
<bonniot>wiki page: ideas for handling jni in Nice13:11
<rubber>but also(?) (int a, int b)[] = { (1,2), (4,7) };
<bonniot>that's already handled, i think
only it's [, not {
<rubber>Uuups... too much of my own interpreter syntax... :/
<bonniot>i think [ is more typical of arrays, don't you?13:12
<rubber>true
damn... my fileserver has gone... I'll have to look what's wrong... *away*13:17
* rubber leaves13:30
<bonniot>i'll be back...14:44
* bonniot leaves
* bonniot joins16:27
<CIA-6>03bonniot * 10Nice/ (2 files in 2 dirs): 16:40
Simpler and more flexible typing for 'new T[x]': that expression now has
type ?T, unless T is already known to be a complete, non-raw type.
<bonniot>arjan, is there still a problem with doc comments?16:56
* bonniot is away: until tonight17:39
<arjanb>afaik doc comments work20:17
<bonniot>but franck said some were not provided...20:51
* bonniot is away: ...
* bonniot is back (gone 00:00:03)
<arjanb>it should work unless the compiler creates new definition after parsing22:05

Generated by Sualtam