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

Using timezone: Central European Time
<arjanb>i think some kind of checked exception are useful01:07
<T> foreach(Collection<T> c, T->{Breakable}() func) {01:09
let it = c.iterator();
try {
while (it.hasNext()) func(it.next());01:10
} catch (Breakable b) {}
Breakable can be a cheap exception if it's checked01:12
<arjanb>exceptions without a new stacktrace01:59
<bonniot>i don't think you can do that when compiling the anon fun, because the catch might want to print the stack trace02:02
<arjanb>that why it needs to be an checked exception02:05
exception is wrong name here it's more a backtrack thingy02:06
<bonniot>that could also be optimized out by inlining and forced reductions02:21
but it's a but early for that...
<CIA-2>03bonniot * 10Nice/src/nice/tools/typing/Types.java: Minor: conform to docbook.02:25
<arjanb>true such things can wait till after 1.002:26
<bonniot>wrong commit... :-(
<CIA-2>03bonniot * 10Nice/web/manual.xml: Minor: conform to docbook.02:30
<arjanb>good night
* arjanb leaves02:33
* bonniot leaves02:36
* arjanb joins10:58
* bonniot joins12:01
<arjanb>how is the method specialization going?14:35
<bonniot>mostly working14:37
nice.lang is bringing interesting cases, though
for instance:
<Collection C, T> C<T> filter(C<T> coll, T->boolean test)14:39
<Collection C, T, U> C<!U> filter(C<T> source, T->?U converter)
the first is a specialization of the second!
which is not really what we intend
so probably we'll have to rename the second
i'm still making sure that this case works, in case it was really a specialization
<arjanb>can't you make an expection for function types?14:41
it isn't possible to dispatch on them so specialization doesn't make much sense
<bonniot>ideas for the new name (i think we should rename the second, since it is less "standard")14:42
hum, that's right
i already did that for primitive types
so that can be generalized14:44
<arjanb>the same for tuples though is in principle possible to dispatch on them
<bonniot>i'll look through my new testcases
at least some of them are not specific to functions14:46
<bonniot>// PASS14:48
/// Toplevel
class A{}
class B extends A {}
class Z {}
void foo(A,?Z) {}
void foo(A,Z) {}
foo(B x,z) {}
<arjanb>i don't see the problem here14:49
<bonniot>the default impl of foo(A,Z), for instance, used to have (_,_) patterns, since it it the less specific for (A,Z)14:51
but now that it also belongs to (A,?Z), it needs patterns added
<arjanb>so the setting of the any patterns should depend on the method it specializes14:53
<bonniot>well, we need to set them if the method specializes any other14:54
the value we set them to depends on the method they implement14:55
<arjanb>you can simply comment to body of method setDomainEq in Pattern.java 14:56
hmm DefaultMethodImplementation doesn't use that14:57
<bonniot>it's already working, don't worry14:58
it was good that you pointed that functions are not dispatched on :-)14:59
<arjanb>happens everyone when diving into something that you don't see some simple things anymore15:02
i looked at the signatures and I thought: yep, compiler's right, this is specialization...15:04
funny thing is that I already handled primitive types
List<String> split(String str, String separator)15:30
that's problematic since there is in JDK1.4
public String[] split(String regex)
i guess we could simply remove our method15:31
<arjanb>or make it char separator15:32
a regex is a bit bloated for a simple split15:34
good idea
<CIA-2>03bonniot * 10Nice/stdlib/nice/lang/collections.nice: Corrected nicedoc comment for filter.16:29
03bonniot * 10Nice/web/.htaccess: Released 0.9.616:31
<Bluelive>how do you store the type information on a parametric class ?16:34
i currently store the runtime type of the T for example16:35
<arjanb>nice uses erasure
<Bluelive>the works great for List<String> but List<List<String>> is completely type unsafe at the moment in alpha
erasure ?
<arjanb>type params exist only at compile time and are erased when generating the bytecode16:37
<arjanb>but what is unsafe in alpha?16:39
<Bluelive>that wont work for me
i dont have the no classcast expception thing
class List<T>
at runtime it has a T field whihc points to a Class object16:40
but the class object does not have a T because that would mean i need to instance it loads of times16:41
so i cant safely check if i have a List<List<A>> or List<List<B>>
when i only have a List
<arjanb>nice code doesn't throw classcast exceptions except when you use reflection or serialization16:46
<bonniot>... cannot ...16:47
or explicit casts, but those are secret... ;-)
<Bluelive>well i guess ill have to redesign it so that i can have type descriptors that recursivly can contain parametrics16:48
<arjanb>why do you want to use the type params at runtime?16:49
<Bluelive>because alpha is more like java16:50
casting needs a runtime check
for parametrics it needs to check all fields recursivly16:51
<arjanb>you can do without casts when you have parametrics
in theory anyways
but i allready have code that uses a dynamic cast
<arjanb>can't you change the casts in alpha so that you can't cast the type params?16:53
<Bluelive>well then you cant ever get back fro a Object to a List<T>16:56
<bonniot>NiceSwing still uses '@'. it would be good to convert it. Jason was confused...17:12
<arjanb>can't that be done with some regex?17:27
do you have an editor with regexp replaces?
<arjanb>it seems so, trying out now17:33
replaced by \2 \1
(didn't try it)
that wouldn't handle additional patterns, but that's rare (prob. none in NiceSwing)
<Bluelive>thats not very unicode friendly
<bonniot>the code is in english17:36
yes, for a general tool it would be important
i'm just not sure what arjan's editor supports
grep has [:alpha:]17:37
or \w
<Bluelive>try jcreator le, it doesn alot of encoding wihtout problems
<bonniot>that's not an issue, since the code in question is ascii17:38
<arjanb>why does it needs to use a non standard syntax? and it's buggy too :-(18:13
<bonniot>what does? your editor?18:22
<CIA-2>03bonniot * 10Nice/stdlib/nice/lang/strings.nice: 18:39
Modified split to use a character separator. JDK 1.4 includes a
String.split(String), where the second argument is a regexp. It's not necessary
to duplicate that functionality, but spliting based on a single character is
a useful special case.
<arjanb>ugly regex: ^([.A-Z, a-z, 0-9]++^)[@#]^([~,)]++^) 19:17
and i still had to fix some by hand
<bonniot>yeah, does not look standard19:19
but not more ugly than the average regexp :-/
<arjanb>the compilation of swing has become faster19:25
<bonniot>how much? since when? why? (the Domain change yesterday? less retypings? the new disdpatch syntax?)19:26
<arjanb>about a factor 2 since a month ago19:27
<bonniot>not bad :-)
and it does more work too (checking java method's implementation)19:28
<arjanb>so less retyping and smarter checking of java methods does help
* bonniot is away: for the evening19:29
<CIA-2>03arjanb * 10swing/src/nice/ui/common/ (15 files in 3 dirs): Syntax update for niceswing (new pattern style, removed Any keyword).19:32
* bonniot is back (gone 04:17:07)23:46

Generated by Sualtam