On Fri, Aug 20, 2010 at 8:06 PM, Andrea Del Signore wrote:
>
> If you want to use a lambda this is what I came with (see the map
> function):
>
> public void map(DFunc fn, Gee.List acc) {
> foreach (G i in this) {
> acc.add(fn(i));
> }
> }
Beautiful, thanks :)
martin
> }
>
> publi
On Fri, 2010-08-20 at 19:49 +0530, Martin DeMello wrote:
> On Fri, Aug 20, 2010 at 7:26 PM, Andrea Del Signore wrote:
> >
> > Thanks for the explanation but I can't really imagine any other way of
> > doing this without specializing the map method, because I don't see
> > implemented any "standard
On Fri, Aug 20, 2010 at 7:26 PM, Andrea Del Signore wrote:
>
> Thanks for the explanation but I can't really imagine any other way of
> doing this without specializing the map method, because I don't see
> implemented any "standard" (non generic) IList interface in gee.
>
> So:
>
> public void map
On Fri, 2010-08-20 at 17:54 +0530, Martin DeMello wrote:
> On Fri, Aug 20, 2010 at 5:47 PM, Andrea Del Signore wrote:
Hi,
> >
> > the only error I can spot is here:
> >>
> >> public void map(DFunc fn, Gee.List acc) {
> >
> > should be:
> >
> > public void map(DFunc fn, Gee.List acc)
>
> No, i
On Fri, Aug 20, 2010 at 5:47 PM, Andrea Del Signore wrote:
>
> the only error I can spot is here:
>>
>> public void map(DFunc fn, Gee.List acc) {
>
> should be:
>
> public void map(DFunc fn, Gee.List acc)
No, it is a list of the target type, not the source type.
> I really don't understand wha
On Fri, 2010-08-20 at 14:17 +0200, Andrea Del Signore wrote:
> On Fri, 2010-08-20 at 16:43 +0530, Martin DeMello wrote:
> > On Fri, Aug 20, 2010 at 2:55 PM, Abderrahim KITOUNI
> > wrote:
>
Hi,
> P.S.
> I really don't understand what are you trying to do can you explain to
> me? Thanks.
forget
On Fri, 2010-08-20 at 16:43 +0530, Martin DeMello wrote:
> On Fri, Aug 20, 2010 at 2:55 PM, Abderrahim KITOUNI
> wrote:
Hi,
the only error I can spot is here:
>
> public void map(DFunc fn, Gee.List acc) {
should be:
public void map(DFunc fn, Gee.List acc)
> martin
Andrea
P.S.
I really
On Fri, Aug 20, 2010 at 2:55 PM, Abderrahim KITOUNI wrote:
>
> shouldn't it be Iterable?
Thanks, that got the basic proof of concept working. Now the issue is,
I want to write a generic map function whose output type should not
need to be encoded in the Enumerable type.
using Gee;
public interf
Hi,
2010/8/19, Martin DeMello :
> On Thu, Aug 19, 2010 at 6:39 PM, Jürg Billeter wrote:
> > On Tue, 2010-08-17 at 18:09 +0530, Martin DeMello wrote:
> >> public interface Enumerable : Iterable {
shouldn't it be Iterable?
Abderrahim
___
vala-list mai
On Thu, Aug 19, 2010 at 6:39 PM, Jürg Billeter wrote:
> On Tue, 2010-08-17 at 18:09 +0530, Martin DeMello wrote:
>> public interface Enumerable : Iterable {
>>
>> public delegate T DFunc(G elem);
>>
>> public void map(DFunc fn, Gee.List acc) {
>> foreach (G i in this) {
>
On Tue, 2010-08-17 at 18:09 +0530, Martin DeMello wrote:
> public interface Enumerable : Iterable {
>
> public delegate T DFunc(G elem);
>
> public void map(DFunc fn, Gee.List acc) {
> foreach (G i in this) {
> acc.add(fn(i));
> }
>
Note also that this dies in a different place in 0.92 (last tagged
release before the "generic delegates support" feature):
$ valac --pkg gee-1.0 test.vala
test.vala:23.37-23.37: error: Argument 1: Cannot convert from `G' to `int'
a.map( (i) => { return "%d".printf(i); }, b);
What do I need to do to get the following code to compile? It dies with
$ valac --pkg gee-1.0 test.vala
**
ERROR:valasemanticanalyzer.c:2948:vala_semantic_analyzer_get_actual_type:
assertion failed: (instance_type != NULL)
Aborted
# ---
using G
13 matches
Mail list logo