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

Using timezone: Central European Time
* CIA-3 leaves02:30
* CIA-3 joins02:31
* arjanb leaves02:32
* hallucinogenic joins05:17
* hallucinogenic leaves06:29
* arjanb joins10:02
* fcb joins10:15
* bonniot joins10:38
<fcb>ah, hello10:40
I have a question/problem, as usual
String hexEncode(int i);10:46
for(char c : chars) {
if(!Character.isLetterOrDigit(c)) {
Encountered "c )".10:47
Was expecting one of:
<bonniot>it's the cast10:59
it shouldn't be
(int) c
<fcb>so casting in nice looks like (is a?) method call?11:31
<arjanb>yes for primitives it's a method call11:41
because it isn't really a cast but a conversion
can package names have funny characters in them?
(such as $)11:46
<arjanb>it's possible though unlikely anyone whould do that11:47
<bonniot>package names are like identifiers11:59
so $ should be valid, but it's also valid in a file name afaik12:00
therefore no need to convert those
<fcb>but if I'm using it as an escape char then I need to encode it
<bonniot>not if you handle package names and method names differently12:02
package names should need no escaping at all, so $ cen be a normal char in this context
<fcb>right, so key points are that $ is not a funny char and that package names cannot have funny chars in them12:04
<bonniot>right :-)
method names can have those character because of the `...` syntax12:05
<fcb>cool :)
<CIA-3>03fbarber * 10Nice/src/nice/tools/doc/htmlwriter.nice: Filenames should now be compatible with all operating systems.12:16
<fcb>not testing on windows yet, but it really should work!12:19
<bonniot>are you ready for some comments?
<fcb>what do you mean?12:20
comments as in criticisms or comments as in /**comment*/ ?12:21
<bonniot>just did a new run of nicedoc on nice.lang
suggestions :-)
<fcb>yes, fire away12:22
<bonniot>when you print the comments, /** and */ be be stripped away
<fcb>that is a bug - I thought they were stripped. can you give me an example?12:23
<bonniot>another thing is that there needs to be escaping of <
for instance nand has type <B | B:nice.lang.BooleanAlgebra> (B, B)->B12:24
that puts the html in bold mode ;-)
Method foreach12:25
<T> nice.lang.void foreach(nice.lang.Collection<T> collection, (T)->void action)
./** Perform action on each element of collection. */
(added the . because of IRC)
<fcb>is the foreach an example of comments that aren't stripped?12:27
<fcb>the '<' is a bit of a problem
I wanted people to be able to write html in their comments, so they could bold things etc if they wanted to12:29
or displays tables or include links or whatever12:30
<bonniot>yes, that's a good idea12:31
the thing is when you transform a type into a string, you should escape < into <
you can < inside a comment intact12:32
<fcb>so we aren't talking about the actual comment section here. ok. that makes sense
<fcb>ok, I'll put those problems on my do-to list12:36
<bonniot>thanks :-)
<fcb>I'm going to go and make dinner now. see you later :)12:37
<bonniot>bon appetit!
* fcb leaves
<CIA-3>03bonniot * 10Nice/stdlib/nice/lang/native.nice: Added nicedoc comments.12:45
<arjanb>couldn't instanceof get a more precise type?12:53
<bonniot>yes, probably. what is your proposal?12:54
<arjanb><T,U,X | T <: X, U <: X> boolean `instanceof`(T value, Class<U>)12:55
<bonniot>that's equivalent to12:56
<T,U | U <: T> boolean `instanceof`(T value, Class<U>)12:57
<arjanb>i want to say that they most have a common subtype12:59
<bonniot>then it should be X <: T, X <: U13:00
X being the common *sub*-type
<arjanb>hmm i'm confused13:01
<bonniot>X must be the common subtype of T and U, right?
<arjanb>no supertype i think13:02
<bonniot>you just said 'i want to say that they most have a common subtype'13:03
<arjanb>i want an instanceof that can never be true not passing the typechecker13:08
<arjanb>and i too confused now to know how
<bonniot>well, let's call X the runtime type of the value13:10
then instanceof returns true iff X <: U13:11
T is the static type of the value
so we have X <: T13:12
<arjanb>i see
<bonniot>i agree it can be confusing, so it's good to put down all the facts, and the solution comes :-)13:14
<arjanb>int[] i = [0];13:25
assert i instanceof int[];
Arguments (nice.lang.int[], nice.lang.Class<?nice.lang.int[]>) do not fit:
<T, U, X | X <: T, X <: U> nice.lang.boolean `instanceof`(T value, nice.lang.Class<U>)
<bonniot>it's the ? that's problematic13:29
the thing is that if you do String[].class.newInstance(), you should get a ?String[]13:30
so atm String[].class has type Class<?String[]>13:31
<arjanb>so newInstance needs to be overloaded for arrays?13:36
<bonniot>I don't think it would be enough, because there is an infinite number of nested arrays14:23
i guess at this point it's not worth the trouble, we can keep instanceof as is
* bonniot leaves16:26
* bonniot joins18:21
<arjanb>i think i can implement large parts of local inference inside nicec without affecting current typechecking18:25
<bonniot>sounds goods. what's the trick?18:28
<arjanb>in a pass before typechecking introducing some 'fake' ast elements that relay operations when run through the existing typechecker18:30
new expressions:18:34
represents a value of an local variable/constant
is single assignment and can only be used in one of parallel control flow branches
represents an expression usefull for rewriting certain constructs
a local variable/constant that is captured in closure
new statements CopyValue, MergeValues, SplitValues, MergeLoopValues, ReadCapturedVar, UpdateCapturedVar18:36
<bonniot>would having an additional pass be simpler compared to modifying the typechecker?18:40
<arjanb>yes because it splits the complexity into 2 passes18:42
and i probably need a preparing pass anyway to gather all the information typechecking needs18:44
these changes will take quite some time and i don't want to get out of sync with the main tree18:48
<bonniot>so how do you plan to do that?18:54
<arjanb>adding classes and methods without using them18:57
<bonniot>into cvs?19:10
<arjanb>when a fair part is done yes19:12
well i guess i just should get started and see about integrating later19:28
<bonniot>it's not a good idea to commit into cvs before it's working19:37
you can do 'cvs update' to keep in sync with the main tree
<arjanb>i know19:42
now converting Block.java and that is probably the last in this serie of conversions20:34
converting the definitions would require removal of the use of specific definition classes in java source20:48
<CIA-3>03arjanb * 10Nice/src/bossa/ (13 files in 2 dirs): Converted block and local variables to nice code.23:51
<bonniot>good night00:46
<arjanb>good night01:17
* bonniot leaves01:18

Generated by Sualtam