On Wed, 28 Dec 2011, SF Markus Elfring wrote:
There is indeed such a field in coccilib/elems.py. I don't know what the
purpose
of it is, but I don't see any reason to remove it either, so if you find
it
useful, then go ahead and use it.
Would it make sense that a metavariable of the type "identifier" will
provide more attributes besides the abbreviated name "ident"?
Alternative interface styles:
- The value of a metavariable of the SmPL type "type" can be retrieved
directly without an additional attribute name.
- Would a general method like "get_value" make sense in this context
eventually?
I have no idea what ident is for. From my point of view, in python one
has a string representation of the values of all metavariables, without
the need to refer to any attributes. It is possible that it is not
implemented this way. Perhaps the vision of an identifier metavariable as
a string comes from some implicit refernce to its only field. This might
explain why it is not possible to perform normal python string operations
on some or all metavariables.
From my point of view, this is all a sign of the poor design of
dynamically typed languages with lots of implicit coercions...
My inclination is to remove all fields from the python representations of
metavariables.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)