coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gaëtan Gilbert <gaetan.gilbert AT skyskimmer.net>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Problem with defining a new vernacular command
- Date: Thu, 3 May 2018 13:28:29 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gaetan.gilbert AT skyskimmer.net; spf=Pass smtp.mailfrom=gaetan.gilbert AT skyskimmer.net; spf=None smtp.helo=postmaster AT relay1-d.mail.gandi.net
- Ironport-phdr: 9a23:syKW6hXpQFIgihqtZHMpIIVBBw7V8LGtZVwlr6E/grcLSJyIuqrYYxyHt8tkgFKBZ4jH8fUM07OQ7/i7HzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba98IRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmijoINyQh/W/KlMJwgqJVrhGvqRNxzIHbYp2aOeF7fq/BZ94XX3ZNU8hTWiFHH4iyb5EPD+0EPetArofyvUcJrQekCgmqHOzhyz5Ihnvt0qIkyeQhDRzN0QsvH90UrnvUsM/6NKEIXeC6zanIyS7MYO1M2Tfh84XIaRMhoPGXXbJzcMrRzEwvGB3fjlmKr4zqIS+V2/0LvmOG7ORgTfqih3A6pwxzuDSixNsghpPUio8WxF3I7zh1zYI7KNGgSUN3f8SoHIZMuy2ELYd6X8wvTmJytConybALuZi2dzUQxps93R7QcfmHfpCI4h39UOaRJi91hGh7d7K7nRmz8VWsxvThWcWu1VZFtCtFkt3WunACzRPT7NWISvpn8kenxzmPyxjf6uBCIU8qiarWM4AtzqMym5YJs0nPAjX6lFj1gaKYbEko5+yl5ur/brXjvJCcNot0ig/kMqQpn8yyGes4PRIQUGiH4+u80qfv/UL4QLVOlfI5jLPZsIzBKMQApa64AxRV0oUi6xa6Cjepzs4YkWMBLF1bZBKLl5LpNE3WIPDkEfe/hEyhnytsx/DfJ7HuHpHNLmXYn7r6ZrZ860tcyBIpwtxF5pJUDKsBIPPpVUPrutzYFExxDwvhyOH+Td55y4k2WGSVA6bfPrmBn0WP47cAKmqQbYkilzf5IfU/+7a6gnY0hVYbO6ao2ZEacmyQBfd3OEaYZH/hmJEHHHtc7Vl2d/DjlFDXCW0bXH21Ra9pvmhqWrLjNp/KQ8WWuJLE2S66GpNMYWUfVAKXEmbzdISBXvoWLiSfPp04y2BWZf2aU4YkkCqWmkri0bM+cLjP+TwDtpPm0dVvoeveiUNqrGEmP4Gmy2iIClpMsCYISjsxhv0tu0F5w0balKQ+hvVZEZpc7vVFU0E8OIKOl+E=
I can't reproduce.
If you try with the files I attached does the error still happen for you? If so can you spot any difference with your files?
> Whats the difference between mllib and mlpack?
Suppose we have foo.mllib containing Bar and Baz (on separate lines as usual)
Then compilation depends on those modules and will produce a binary called foo.cm* (depending on native vs byte etc). Linking that gives access to the modules Bar and Baz.
If instead we use foo.mlpack then linking the resulting foo gives access to Foo.Bar and Foo.Baz.
Using mlpack avoids name collisions (you can have 2 modules called Foo so long as they're in different packs) and helps enforce modularity (dependencies between packs must be acyclic, so eg if you have 1 pack per directory you control dependencies between directories)
Emilio might have more to say about this / I might have misunderstood something or said something unclear.
Gaëtan Gilbert
On 03/05/2018 11:19, Fritjof wrote:
On Thu, May 03, 2018 at 10:50:56AM +0200, Gaëtan Gilbert wrote:foo.ml
Is that make from a clean state? If it is then notice that it's not
compiling foo.ml and g_foo.ml4. What's the content of foo_plugin.mllib?
Yes it is compiled from a clean state.
foo_plugin.mllib:
Foo
G_foo
NB: nowadays we recommend using foo_plugin.mlpack but I don't think that's
causing the error
Whats the difference between mllib and mlpack?
Gaëtan Gilbert
Best,
--f.
On 03/05/2018 09:33, Fritjof wrote:
Hi,
I have a problem defining a new vernacular since Coq 8.8.0 - I guess.
I think in a previous version this worked.
g_foo.ml4:
DECLARE PLUGIN "foo_plugin"
VERNAC COMMAND EXTEND FooBar CLASSIFIED AS QUERY
| [ "Foo" "Bar" ] -> [ Foo.bar () ]
END
Coqtop:
Coq < Declare ML Module "foo_plugin".
[Loading ML file foo_plugin.cmxs ... done]
Coq < Foo Bar.
Toplevel input, characters 0-3:
Foo Bar.Error: Syntax error: illegal begin of vernac.
^^^
$ make
COQDEP VFILES
COQDEP foo_plugin.mllib
CAMLDEP foo.ml
CAMLDEP -pp g_foo.ml4
CAMLOPT -a -o foo_plugin.cmxa
CAMLOPT -shared -o foo_plugin.cmxs
make(1) runs with no errors.
Does anyone have a hint, why "Foo Bar." does not work, even if I defined it
and make(1)
processes the grammar file?
Best,
--f.
g_foo.ml4
foo_plugin.mllib
let bar () = ()
Foo
G_foo
DECLARE PLUGIN "foo_plugin"
VERNAC COMMAND EXTEND FooBar CLASSIFIED AS QUERY
| [ "Foo" "Bar" ] -> [ Foo.bar () ]
END
- [Coq-Club] Problem with defining a new vernacular command, Fritjof, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Gaëtan Gilbert, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Fritjof, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Gaëtan Gilbert, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Emilio Jesús Gallego Arias, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Fritjof Bornebusch, 05/04/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Gaëtan Gilbert, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Fritjof, 05/03/2018
- Re: [Coq-Club] Problem with defining a new vernacular command, Gaëtan Gilbert, 05/03/2018
Archive powered by MHonArc 2.6.18.