coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Fritjof Bornebusch <fritjof AT uni-bremen.de>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Problem with defining a new vernacular command
- Date: Fri, 4 May 2018 14:24:31 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=fritjof AT uni-bremen.de; spf=Pass smtp.mailfrom=fritjof AT uni-bremen.de; spf=None smtp.helo=postmaster AT smtp.uni-bremen.de
- Ironport-phdr: 9a23:F7sI8B9FAc/G5f9uRHKM819IXTAuvvDOBiVQ1KB41+gcTK2v8tzYMVDF4r011RmVBd6ds6oMotGVmpioYXYH75eFvSJKW713fDhBt/8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1Ifn+FpLPg8it2O2+55Pebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTFUACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRhHohikZKjA382/XhcNsg61GrxyupQdyw5LXbYyPKPZyYr/RcNEcSGFcXshRTStBAoakYoUPFeoBPPpYr4v6p1sAsBCzGA6sBPnpyjBWnXD2wLY63PghEQrb2wEgEcgOsHXIrNX3M6cSX/u4zLTOzTXCdv9Zwi3955bNch8/p/GAR69/ftTIxEQpCgjLjU2QpJT4Mz6b2ekBqXWX4/Z+We61i2Mrtxt9riWzyss0l4XEiI0YxkrZ+Sll3oo5P8O0RFN4bNK+DpddtzyWOo1rSc04WW5oojw1yrgetJ67YicKzJMnygbEa/yCb4iI+gjvVPuXITd5nX5qY6i/iAi38Ue+zO3wTNS730hSoipElNnDqGwN2gTO5sWJRfZx5Fqt1SqR2wzJ6uxIPVo4mbfHJ5I5x74/jJsTsUDNHi/sn0X2ibebdks++uip9+TnYLLmppGHOo9pjAH+M70ildelAesmNwgBQW6b9f6h27L95UH5WqlFjuUqkqnFt5DXPdgUpqmgAwNMzokj7wu/ACy93dQDnXgHKUpFdwidg4joPVHOOvH4Au2lj1Siijc4j8zBa7bmG9DGKmXJuLbnZ7d0rUBGmyQpytUKyYhVFrMGLrrZXVX3udbFFRQ5e1i62ef7CtJz/p4YWCeFGKKcPaWUvVLetbFnGPWFeIJA4GW1EPMi/fO71SZoy29YRrGg2N4sUF79G/1nJ0uDZn+134UcF2ZPtBAzSeHszlGPA2cKOySCGpkk7zR+M7qISJ/ZT9nw0qGH3WKxBJBTa2YABl3eSS61JbXBYO8FbWepGuEkkjEAUuL5GZQkyQnoqQn7jrB9I+/Z/GsUuMC72Q==
On Thu, May 03, 2018 at 01:28:29PM +0200, Gaëtan Gilbert wrote:
Hi,
> 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?
>
for some reason it's working now.
The only things I changed were:
* rename file 'Make' to _CoqProject
* changed the order of files in foo_plugin.mllib - as they are in your file
* and remove: R . Foo
from the file: Make (_CoqProject)
Can't tell what was the problem part.
> > 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.
>
I see, thank you both for the explanation.
>
> Gaëtan Gilbert
>
--f.
> On 03/05/2018 11:19, Fritjof wrote:
> > On Thu, May 03, 2018 at 10:50:56AM +0200, Gaëtan Gilbert wrote:
> > > 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.
> > > >
> foo.ml
> 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.