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

Using timezone: Central European Time
* arjanb leaves02:03
* arjanb joins10:45
* bonniot joins11:15
writing some nice code remembers me of the annoying restriction of using only named arguments in constructors13:06
<bonniot>only with the default constructor, no?13:07
<arjanb>not sure13:08
<bonniot>for the default constructor it would be dangerous to accept unnamed arguments, because the order would depend on the filed declaration order13:09
<arjanb>i don't think that's a problem if the writer of a class realises that13:13
and for many classes all types of the arguments are different13:14
<bonniot>the problem is that the order of fields becomes part of the public API of the class
<arjanb>we could use visibility modifiers to determine which fields are arguments of the default constructor13:18
<arjanb>only public fields would be part of the public default constructor13:21
<bonniot>true, but the problem remains13:26
for public fields
non-public fields could not require a name13:27
but then you might get surprises, and you need to remember the difference13:28
i think most of the time field names are a good documentation13:29
especially as constructors don't have a specific name
what kind of code do you find too verbose?
<arjanb>new Foo(xyz: xyz, abc: abc, name: name, bar: bar);13:30
<bonniot>ah :-)13:31
<arjanb>i write regularly such code with local variables with the same name
<bonniot>yes, me too :-)
i have an idea about this:
when a method/constructor argument is a variable name, and there is no keyword, and the method has such a keyword, use the variable name as the keyword13:32
so you could write new Foo(xyz, abc, name, bar);13:33
what do you think?
<arjanb>looks good but i think it can be confusing13:35
what happens if you use another variable without naming the argument?13:36
<bonniot>a variable that has not the name of any expected keyword?13:37
<bonniot>in that case, it will be like now, no change13:38
so for a constructor it will fail
the idea is just that instead of xyz: xyz you can write xyz13:39
<CIA-6>03bonniot * 10Nice/ (3 files in 3 dirs): Optimize trivial ifs, so that no code is generated at all.13:42
* CIA-6 leaves14:44
* bonniot leaves
* CIA-6 joins14:53
* bonniot joins
* CIA-6 leaves14:54
* bonniot leaves
* bonniot joins14:56
* CIA-6 joins
<arjanb>simplified bug to:15:38
(?int, ?int) tup = (null, 3);
<bonniot>which one?15:41
<arjanb>(null, 3) is compiled to byte[] in bytecode
latest one
<CIA-6>03bonniot * 10Nice/ (2 files in 2 dirs): Better use of context information for compiling tuples (fixes #976723).19:02
* stoffus joins21:48
* stoffus leaves21:54
<arjanb>i can't reproduce Bryn's either23:40
<bonniot>good, it must be only a build issue on his side23:45
good night23:48
<arjanb>good night
* bonniot leaves

Generated by Sualtam