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

Using timezone: Central European Time
<bonniot>bye00:40
* bonniot leaves
* arjanb leaves00:52
* ChanServ leaves04:04
* Bluelive leaves
* magnus-- leaves
* CIA-2 leaves
* ChanServ joins04:06
* magnus-- joins
* Bluelive joins
* CIA-2 joins
* arjanb joins10:55
hello10:59
* bonniot joins12:25
hey12:29
<CIA-2>03bonniot * 10Nice/src/bossa/link/Compilation.java: 15:34
Do not rely on printStackTraceWithSourceInfo to be present in
nice.lang.dispatch, since that class might have been generated by an earlier
compiler.
<arjanb>i think some form of pass by reference is useful17:27
void inc(var int x) { x++; }
var int i = 0;17:28
inc(i);
assert i == 1;
and it does fit well with exp local vars:17:35
<T> void foreachWithIndex(List<T> list, var int index, T->void func) {
for (index = 0; index < list.size(); index++)
func(list[index]);
}
[3,2,1].foreachWithIndex(var int index, int elem => println("element " + " at " + index));
<bonniot>you could also do:17:43
[3,2,1].foreach((int index, int elem) => println("element " + " at " + index));17:44
just needs a new version of foreach in nice.lang ;-)17:45
<arjanb>that possible in this case17:46
but it only allow the variable be passed in one direction
<bonniot>i know17:48
<arjanb>with pass by reference it would be possible to skip over some indexes for example17:49
<bonniot>the question is whether there is sufficient motivation to add pass-by-ref
what if you decrement the index? you get the same value again? that seems messy, no?17:51
in general, pass-by-ref is a lower-level constructs
you can do more things, but it can also get messy
<arjanb>true17:52
<bonniot>that's the other direction from a "functional" approach, where you try to avoid state if possible
the functional foreach with index would be nice to have, for sure
<arjanb>i'm a bit struggling with the fact Nice has first class functions but nothing similar for references17:55
<bonniot>in what situation?17:56
<arjanb>not really practical but just in concepts17:58
<bonniot>well, Nice does not have pointers either18:01
nor goto. sometimes it's better not to have something, because it's too lowlevel
you can have first class references, by the way18:02
you just need to do it explicitely, which is not a bad thing
let r = new Ref(value: 0);
inc(r)18:03
println(r.value);
prints 1
with:
void inc(Ref<int> ref) = r.value++;
Ref == nice.lang.Ref
<arjanb>there 2 kinds of lowlevel close to hardware or in abstractness18:05
i known you can do this manually
<bonniot>so what's the pb with that?18:06
it's rare enough, and you want to be sure you know what you are doing when you use pass-by-ref18:07
so it's better that the call is explicit
not really the call, but that the caller is aware that the value will be modified
<arjanb>how common it is depends on how much of the language you want to expres in itself18:14
*away for meal*
<bonniot>i agree it's good to be able to write as much as you can as libraries18:18
but i don't think adding pass-by-ref brings enough anyway18:19
Bryn has been thinking about multistage compilation ("templates", "macros"), which would really add a lot in this respect
(i have made a minor update of 0.9.6 release with the fix I commited today. That was rather critical, even if in specific situations mixing nicec versions and not compiling into a jar)18:21
<CIA-2>03bonniot * 10eclipse/src/nice/eclipse/core/builder/NicePluginCompilationListener.nice: Display compiler bugs inside eclipse, not out standard output.18:51
03bonniot * 10eclipse/src/nice/eclipse/core/builder/NiceBuilder.nice: Minor: editor settings.
<arjanb>*back*19:07
<bonniot>i don't know if it's thanks to our users (the link in the wiki page), but the votes for stack traces in the JVM went up to 7 :-)19:31
* bonniot leaves22:46
* bonniot joins22:47
* bonniot leaves22:52
* bonniot joins22:54
* magnus-- leaves
* magnus-- joins22:55
<bonniot>good night23:22
* bonniot leaves

Generated by Sualtam