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

<bonniot>arjanb: have you seen the post on nice-info?14:03
is this a bug you fixed since I left?
I think the problem is that the latest development version before you left didn't support leaving a default implementation away14:06
i will update from CVS, and send a new dev ver14:08
* alexgreif leaves14:19
<arjanb>that bug with the linker can be closed i think14:50
at least when there is a new dev version15:07
I'm not sure about the operator precedence of `->` 15:08
the associativity should be right15:22
<bonniot>did you find languages that have this operator?15:34
* master joins15:36
* nice_user joins15:40
Hi all together
Nice to meet you here.15:42
<arjanb>hi did you join this channel twice15:43
<nice_user>No... It's me and a one of my friends.
* master leaves15:44
<arjanb>Did you encounter any problems using Nice?15:45
<nice_user>Yes, few. But up to now all of them could have been circumnavigated.15:46
May I ask some questions?15:48
<nice_user>Ok, let me give the following example:
class FB {}15:49
class FB2 extends FB {
int i;
void foo (FB fb) {
if (fb instanceof FB2) {
fb.i = 1;
This won't compile, because fb is still not recongnized as an instanceof FB2, although I thought, that the compile keeps track about that after the instanceof construct.
<nice_user>Hi Daniel.
<bonniot>for this you should just write a method:
void foo(FB fb);
foo(fb@FB) {}
foo(fb@FB2) {
fb.i = 1;
it's true that the instanceof could be used to track down the types15:51
it might be done in the future
but in most cases using methods is better15:52
<nice_user>Ok. I just thought, it is has been working right now. What I was doing is:
if (fb instanceof FB2)
FB2 real_fb2 = cast(fb);15:53
real_fb2.i = 3;
<bonniot>you can do that, but it's less elegant, don't you think?
<nice_user>Yes, it is.
<bonniot>do you have any issue with witing the method?
<arjanb>daniel: eiffel is the only language i could find with implies it has lower precedence than or and is left associative
<nice_user>Another question would be, what about the .class construct. How could I use it?15:54
<bonniot>arjanb: so we should probably use the same conventions, unless there is a strong argument against it15:55
nice_user: you can use it like in Java
<nice_user>Something like the following won't work:
if (fb.class == String.class)
it gives me compile time errors...15:56
<bonniot>oh, maybe it only works for types at the moment
so String.class works, right?
if (fb.getClass() == String.class)
should work
<nice_user>Well, let me test...just a moment please...
* dagobert joins
<arjanb>daniel: i find left associativity strange15:57
<bonniot>hi dagobert15:58
<nice_user>You're right; .getClass() is working.
<arjanb>daniel: this is debateble so making it non-associative then?
<dagobert>hi bonniot
<bonniot>what would non-associative mean?
that a -> b -> c is a parse error?15:59
<arjanb>yes then are parentheses required
<nice_user>I've already asked the question about the enums on the mailinglist... A'm I doing something wrong there?
<arjanb>no the development version is not up to date with the changelog16:00
<bonniot>no, it was just that the development version was an early prototype for enums
i just uploaded a new version which should work correctly
<nice_user>So, I may download it now?
<nice_user>Yeah, its working, Thnx.
<bonniot>arjanb: yes, it's true that no associativity would be the most clear, and it would not loose much I suppose16:04
<nice_user>Why did you do the following?16:05
void foo(int number);
foo(number) { ... } //correct
//foo(num) { ... } //not valid
<bonniot>because the foo(num) form can be used to dispatch on constants (for instance an enum value)16:06
if you make a typo in a constant name, it would be mistaken as a default implementation16:07
this check prevents this
<nice_user>Ok, are enums in all lowercase allowed?
<bonniot>the idea is also that the name of a parameter is a part of the interface of a method (think about named arguments)16:08
yes, there is no restriction, just like class names
I'm very very interested in the further development of Nice and so also the most actuall development version. May you permit me to become part of the nice-cvs mailinglist, so that I will be kept automatically on the latest news?16:10
<arjanb>BTW instead of writing:
void foo(FB fb) {
if (fb.getClass() == FB2.class) { ..}16:11
you can write
void foo(FB fb);
foo(fb) {...}
<bonniot>nice_user: sure. what is your email?16:12
<arjanb>foo(fb#FB2) { ... }
<nice_user>Thnx@arjanb. Daniel already gave me this example.
<bonniot>no, it is a bit different, because it uses #
@ is like instanceof16:13
# is like comparing the classes (it returns false for subclasses)
<nice_user>My email is <developer@lists.condor-edv.com>, but as this is also a mailinglist I first need the correct address of the nice-cvs mailinglist, because otherwise no emails will be accepted...
<bonniot>The to: field is set to nice-commit@lists.sourceforge.net16:14
<nice_user>Thnx... I will add this to the mailinglist accept list.. just a moment please.
<bonniot>have you tried to subscribe at http://lists.sourceforge.net/lists/listinfo/nice-commit ?16:15
<nice_user>No, this list I did not found.
<bonniot>can you try now?16:17
<nice_user>I'm going to...16:18
<bonniot>why is your email a mailing list?
<nice_user>It's me and my friend (dagobert) who both are very interested in Nice... 16:19
<bonniot>you could also subscribe individually... but i really don't mind16:20
<nice_user>Now we are subscribed, qreat.16:24
<nice_user>Now it would be even more nice, if I could also get the latest cvs version right when I receive the CVS commit message. Is it possible to give read-only access to some users?
<bonniot>it might be, but i don't know how to do that16:27
i was thinking of a system were a new development version would be uploaded automatically, given that is passes all the regression tests16:28
would that be good for you?
<nice_user>You need to checkout the module CVSROOT and adjust the file readers.16:29
But your proposal is also Ok.16:30
<bonniot>do you have an account of SF? could you send me a sample configuration file for the read-only access?
<nice_user>I'll see about my account at sf. The file simply needs to contain all the names of the read-only users... if you have got also a file named writers, this file contains all the users that have write permission... This is normal CVS ... But I do not exactly now, if SF-CVS also works that way.16:32
<bonniot>does this work for ssh access?16:33
what is your user name?16:34
<nice_user>That's what I does not know exactly... My username is rubberduck
<bonniot>isn't the format user@fully.qualified.machine, since the access is from a remote host?16:35
I asked about SF account, because it might be that only SF users can have ssh access
<nice_user>Yes, without an SF account, it mostly would not work.16:36
But if the FQDN has to be part of the username? I don't think so, because then you should/must always have the same FQDN? I really don't now.16:37
<arjanb>no it's user@cvs.sourceforge.net16:39
<nice_user>Oh, Ok.
<bonniot>what do you do? what is making you interested in Nice? do you have projects about it?16:47
<nice_user>Well, let me first go back to the CVS issue. To get "faster" access to your repository, I would need to become a member of the nice Team and then you would need to add a script to disallow me the commit of files with a script as described here: http://sourceforge.net/docman/display_doc.php?docid=772&group_id=1#scriptcvsacls16:52
This is not that easy, I thought it would be.
<bonniot>is the 24h delay a major issue for you?16:54
i could set up the automatic upload of the development version, as this would be useful anyway
<nice_user>Not the 24h issue. But the 'cvs [update aborted]: recv() from server cvs.sourceforge.net: EOF' ... I get this a couple of times until I can update... The automatic upload of the devlopment version would fit my needs perfectly at the moment.16:56
<bonniot>ok, i see. so I will implement that soon16:57
<arjanb>the sourceforge cvs servers have some hiccups the last days :-(
<bonniot>i know SF is working on the cvs issues, but who knows when it will be solved?
<nice_user>So, what I am doing?16:58
<bonniot>i couldn't say! :-)17:00
<nice_user>Sorry, I was on the phone. We are going to implement an application that replaces MS Excel. Not at all at first, but we will give our best to do so. ;-) So out first goal is to write a more powerfull JTable with network distrubuted cells.17:03
does that work that place inside a company?17:07
are you considering using Nice in that project, or is it unrelated?17:08
<nice_user>Maybe; we have got two enquiries to create a new solution to replace Excel. So we are now evaluating how to do.17:10
These two companies use excel and now want more network in their "excel programm".17:11
We won't do that in excel but in java so that also other departments of the company which are using HP-UX can benefit from the change...17:12
The user in Excel is too much God.17:13
<bonniot>because he can change any cell formula?17:14
<nice_user>My study has brought me last term to the functional world of programming and I see a lot of advantages in it. So I googled and we found nice we seems to be a good choice.17:15
Not only that he can change the cells, but that he can also see the logic behing the scenes...
<bonniot>yes, one advantage of Nice is that you can use functional programmingtechniques, while staying compatible with Java17:17
<nice_user>That's the point. A complete jump to dylan for example would be too great to my opinion, because you loose quite a lot of libraries, you are able to use with nice.17:18
We have had also a look at pizza.
<bonniot>did you see the comparison?17:19
<nice_user>Yes, but that was not the only point, why pizza loses: Pizza seems much less being developed than nice.17:20
<bonniot>i see17:21
<arjanb>have you received mail from the commit list?17:22
<nice_user>Yes, Thnx17:23
<arjanb>ok then that works
<dagobert>hi all together, i have a little discussion with rubberduck about the gpl and nice. i know that if we compile and get a new Programm, we can sell it, but if we use the nice Standard-Lib (GPL) we can't sell it. so we have to rewrite the std-lib or the std-lib have to change to (LGPL) is this proper?17:32
<arjanb>you have a good point17:35
<nice_user>So, what do you say?17:37
<arjanb>i think the stdlib can be made lgpl but few things from kawa are also included in the runtime jar
daniel do you know more about this?
<bonniot>this is definitely not desirable that Nice programs automatically become GPL17:42
yes, I think the standard library should be made LGPL
<nice_user>Do you know how many users are already working with nice?17:44
<bonniot>it's quite difficult to mesure17:45
you can see the statictics on sourceforge
<dagobert>-Std-Lib-change to LPGL- this is nice -- for NICE, thanks so my problems (for this development of a applikation) a little bit lesser
<nice_user>and how many members has the mailinglist?17:48
<bonniot>the last full month, june, had ~ 6800 page views and 220 downloads
<nice_user>That's not bet and the trend goes up.17:49
sorry for my typo...
<bonniot>40 members on nice-info17:50
yes, until version 0.8 there was very little publicity around Nice
<nice_user>that's not that much compared with more than 200 downloads... So quite a lot people outside seem to first test it.17:51
<bonniot>i think that not all users want to subscribe to the mailing list
<arjanb>so we would like to know why people don't continue after a first try17:52
<bonniot>it is possible to register to be informed when a new version is released
<nice_user>Quite right. Maybe also add another mailinglist only for anouncements?
Ok, that maybe also enough.
<bonniot>arjanb: yes, but that kind of information is difficult to get, by definition :-(17:53
<arjanb>it's possible to add an anounce list but i don't see the need for it when the traffic on nice-info is low17:54
<bonniot>i think we might add other mailing lists later, when the traffic gets higher
<nice_user>You're right.17:55
<bonniot>are you still in the design phase?
<nice_user>Let me ask a question about currying. Is it possible to write constructs like in haskell, such that the first function reads two arguments, delivers one, the next function needs two, and I initial gave 3 arguemnts?17:56
Not only desing. We are still at the evaluation how long it will take us to build the whole thing and what the costs would be.17:57
<bonniot>do you mean something like:17:58
int->int foo(int x) 17:59
let y = x*2;
return int z => y + z;
foo(2)(3) == 7
that last line was a usage example18:00
<arjanb>there is already a feature request for something like currying: http://sourceforge.net/tracker/index.php?func=detail&aid=672069&group_id=12788&atid=362788
<nice_user>short. Let me search for an example.
<bonniot>that feature request would provide a shorter syntax. but currying in itself is already available18:01
<nice_user>your example is short to what I mean...18:02
Well, your example does want I to be able to do. But as I yesterday thought about it, I saw another thing, that could not solved.18:08
<bonniot>do you have an example for it?18:09
<nice_user>no, I can't imagin, what it was about.
<bonniot>does it have to do with lazyness?
<nice_user>not sue.18:10
not sure
<bonniot>so if you come upon a problem, don't hesitate to ask for help on nice-info18:11
a priori, there should be no fundamental limitation.
<nice_user>Ok, I will come back to your offer.18:13
I would also like to know, how the method substitute works in your example http://nice.sourceforge.net/cgi-bin/twiki/view/Doc/AlgebraicDatatype . I understand, that it simply substitutes all occurences of l.var in the body l.body with v. Is it that simple?18:21
Or am I missing something?
<bonniot>Yes, that's exactly it. The only trick is not to subsitute under a Lambda that would "redeclare" a variable of the same name.18:25
why are you interested in this example?18:26
<nice_user>The table cells also will contain compley expressions...
<bonniot>i see. including the lambda-calculus?18:27
<nice_user>well, I don't think so... :-) But it would be nice.
but we have got something similar (far away from the lambda-calculus) ... we have refernces in our cell-expressions to other cells, even to cells in another virtual machine, and we need to handle this.18:30
<arjanb>daniel there is a bugreport you can close I can't do that yet18:33
<bonniot>ok, i will do it18:36
* alexgreif joins18:37
<arjanb>it's becoming crowded here :-)18:41
<alexgreif>yes :))
but not much traffic :)
<nice_user>Really.... I've read the logs and seen, that up to the beginning of this month only developers hve been in this channel.
<alexgreif>finally all my collegues went home, so I can write nice code!!! No BigBrother is whatching you18:42
nice_user: are you user ?
you /whois tells: H ~master@p508E9406.dip.t-dialin.net (Chief Master)18:43
hi Chief Master!
<nice_user>I'm rubberduck... I'm just ealuating nice for a program I'am going to write..
<alexgreif>and what is your experience with nice?18:44
<rubber_duck>Nice is a fantastic language. Up to know all my problems get solved.
<arjanb>alex you could read the logs of today18:46
<alexgreif>so you have already coded :)) Im currently writing the eclipse plugin, Im urging myself so that you can use it soon
arjanb: I had a timeout.... from when on should I read?
I solved the problem that I had :)
<rubber_duck>I'm not using any IDE.
<rubber_duck>Yes, if you call emacs an IDE, then YES.
For me it is.
<alexgreif>for daniel too :)
<alexgreif>rubber_duck: where are you from? EUrope?18:48
<rubber_duck>Yes, Europe. Germany.
<alexgreif>und in welcher Stadt?
<rubber_duck>In der Kaiserstadt Aachen :-)18:49
<alexgreif>Ich wohne in Berlin bin aber gerade geschC$ftlich in Muenchen
<rubber_duck>Ich habe schon gelesen, das zumindestens Du Deutsch kannst. Daniel aber auch ein bischen...18:50
Und wie es bin Arjan aussieht weiss ich nicht.. Weiss ja nicht genau, wie nahe er an Deutschland wohnt.
<alexgreif>er kann besser ungarisch als deutsch, wir quatschen auch manchmal ungarisch :))
<rubber_duck>Das ist schoen, wenn man sich auf verschiedenen Wegen verstaendigen kann ...
<alexgreif>es agb aber schon heftige Missverstaendnisse :(( weil man aneiander vorbeigeredet hat18:51
<dagobert>klasse, jetzt wird es f?r mich auch einfacher, lesen kann ich ja englisch, nur mit dem Formulieren bin ich zu langsam...
<alexgreif>das ist doch egal!!!!! ich achte z.B nie auf Typos :)18:52
<rubber_duck>Du bleibst dann also leiber bei deutschisch...
<dagobert>ok, dann wieder ins englische zur?ck
<rubber_duck>Und ich sehe Typos erst gar nicht ...
<dagobert>nee mu? nicht sein..
<arjanb>i'm dutch and can read german
<rubber_duck>Das ist prima... Woher kommst Du in den Niederlanden (entschuldige, wenn ich eben Holland geschrieben habe)18:53
<alexgreif>na ja, mir ist es egal, wenn ich Fragen an die Cracks habe dann wird auf englisch geswicht
<dagobert>und niederl?ndisch k?nnen wir auch noch lesen (nein eigentlich nur verstehen) also nichts f?r hier, weder lesen noch schreiben...18:54
<arjanb>aus Enschede
<alexgreif>hopefully our comunity gets bigger and bigger :)) where did you see that there is a nice channel?
<rubber_duck>We saw it on nice.sf.net
Enschede ist nicht weit von Aachen.. Aber so gut wie alles in den Niederlanden ist nicht weit von Aachen.18:55
<alexgreif>who is we? :)
<rubber_duck>Ah, I've got another question. Now that char is now longer subtype of int, it is no longer possible to do something like follows:18:56
foo(int c);
better: Bar foo(int c);
<dagobert>i'm dagobert, we (rubber_duck and me) are developer for a applikation to displace excel18:57
<rubber_duck>foo('=') = new Bar(...);
<arjanb>only if you make it Bar foo(char c);18:58
<rubber_duck>So, I thought, that I just would be able to replace '=' with int('='), but that does not work. I need to supply the integer directly. Is there a possiblity, that this become possible?
<bonniot>why do you need the domain to be int ?18:59
<arjanb>why would you want to declare foo(int c) instead of foo(char c)?
<rubber_duck>I initial wanted this, because I wanted not only to dispatch on characters values but also on other "special" values.19:01
these special values then get high or negative integers and so I'm fine. I know how to circumvent this... I just wanted to know, if it would be easily possible to also evaluate int('=') at compile time... Maybe this is possible for all constanst?19:02
Is the result of a fucntion to a constant every runtime the same? I assume not. 19:04
<arjanb>and how about declaring high unicode number chars as constant and dispatch on them
<bonniot>in general not, since the function could be statefull
<rubber_duck>What was "statefull"=19:05
<bonniot>that is has state
<rubber_duck>Ok, that's a point. 19:06
<bonniot>like reading from a variable, a file, ...
of course we could handle some functions specially, incoluding int(_)
arjan's proposal is a solution, if you know some char values will never be used19:07
the general, clean solution would be to represent differently the "normal" and "special" values19:08
<rubber_duck>Yes, that's what I did afterwards int was no longer subtype of char... (vice versa!)
<bonniot>the problem with the solution using int was also that it does not ensure that the function is called with a valid value19:09
<bonniot>it seems the valid values were characters, and a few special values19:10
but the compiler could not make sure that another int value is not used
so at best the function would fail at runtime
of course the "clean version" can be less efficient, since objects are created19:11
but you can work around that, in case this happens to be critical in the final product
i'll be going soon19:14
<rubber_duck>Ok. I will use the clean version, I think.---
Nice to meet you here in the chat. Hopefully we will see us again.19:15
<bonniot>yes, with pleasure!
<alexgreif>bonniot: mesz vacsorazni?19:17
<bonniot>nem, billardozni ;-)19:18
<rubber_duck>What do you think how long it will take, until the definition of visibilty has been fixated and and when will this be included to nice? I do not only mean by version numbers but time.
<bonniot>arjanb: ?
i would think a few weeks19:19
<arjanb>I will partially implement it after 0.9.0 is released
<bonniot>0.9.0 will be released this week19:20
<rubber_duck>Sounds good.
<bonniot>see you all later
<arjanb>but there are many details that have not been decided yet and the relation with object construction and properties isn't clear yet
<alexgreif>cu! uedv!19:21
* bonniot is away: send me a private message if needed
<alexgreif>arjan ?19:23
<rubber_duck>http://nice.sourceforge.net/cgi-bin/twiki/view/Dev/VisibilityModifiers <-- Up to now everything mentioned there fits my thoughts.
<arjanb>about a few things we aren't sure yet how to implement most are mentioned here: http://nice.sourceforge.net/cgi-bin/twiki/view/Dev/CurrentDiscussions
<alexgreif>arjan: do you know when the create function is called after a nice Object is instantiated? and How?19:24
I only know that its name is create{classname}()19:25
<arjanb>I don't know exactly I have to look at some bytecode for that
<rubber_duck>With what tools you look at the bytecode?19:26
<alexgreif>and which argumants do the create method get? maybe the instance itself?19:27
<arjanb>javap is standard with every sun jvm but dozens of such tools exist19:28
alex: do you have some code
<alexgreif>you mean code where I use the create function?19:29
<alexgreif>no, I dont know whether it has arguments or not
I have a jar now19:31
I send it to you per mail. ok?
<alexgreif>your email? borganism@borganism.student.utwente.nl ?
<arjanb>no arjanb@user.sourceforge.net19:32
I hope I implemented the method right
please check it
<arjanb>it's @users forgot the s
<rubber_duck>Can you read the bytecode? ;-)19:35
<arjanb>yes it's not much more difficult as java code19:36
<rubber_duck>where's some good documentation about it?19:37
<arjanb>have you looked at some bytecode already?19:38
alex I haven't received mail
<alexgreif>I check it...19:39
<rubber_duck>Just an xample
Method test2.Foo3()
0 aload_0
1 invokespecial #6 <Method java.lang.Object()>
4 aload_0
5 aconst_null
6 putfield #12 <Field test2.FooBar afb>
9 return
<arjanb>here bytecode specification link: http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html19:40
<arjanb>as disassembler i use this: http://www.cs.princeton.edu/~benjasik/dis/index.html19:43
i find it better readable
and it has a handy -comment option19:44
<rubber_duck>That looks promising
<alexgreif>arjan: did you find the createXXX invocation?19:45
<arjanb>I found the method but from where do you call it?19:47
<alexgreif>In the manual is written that its called automatically
the paragraph before "Parametric classes"19:48
<arjanb>i think you read the manual different than i do 19:50
<alexgreif>there lacks an example how to use the create function :)19:51
<rubber_duck>What does "Furthermore, it is possible to replace such public-read fields with a methods, without changing the interface of the class" mean?19:52
...it is from http://nice.sourceforge.net/cgi-bin/twiki/view/Dev/NiceConstructors
I understand the paragraph above "Parametric classes" as follows: Simply write a function foo that returns a new instance of the to be instantiated class bar and in the function foo to the additional tasks...19:54
.. so I did it... The convention is only for clearity to my opinion.. It will not be invoked automatically.19:55
<alexgreif>so its only a function that makes a new() and sets the fields and returns the instance?19:56
<rubber_duck>So I did.
<alexgreif>ah :))
<arjanb>so another place where the manual needs clarification19:57
<alexgreif>maybe an example
* dagobert is away: only few minutes19:58
* dagobert leaves
<rubber_duck>Ah, I've got a question again.20:00
Isn't it possible to define constants in interfaces like in Java?
* dagobert joins20:02
<rubber_duck>Hallo again@Dagobert. Has your windows decided, that you should reboot? :-) 20:03
<arjanb>no you can define only global constants20:04
<rubber_duck>Ok. Thnx
<dagobert>yes, my windows has a own opinion of how long i have to work...20:05
<arjanb>and when visibility modifiers are implemented then can also have package and source file constants
<rubber_duck>Thnx for all your help. I will have to go now... We will see us.
<dagobert>bye rubberduck
* rubber_duck leaves
<dagobert>thank you, So long, See you again20:39
* dagobert leaves20:40
* bonniot is back (gone 01:20:49)20:42
<alexgreif> if I implement a function in a package context, how can I call this method from another package? or is it enough to import the package and call the function?20:43
<arjanb>i think so20:46
<bonniot>yes, it is enough20:47
<alexgreif>another questio, what I still dont understand: when do I write void foo() {...} and when void foo(); foo() {...} ?20:50
<arjanb>void foo(); is a methoddeclaration20:53
void foo() {...} is a function
and foo() {...} is a methodimplementation
<alexgreif>one is overridable and the other not?20:54
I remember thats in the manual
<arjanb>yes but overriding doesn't make sense with a no-arg method20:55
<alexgreif>why? if the overriding method has more then zero args?
<arjanb>i mean seperating declaration from implementation makes no sense with a no-arg method since only one implementation can exist20:57
<alexgreif>oops, I thought you said overloaded
<arjanb>having both overriding and overloading is confusing i thought daniel has plans to unify that20:58
<alexgreif>I have a strange error in the following code:20:59
String getFormattedString(String key, String arg) {
return getFormattedString(key, new String[] { arg });
it says: Encountered "[]".-Was expecting one of:- "(" ...- "[" ...- "." ...-
there exists another String getFormattedString(String key, String[] args) {21:00
<arjanb>making arrays in Nice is simpler replace new String[] { arg } with [ arg ]
<alexgreif>aha, so the type is not necessary? because arg is a string?21:01
<alexgreif>cool! is it mentioned in the manual? or do I have a mamory like swiss cheese :)21:02
here another strange one:21:03
String getString(String key) {
return '!' + key + '!';
it tells:
<alexgreif>No possible call for +.-Arguments: (nice.lang.char, java.lang.String)-Possibilities:-java.math.BigInteger `+`(BigInteger, BigInteger)-<Any R> java.lang.String `+`(String s, R o)-nice.lang.int `+`(int, int)-nice.lang.long `+`(long, long)-nice.lang.float `+`(float, float)-nice.lang.double `+`(double, double)21:04
<arjanb>the first operand needs to be a string
<alexgreif>is it still a problem in nice or is it a feature?
<bonniot>you can do "" + '!' + ...21:05
<alexgreif>this is a nasty old trick :9
<bonniot>about literal arrays: [ ... ] works with any type, not just strings :-)
<arjanb>alex: i can't find literal arrays in the manual except in a example: http://nice.sourceforge.net/manual.html#id279799421:06
<bonniot>yes, it should be added as a kind of expression
<alexgreif>ok I found it
<bonniot>for +, we could probably add <T> `+`(T,String)21:08
and String `+`(String,String) 21:09
(otherwise there would be ambiguity for that case)
what do you think?21:10
<alexgreif>so its a shortcut for strings or for all types?
<bonniot>so you can do x + s and s + x, where s is a String, and x is anything21:12
like in Java
<arjanb>if they hadn't overloaded '+' in java then i would take a different operator for string concats
<alexgreif>yes that would make life easyer for java junkies
which one?21:13
<arjanb>not sure
but this "abc" + 2 + 3 == "abc23" and "abc" + ( 2 + 3 ) == "abc5" and that ugly21:14
and how about adding only String `+`(char,String)21:17
<bonniot>arjanb: for this method using integer comparison dispatch, the error message is wrong
void foo(int n);
i think + is useful more generally, like: println(something + " / " + other)21:19
the error message is:
Method nice.lang.void foo(int n) is not completely covered:
no alternative matches (null)
<arjanb>hmm a nullpointerexception on the left side of a string concat21:21
<!T> String `+` (String,T) wouldn't this be better?
<bonniot>well, currently String.valueOf is used, so there is never a nullpointerex21:22
<arjanb>then you print accidently null as in the errormessage
then you don't21:23
<bonniot>yes, !T might be better, if it is not too inconvenient21:24
arjanb: why did you remove the [ "public" | "private" ] in the parser?21:25
oh i see, it is just moved
<bonniot>can you look at the error message?
<arjanb>i'm doing now
<bonniot>thanks. i'm leaving now...
<alexgreif>Q: the following tells me that there is no format method in MessageFormat:21:27
String format(MessageFormat, String, String[]) = native String MessageFormat.format(String, String[]);
<arjanb>you probably have the java type wrong21:30
<alexgreif>if I leave the line away then it tells:
Arguments (java.lang.String, java.lang.String[]) do not fit: -java.lang.String format(?java.lang.String, java.lang.Object[?])
I always have problems with this :((21:31
"?" on the right side tells me always a problem21:32
<arjanb>try String format(MessageFormat, String, String[]) = native String MessageFormat.format(String, Object[]);21:33
for these thing you should really take a look at the java api-docs21:34
<alexgreif>Native method format has not the same number of parameters in Java (2) and in Nice (3)
<arjanb>is a static method thus try String format(String, String[]) = native String MessageFormat.format(String, Object[]);21:35
does this work?21:37
<alexgreif>thanks! is the static format() automatically mapped to MessageFormat.format() or are there any problems if other classes have a static format() too?
yes it works!
thanks, I did not code nice for several month, so its hard to get back21:38
<arjanb>yes there might be other classes with a static format method so you can make the method name more unique21:40
String formatMessage(String, String[]) = native String MessageFormat.format(String, Object[]);21:41
or something like that
<alexgreif>good to know that! thanks21:43
<arjanb>because the last argument is a object array a better signature is
<!T> String formatMessage(String, T[]) = native String MessageFormat.format(String, Object[]);21:44
retyping is easy isn't it?21:45
it reminds me that i should write some tutorial for writing retypings21:46
well the won't get much more complexer as this one:21:50
<K, K0, V0, V | K <: K0, V <: ?V0> ?V0 get(java.util.Map<K, V>, K0) = native Object java.util.Map.get(Object);
<alexgreif>yes, retyping is good especially when java method names are not well chosen, or very generic
so should I use <!T> String formatMessage( ... ?
because of the Object[]
I think these examples would fit very well in the manual, because the one with getName() retyping is the easiest one21:52
<arjanb>yes and i'm not sure whether the element of the array may be null so i choose for not null
<alexgreif>thats the <!T> ?21:54
<alexgreif>fine, this should go in the manual!!!
I mean the complex retyping example
<arjanb>and i remember now that the name doesn't matter of static methods
you should be able to call that method as MessageFormat.format(.... in Nice21:56
<alexgreif>I wonder: it compiles with <!T> String format and <!T> String formatMessage21:57
where is this method called?
surely in:21:58
return MessageFormat.format(getResourceString(key), args);
its a bit confusing that formatMessage in the retyping is never used !?!21:59
<arjanb>you can not only retype java methods but also rename it to some alias
why the retyping isn't used?
<alexgreif>why the name formatMessage is not used22:00
but I cannot write:
return MessageFormat.formatMessage(getResourceString(key), args);
it tells me that MessageFormat has no method formatMessage22:01
aaaah, but I can use:
<arjanb>no you have 2 aliasses of the same retyped method formatMessage and MessageFormat.format are identical22:02
yep! I see!
that should be declared too in the manual, it opens the eyes of many people!! :)22:03
<arjanb>even after a half year of working the nicec sourcecode i don't know every detail of Nice yet :-)22:05
<alexgreif>Thanks, Arjan that was very instructive, but I have to go now and by some pizza
I see Its very mighty!
maechtig in german :)22:06
ok, cu till tomorrow
* alexgreif leaves
<bonniot>did you find the problem, arjan?22:15
i have to go, see you tomorrow!22:20
* bonniot leaves

Generated by Sualtam