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

Using timezone: Central European Time
* dubb leaves03:15
* arjanb joins12:06
* fcb joins14:27
hello?15:15
<arjanb>hi15:26
<fcb>aah, hello arjan15:33
I would like to make an array of tuples
(?String,String)[] tags = new (?String,String)[0];15:34
clearly I've got something wrong
<arjanb>we noticed last week that creating arrays of tuples isn't possible yet15:35
<fcb>well, that would probably explain it :)
<arjanb>do you know the values before creating the array?15:36
<fcb>no
I will find a different way of tackling the problem15:37
<arjanb>you could put them in a arrayList
<fcb>as in ArrayList<(?String,String)>15:38
<arjanb>yes
<fcb>yeah, that certainly do the job15:39
that's cool
thanks
oh, one other issue15:40
<arjanb>yes?15:41
<fcb>I have a class, and I have an instance variable that cannot be null, but it will be initialised when the object is created, based on the arguments to the constructor15:43
<arjanb>you can use a custom constructor for that i think15:44
<fcb>that bit's ok15:45
but if I just declare the variable eg: ArrayList list; then I get require initial values "list requires initial value"15:48
because the constructor I use doesn't specify a value for list, the custom constructor works it out15:49
<arjanb>could you show the code that gives the error?15:50
<fcb>sure
class Comment {15:51
//maps tags, such as @param, to values
ArrayList<(?String,String)> tags;
String commentStr = "";15:52
/*Initialisation*/
{
this.commentStr = commentStr;
tags = parse(commentStr);
}
}
void main(String[] args) {
Comment c = new Comment(commentStr: comment);
....
}
Error message:15:53
Fields of class nicetest.Comment require initial values.
These fields are missing:
nice.lang.ArrayList<(?String, String)> tags
<arjanb>this.commentStr = commentStr; is superfluous15:54
ArrayList<(?String,String)> tags = new ArrayList();15:55
<fcb>ok
right, so then the first ArrayList will just get discarded?15:56
<arjanb>or ArrayList<(?String,String)> tags = cast(null); which is safe because you assign it in the initializer
yes
<fcb>yes, that second option sounds good
excellent - many thanks15:57
* fcb leaves16:43
<CIA-3>03fbarber * 10Nice/src/nice/tools/doc/main.nice: Removed superfluous variable "classpath"18:16
03fbarber * 10Nice/src/nice/tools/doc/document.nice: superClass variable might be null. This is now reflected in its declaration.18:19
03fbarber * 10Nice/src/nice/tools/doc/comment.nice: 18:23
This class is used to store and pass comment strings.
This is the initial check-in.
* CIA-3 leaves18:52
* CIA-3 joins18:53
* CIA-3 leaves20:22
* CIA-3 joins20:23
* Bluelive leaves20:25
* Bluelive joins22:10
* Bluelive leaves23:31
* Bluelive joins23:32
* arjanb leaves23:34
* CIA-3 leaves23:59
* CIA-3 joins
* Bluelive leaves00:19

Generated by Sualtam