I'm trying to define the == and != operators from a macro.
Something like:
tb.Define(<[ decl:
public static ==(p1 : $t, p2 : $t) : bool
{
// compare the two parms...
}
]>);
However it won't compile the "==".
2008/11/3 Andrew Davey <a.j....@gmail.com>:
--
С уважением,
Чистяков Владислав,
www.rsdn.ru
Oh, you right! :( It's really problem.
Will be nice if someone help we make documentation more fulfilled.
> I don't think digging
> through the source code really counts.
But anyone can ask about its problems in this forum.
Macro is perfect feature, but Nemerle have many excellent feature
besides: functional programming, type inference, AlgTD (varints).
> What would be cool is a before and after style presentation of macros.
> Where we show side-by-side the full code and the macro code. This
> helps people see the power of macros and also provides a handy
> reference for what the macro is doing.
It's good idea, but it need lot of time.
You should add
using Nemerle.Extensions;
into your test.
> Also, the == and != operators are not defined.
I see two variants how we can fix this problem:
1. We can create macro which implement this operators using Equals(object o).
2. Modify StructuralEquality macro.
You can send me patch which resolve this problem and I try apply it to
http://nemerle.org/svn/nemerle/trunk/macros/core.n