[nem-en] Nemerle meets Linq
Alejandro Serrano
trupill at yahoo.es
Sun Jan 29 12:25:24 CET 2006
I've created some type of F#-like Linq integration in Nemerle as a set
of macros, using the same |> extension.
However, I need some help with macros, firstly with orderby clauses,
where I don't know where to start, because
orderby (_.Country), (_.Telephone) descending
must be converted into
|> System.Query.Sequence.ThenByDescending (_, _.Telephone)
|> System.Query.Sequence.OrderBy (_, _.Country)
Secondly, I don't know how to make:
def n = ["12/03/2004", "1/08/1998"];
def r = n
|> orderby (fun (x) { x })
|> select (System.DateTime.Parse(_));
to be parsed as:
def n = ["12/03/2004", "1/08/1998"];
def r = ( n
|> orderby (fun (x) { x }) )
|> select (System.DateTime.Parse(_));
instead of:
def n = ["12/03/2004", "1/08/1998"];
def r = n
|> ( orderby (fun (x) { x })
|> select (System.DateTime.Parse(_)) );
Finally I would like to know if there is a better way to say this:
def r = n |> orderby (fun (x) {x} );
to order something by itself, because _ alone gives error.
I attah by implementation plus a free Linq implementation.
Thanks in advance,
trupill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: queyops.tar.gz
Type: application/x-gzip
Size: 24672 bytes
Desc: not available
Url : /mailman/pipermail/devel-en/attachments/20060129/3ab2c2d5/queyops.tar-0001.gz
More information about the devel-en
mailing list