[nem-en] Known types from macroses problem.

Kamil Skalski kamil.skalski at gmail.com
Wed May 2 19:44:21 CEST 2007


The problem with making $(x : name)  notation more general is that it
is used in two ways: as generation of expressions and for pattern
matching over expressions. Here 'x' is of type Parsetree.Name and it
can be used as such in pattern matching:

match (expr) {
  | <[ $(x : name) ]> => ...  we know that x is the simplest part of
expression, that is name
}

We have some special cases for less frequently used nodes, so they are
not allowed in pattern matching... but in this case it is not a good
idea.
We would need to use another "type" of splice, like  $(x : qid), but I
don't like it... Creation of expression from qualified name is not a
"basic" operation and I think it deserves its own function. Let it be

PExpr.FromQualifiedIdentifier (Manager, "System.Int32")



2007/5/2, vc <vc at rsdn.ru>:
> > I think maybe it should be placed directly in PExpr variant
>
> What do you mean?
>
> Maybe extend space-notaition:
>
> def ty = "System.Int32";
> <[ typeof($(ty : name)) ]>
>
> or
>
> def ty = "System.Int32";
> <[ typeof($(ty : qualident)) ]>
>
> Vlad
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


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



More information about the devel-en mailing list