[nem-en] Macros and extension methods

Kamil Skalski kamil.skalski at gmail.com
Sat Jun 10 00:43:37 CEST 2006


>From what I see the algorithm in compiler is:
- add all available extension methods in given GlobalEnv
- each x.foo  is treated as overload EXT.foo  (x, ...)
- now as we have all the possible overloads (among them EXT.foo
(x,..)), we can chose the best method

I can see this is the right implementation, I guess Michal did it
after the first implementation, which just added the extension methods
to their types.

I guess, the only way to solve this, is to do some own overloads
filtering or maybe try the more advanced way and run the standard
overload resolution - the problem here is that we need the actual list
of parameters, which does not exist for 'def x = array[1]; x.M', only
the extra 'x' parameter in case of extension methods is know here.

Anyway, I will try to perform filtering based on known type of 'x', so
it can throw out the non-matching extension methods. This should be
the find solution for short term.

2006/6/9, vc <vc at rsdn.ru>:
> > 'def x = [1,2,3]; x.Map'  it will probably return the NArray.Map and
> > NString.Map in completions list.
>
> Whether it is possible create a map types to list of extension methods?
> Probably similar data structure already exists?
>
> Vlad
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list