[Ometa] dictionary matching
Andrey Fedorov
anfedorov at gmail.com
Mon Nov 23 08:53:52 PST 2009
I've only seen OMeta matching on lists. From some quick playing around with=
the
tutorial <http://www.tinlizzie.org/ometa-js/#OMeta_Tutorial>, I couldn't get
match rules with nested lists to work, but I'm pretty new with OMeta. That
said, a rule matching on trees can be translated into a couple of rules
matching lists, which might also have the benefit of performance guarantees.
I'm not sure if I'm following your example, could you give an example of an
object matching your given rule?
Cheers,
Andrey
On Mon, Nov 23, 2009 at 11:18 AM, Justin Chase <justin.m.chase at gmail.com>wr=
ote:
> Hello,
>
> I have been reading over some of the OMeta documentation and I have a
> question. I understand that OMeta can specifically be used to author a
> visitor but a lot of visitors will typically be over an object tree and I=
'm
> wondering if there is syntax for this? I'm not really seeing this, all th=
at
> I see are grammars for visiting arrays. Has there been any thought on thi=
s?
>
> I know javascript has an object notation so this seems like it could be a
> good fit. I was picturing something like:
>
> Example =3D { Foo =3D [Bar*]:e } -> { Example : e }
>
> Which is to say the left hand is matching an object with a field named Foo
> with value that matches [Bar*] and is assingned to the parameter e. It is
> then projected as an object with a field set to the value projected into =
e.
> Is there already a notation for this, and if not what is the reason not to
> have it?
>
> Thanks!
>
> --
> Justin Chase
> http://www.justnbusiness.com
>
> _______________________________________________
> OMeta mailing list
> OMeta at vpri.org
> http://vpri.org/mailman/listinfo/ometa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://vpri.org/pipermail/ometa/attachments/20091123/0d10acaa/attachme=
nt.htm
More information about the OMeta
mailing list