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

Using timezone: Central European Time
<arjanb>a suggestion for a project that brian could do is finding an algorithm for dynamic type inference that takes loops and assignments in account00:50
you should tell him00:52
<arjanb>i have been thinking about this and have found no solution yet
<Bluelive>urghel, trying to build a webserver in alpha01:46
but i keep spending houres upon houres in small sub features :(
<bonniot>what's the goal? include alpha code inside the pages?01:51
write a webserver in pure alpha
proof of concept, and something to test the compiler
i made a few changes, i dont know if i like them, 02:54
using static methods and fields requires using unambiguous type identifier
alpha.io.File.blaat() just gives so much garbage to dynamicly resolve02:55
<bonniot>why not : for package names?03:03
and . for "access"
well its harder to read, . is more of a speudo space
<arjanb>what about alpha\io\FileStream?03:07
<Bluelive>gives troubles in strings, and some issues with translating to on disk storage and such03:09
no ill keep this for the moment
* magnus- leaves03:36
<arjanb>good night
* arjanb leaves
* bonniot leaves
* CIA-2 leaves07:43
* CIA-2 joins07:44
* arjanb joins09:50
* bonniot joins11:55
what are the plans for now?
<bonniot>i'd like to get packages.sf.net going12:54
after that, there are a few features in the pipeline... ;-)12:55
what about you?
<arjanb>i have no idea yet13:17
i can complete the retypings for java.* but that so boring i won't do that at once13:22
<bonniot>you mean add new ones, or remove those that are handled by (!) ?13:27
<bonniot>something that is needed is to make coverage errors all appear like errors, not warnings + an error at the end like now13:30
that's important because in eclipse it seems the warnings are buried somewhere, and it's easy to miss them13:38
they are not warning anyway but real errors, so it will be better like that
jason was lost because of that
could you look at that?13:41
* magnus-- joins13:58
<bonniot>hello magnus14:00
<CIA-2>03arjanb * 10Nice/src/bossa/link/Dispatch.java: Give a single error at coverage test failure.14:32
<bonniot>looks good :-)14:37
see you later15:23
* bonniot leaves
<CIA-2>03arjanb * 10Nice/src/bossa/syntax/Pattern.java: Make patterns in error messages look better.15:48
I have another question17:22
<arjanb>sorry was away18:14
still have a question?18:15
* bonniot joins18:33
<magnus-->yes, i still have a question18:53
<T> String show(Vector<T> v) {
String result="(";
boolean isFirst=true;
for(e:v) {
if(!isFirst) result += ' ';
return result;
on result+=e.show();
it doesn't know which show to use18:54
I'm wondering if there's another way to get the functionality that I'm after
<bonniot>well, show is not defined on arbitrary values, is it?probably you want to use toString18:56
<magnus-->So any function you use in a polymorphic function have to be defined for any T?18:57
<bonniot>it depends what arguments you pass to it
but here e ahs type T18:58
<magnus-->hmm, okay
<bonniot>so if you pas e to afunction, that function needs to accept it
<bonniot>otherwise it would be unsafe, you see?
C++ does things differently, because it will only check when you use the function, I think
<magnus-->yes, but the error will be caught at compile time still19:00
<bonniot>yes, but here the bug is in the implementation, not the caller
so you write your implementation with a bug, the compiler does not complain19:01
<magnus-->I think it's not a bug:)
<bonniot>let's say it was the typo
the function is called toString, not show
let's say it is show, and you write shw19:02
the compiler will let you do that?
<magnus-->yes... in C++ at least... that may not be the best thing, I'm not sure
<bonniot>well, i would definitely expect the compiler tell me if I wrote 'shw' !19:03
<magnus-->My way to see it was that show(vector is only defined for those Ts that can support show()
the problem is that this is not specified, this requirement is buried in the code
<magnus-->aha, there is a way to specify this requirement?19:05
<bonniot>you can specify explicitely, by declaring a Showable interface, and say that T must be Showable
that's the Nice way :-)
<magnus-->Hm, okay, then you have to modify the data structures to add a show()19:06
<bonniot>abstract interface Showable { String show();}<Showable T> String show(Collection<T> c) { ... }
with multimethods, you don't need to modify data structures
you just implement show on the classes that you want to implement Showable19:07
<bonniot>and you can do that even for classes that you import
<magnus-->I want to implement show(Vector<another_showable>)
<bonniot>ex:class java.lang.String implements Showable;show(String s) = s;:-)
sorry, didn't see your last line. why do you want that?19:10
<magnus-->because i want to factor out the common code for all showings of lists
<bonniot>show can be implemented generically, for all Showable types
that's what I did above
<magnus-->aha, okay so you add the interface afterwards19:11
now i get it:)
<bonniot>yes, you can :-)
in this special case, I would advise simply using toString
<arjanb>you can implement the show for collection in one line:19:12
<bonniot>but for more specific situations, this is very handy
<arjanb><Showable T> String show(Collection<T> c) = "(" + c.map(T elem => elem.show()).join(" ") + ")";
<bonniot>nice :-)19:13
i have to go, see you later...19:14
arjanb: nice.. . only problem is nothing else is "Showable" :)19:15
<bonniot>we did not declare showable in the library, because there is toString anyway...19:16
(really away now :-)19:17
back for a short while19:57

Generated by Sualtam