Re: [Vala] valasemanticanalyzer error



On Fri, Aug 20, 2010 at 5:47 PM, Andrea Del Signore <sejerpz tin it> 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<G> acc)

No, it is a list of the target type, not the source type.

I really don't understand what are you trying to do can you explain to
me? Thanks.

I'm trying to write a generic map function that consumes a list and
emits a transformed list. If I have two lists

a = List<source_type> // full
b = List<target_type> // empty

and a function

target_type fn(source_type)

I should be able to write

a.map(fn, b)

And b[i] should be fn(a[i]) for all i in a's indices.

martin









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]