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

Using timezone: Central European Time
* bonniot joins11:58
* fcb joins13:38
hello13:43
* arjanb joins13:48
hi13:49
<fcb>I have a question about nice13:53
<arjanb>yes?13:54
<fcb>methods:
in java you declare methods <i>inside</i> classes, which means that I could do something like
new Box().setSize(5,3,6);13:55
but in Nice you declare methods anywhere - does this mean that they aren't linked with any particular object
they are more like procedures or someting13:56
<arjanb>they are not linked to an object but that doesn't make a difference for using them13:59
x.foo(y) is equivalent to foo(x,y)
<fcb>right
so that introduces an interesting scope question14:00
class Box {
int x, y ,z;
}14:01
in Java I would put my setSize(int x, int y, int z) inside that, and it would set the instance variables in the class14:02
but in nice how does my setSize(int x, y, z) work?14:03
I have to do: Box b = new Box();
setSize(b, 2,3,4);
is that the idea?
<arjanb>that's possible but you write it as Box b = new Box().setSize(2,3,4); too14:05
<fcb>ok
so when I define my setSize() method, how do I make reference to the fact it requires a Box object to operate on?14:06
<arjanb>btw you have to give x,y,z of Box a default value to call the constructor without arguments14:07
<fcb>yes, I saw that in the manual :)
<arjanb>you can define the methods just as in java:14:10
class Box {
int x=0;
int y=0;
int z=0;
void setSize(int a, int b, int c)
{
x=a; y=b; z=c;
} 14:11
}
<fcb>but in this case I need to declare it inside the class, rather than outside?14:12
<arjanb>no can also outside:14:13
void setSize2(Box box, int a, int b, int c)
{
box.x=a; box.y=b; box.z=c;
}
<fcb>so I can then say b.setSize2(1,2,3);14:14
<arjanb>yes
<fcb>in that case, if I had a method int power(int a, int b) that does a^b could I do 3.power(5) to do 3^514:17
<arjanb>yes
<fcb>crazy :)14:18
thanks14:19
cheerio14:28
* fcb leaves
<arjanb>can you reach cvs now?14:48
only a short hiccup15:04
<bonniot>i am commiting the part about reporting error when using an ignored symbol16:19
done16:20
<arjanb>the version you committed yesterday has a problem with printing to .nicei the argument types of the nice part of the ignored retyping16:21
are missing16:22
<bonniot>testcaseM16:24
?
<arjanb>the testcases i merged yesterday
<bonniot>ok16:28
maybe the best is not to include the ignored retypings in package.nicei, don't you think?16:29
this would mean that when you compile, you need the features available in the classpath, or they will not be exported16:30
<arjanb>but if you compile the compiler with 1.3 all 1.4 specific retypings will be lost16:31
<bonniot>yes, is that a problem?
othrwise, when you make a typo, it would always end up in the package.nicei
<arjanb>you will get a warning16:32
<bonniot>when you write source for a retyping, you should at least have that available on your own setup, so you can check it is working
yes, you get a warning
but a warning can be ignored
<arjanb>I'm watching the ll3 workshop now :-)16:33
<bonniot>is it interesting?
<arjanb>yes 16:35
<bonniot>which part?
<arjanb>second talk at the moment it's live16:36
but if you thinks it's better not to include ignored retypings i will change that16:38
oh you did that already16:40
<bonniot>yep
i would not mind either if the retypings were included, but it's a bit more complex, and I don't think it's worth it16:41
<arjanb>ok16:43
<bonniot>are you watching the HTML generator language talk?16:47
<arjanb>yes