caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] otags problem
@ 2002-02-02  0:12 Shivkumar Chandrasekaran
  2002-02-04 14:11 ` [Caml-list] camlp4o problem (was: otags problem) Hendrik Tews
  0 siblings, 1 reply; 44+ messages in thread
From: Shivkumar Chandrasekaran @ 2002-02-02  0:12 UTC (permalink / raw)
  To: caml-list

Hi,

In my program I have an operator named ( <:> ). Unfortunately otags 
3.04.3 reports a lexing error  (character '<' expected) on that line. 
ocaml 3.04 itself has no problem with it. Can anybody help me work 
around it? Thanks,

--shiv--
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [Caml-list] camlp4o problem (was: otags problem)
  2002-02-02  0:12 [Caml-list] otags problem Shivkumar Chandrasekaran
@ 2002-02-04 14:11 ` Hendrik Tews
  2002-02-04 14:52   ` Daniel de Rauglaudre
  2002-02-04 22:15   ` [Caml-list] camlp4o problem (was: otags problem) Shivkumar Chandrasekaran
  0 siblings, 2 replies; 44+ messages in thread
From: Hendrik Tews @ 2002-02-04 14:11 UTC (permalink / raw)
  To: Shivkumar Chandrasekaran; +Cc: caml-list

Hi,

Shivkumar Chandrasekaran writes:
   Date: Fri, 1 Feb 2002 16:12:56 -0800
   Subject: [Caml-list] otags problem
   
   In my program I have an operator named ( <:> ). Unfortunately otags 
   3.04.3 reports a lexing error  (character '<' expected) on that line. 
   ocaml 3.04 itself has no problem with it. Can anybody help me work 
   around it? 
   
The problem is that otags uses camlp4o to parse the ocaml sources.
Sometimes camlp4o is different from ocaml. You just hit one of
these cases: 

    ithif51 ocaml 15> ledit ocaml
	    Objective Caml version 3.04

    # let ( <:> ) x y = x + y;;
    val ( <:> ) : int -> int -> int = <fun>
    # #load "camlp4o.cma";;
	    Camlp4 Parsing version 3.04

    # let ( <:> ) x y = x + y;;
    Toplevel input:
    # let ( <:> ) x y = x + y;;
	      ^
    Lexing error: character '<' expected

This difference seems to be a feature: in camlp4 "<:" starts a
quotation. The only solutions that I see are the following:

- use an infix operator that works in ocaml and in camlp4
- rewrite otags ;-)

For Daniel de Rauglaudre: Because normal ocaml users are now
sometimes requested to use camlp4o for parsing (for instance for
streams) I think it makes sense to provide a camlp4 parser that
is _exacly_ ocaml. Maybe by placing the quotation syntax in a
separate file, say pa_q.cmo?


Bye,

Hendrik
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 14:11 ` [Caml-list] camlp4o problem (was: otags problem) Hendrik Tews
@ 2002-02-04 14:52   ` Daniel de Rauglaudre
  2002-02-04 15:08     ` Markus Mottl
                       ` (2 more replies)
  2002-02-04 22:15   ` [Caml-list] camlp4o problem (was: otags problem) Shivkumar Chandrasekaran
  1 sibling, 3 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-04 14:52 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 03:11:37PM +0100, Hendrik Tews wrote:

> For Daniel de Rauglaudre: Because normal ocaml users are now
> sometimes requested to use camlp4o for parsing (for instance for
> streams) I think it makes sense to provide a camlp4 parser that
> is _exacly_ ocaml. Maybe by placing the quotation syntax in a
> separate file, say pa_q.cmo?

This is a problem of lexing, not parsing. I could add a flag to set
or unset the lexing of quotations.

Remark: but to be _exactly_ ocaml, the only solution is to use
_exactly_ the same technology, i.e. ocamlyacc. There will be
always differences in the behaviour of the two systems.

Discussion:

Michel Mauny pretends that it is the solution: that I should use
ocamlyacc for the normal OCaml syntax and extensible grammars for
the revised syntax.

In this case, if you want syntax extensions and quotations, you are
*obliged* to use the revised syntax:

  If you want quotations -> revised syntax
  If you want extensible grammars -> revised syntax
  If you want ifdef -> revised syntax
  If you want functionnal streams -> revised syntax
  If you want extensible functions -> revised syntax
  If you want Alain Frisch's ocamllex extension -> revised syntax
  If you want Graydon Hoare's quotations for C -> revised syntax
  If you want my last baby: IoXML -> revised syntax

Are you ok for this change? I am against, but if you convice me that
I am wrong, I can do it.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 14:52   ` Daniel de Rauglaudre
@ 2002-02-04 15:08     ` Markus Mottl
  2002-02-04 15:41       ` Daniel de Rauglaudre
  2002-02-05  3:40     ` [Caml-list] camlp4o problem (was: otags problem) Patrick M Doane
  2002-02-05 15:08     ` Hendrik Tews
  2 siblings, 1 reply; 44+ messages in thread
From: Markus Mottl @ 2002-02-04 15:08 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

On Mon, 04 Feb 2002, Daniel de Rauglaudre wrote:
> In this case, if you want syntax extensions and quotations, you are
> *obliged* to use the revised syntax:
[snip]
> Are you ok for this change? I am against, but if you convice me that
> I am wrong, I can do it.

Though semantics is usually considered the more interesting part of
languages, what are the future plans of the OCaml-team with respect
to syntax? Can you envision defining a new (even saner ;) syntax in
a future release? There have been small (and sometimes larger) syntax
changes all over the time, but how about a major change here?

I haven't been using Daniel's revised syntax yet, but wouldn't mind if the
team introduced this one or a similarly different syntax to clean up the
language as long as it is still possible to reuse modules implemented in
the old syntax (should be easy given camlp4 in the standard distribution).

Otherwise, even if the revised syntax (or an even better one) could be
considered superior, nobody will ever use it if it isn't the standard.

Any suggestions for a flamewar on syntax? ;)

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 15:08     ` Markus Mottl
@ 2002-02-04 15:41       ` Daniel de Rauglaudre
  2002-02-04 15:57         ` Christophe Raffalli
  2002-02-04 16:25         ` [Caml-list] syntax change (was: camlp4o problem) Markus Mottl
  0 siblings, 2 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-04 15:41 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 04:08:39PM +0100, Markus Mottl wrote:

> Otherwise, even if the revised syntax (or an even better one) could be
> considered superior, nobody will ever use it if it isn't the standard.

It has no chance to become the standard if nobody wants to use it...

There are very few users interested in the revised syntax. How much do
you estimate the chances that people will accept a major change of the
syntax?

You want my opinion? 0%

If you have written an application of 50000 lines of OCaml on 60 files
in 5 directories, are you accepting that the new version of OCaml has
a very new syntax, very clean and very incompatible with the previous
one?

And even if you want to convert to it, what is your reaction if the
new version of OCaml has a bug in a part very important for you?

  ---

Well, there is no need to impose a new clean standard syntax, because
there is Camlp4. If most of people use the revised or any-clean
syntax, it becomes a standard de facto.

  ---

I am ok for a definition of a new syntax. I propose the revised syntax
as a start of the discussion. I don't propose to start with the normal
syntax because it is too much difficult to parse with recursive
descent technology. I managed to do it but thanks to hacks.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 15:41       ` Daniel de Rauglaudre
@ 2002-02-04 15:57         ` Christophe Raffalli
  2002-02-04 17:06           ` Daniel de Rauglaudre
  2002-02-04 16:25         ` [Caml-list] syntax change (was: camlp4o problem) Markus Mottl
  1 sibling, 1 reply; 44+ messages in thread
From: Christophe Raffalli @ 2002-02-04 15:57 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

Daniel de Rauglaudre a écrit :
> 
> Hi,
> 
> > Otherwise, even if the revised syntax (or an even better one) could be
> > considered superior, nobody will ever use it if it isn't the standard.
> 
> It has no chance to become the standard if nobody wants to use it...
> 
> There are very few users interested in the revised syntax. How much do
> you estimate the chances that people will accept a major change of the
> syntax?
> 
> You want my opinion? 0%
> 
> ..........
> 

I generally agree with that. But it there a tool to convert an OCaml
program
from one syntax to another ? I would not mind changing the syntax of 
my 20000 thousand lines program named PhoX, if there was a tool to do it
cleanly
(with good indentation, even for part of the code with very long phrase
hard to indent)


> --
> Daniel de RAUGLAUDRE
> daniel.de_rauglaudre@inria.fr
> http://cristal.inria.fr/~ddr/
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr

-- 
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 15:41       ` Daniel de Rauglaudre
  2002-02-04 15:57         ` Christophe Raffalli
@ 2002-02-04 16:25         ` Markus Mottl
  2002-02-04 17:01           ` Daniel de Rauglaudre
  2002-02-04 23:04           ` Chris Hecker
  1 sibling, 2 replies; 44+ messages in thread
From: Markus Mottl @ 2002-02-04 16:25 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

On Mon, 04 Feb 2002, Daniel de Rauglaudre wrote:
> It has no chance to become the standard if nobody wants to use it...

And unfortunately vice versa...

> There are very few users interested in the revised syntax.

Because it is not standard.

> How much do you estimate the chances that people will accept a major
> change of the syntax?

If it breaks their previous work and/or if they cannot continue in their
old style (at least for a while), ...

> You want my opinion? 0%

... then 0%, I agree.

> If you have written an application of 50000 lines of OCaml on 60 files
> in 5 directories, are you accepting that the new version of OCaml has
> a very new syntax, very clean and very incompatible with the previous
> one?

If I can use camlp4 conveniently to work with my existing sources as if
no change had happened, I wouldn't mind, but I fear that not everything
would work smoothly right now. It should at least in principle be possible
(though a lot of work) to design all language tools in such a way that
they accept ASTs annotated with position information (for exact error
messages), thus making them completely independent of concrete syntax.

This would make later syntax changes much less cumbersome for both the
maintainers and the users and allow the language to evolve faster. A
rather strategic proposal for the language and environment...

> And even if you want to convert to it, what is your reaction if the
> new version of OCaml has a bug in a part very important for you?

I don't quite understand this argument: bugs can happen during every
change, what is the problem with syntax changes in particular?

> Well, there is no need to impose a new clean standard syntax, because
> there is Camlp4. If most of people use the revised or any-clean syntax,
> it becomes a standard de facto.

I disagree here. People need a "soft kick" to change. Surely, it shouldn't
be a painful one, this would just drive away users, but a strong enough
one to make them go and give future users of OCaml the opportunity to
start out with an even saner syntax.

> I am ok for a definition of a new syntax. I propose the revised syntax
> as a start of the discussion.

That's ok for me. There may be small details where I could argue about
alternatives, but it is probably a good start.

> I don't propose to start with the normal syntax because it is too much
> difficult to parse with recursive descent technology. I managed to do
> it but thanks to hacks.

Sounds reasonable.  For people who want to learn more about
advantages/disadvantages of LL-parsers (= recursive descent) vs.
LALR-parsers (= ocamlyacc), see this article:

  http://compilers.iecc.com/comparch/article/91-06-032

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 16:25         ` [Caml-list] syntax change (was: camlp4o problem) Markus Mottl
@ 2002-02-04 17:01           ` Daniel de Rauglaudre
  2002-02-04 17:46             ` Markus Mottl
  2002-02-04 18:28             ` Mattias Waldau
  2002-02-04 23:04           ` Chris Hecker
  1 sibling, 2 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-04 17:01 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 05:25:13PM +0100, Markus Mottl wrote:

> > There are very few users interested in the revised syntax.
> Because it is not standard.

What do you call "standard"? Yes, my revised syntax is "standard": it
is "standard" Camlp4: the sources of Camlp4 are in the revised syntax.

If you speak of "standard", somebody told a few time ago in this
mailing list: "why the syntax of OCaml is not the "standard" one?":
because it was not the one of "Standard" ML.

What is the standard? Except "what most of the people use"? I mean
the programmers in OCaml.

> If I can use camlp4 conveniently to work with my existing sources as if
> no change had happened, I wouldn't mind, but I fear that not everything
> would work smoothly right now.

I compile the whole compiler with -pp camlp4o, the otherlibs included
without any problem. I am pretty sure that it would work for your code
with minor changes which would remain backward compatible. Try it out.

> It should at least in principle be possible (though a lot of work)
> to design all language tools in such a way that they accept ASTs
> annotated with position information (for exact error messages), thus
> making them completely independent of concrete syntax.

There is a tool which works like that: Camlp4. You get the position
location exactly of your input file.

I even tried with "zoggy", Maxence Guesdon's program: his input is
XML. When you compile the file, if there are typing errors, they
are shown in the XML file.

> > And even if you want to convert to it, what is your reaction if the
> > new version of OCaml has a bug in a part very important for you?
> 
> I don't quite understand this argument: bugs can happen during every
> change, what is the problem with syntax changes in particular?

The problem is that if you changed your syntax, you cannot "downgrade"
your compiler to the previous version. If you see the problem three
months after having upgraded, it is too late to change: you cannot
distribute your software to your customers with your bug fixed, then
your customers must continue with the same version, then the missiles
are launched in the next full moon, then the world explodes.

> I disagree here. People need a "soft kick" to change.

No: people will accept a change if they need some. But I am quite sure
that many people think this: "yes there is a problem of syntax in the
language, but not so important".

I often heard the argument: "it is only syntax!". A certain "Markus
Mottl" telling a few mails ago: "Though semantics is usually
considered the more interesting part of languages..."

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 15:57         ` Christophe Raffalli
@ 2002-02-04 17:06           ` Daniel de Rauglaudre
  0 siblings, 0 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-04 17:06 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 04:57:25PM +0100, Christophe Raffalli wrote:

> I generally agree with that. But it there a tool to convert an OCaml
> program from one syntax to another ?

It depends on what the supposed *new* syntax is... It may be easy or
difficult, because of the comments.

> I would not mind changing the syntax of my 20000 thousand lines
> program named PhoX, if there was a tool to do it cleanly (with good
> indentation, even for part of the code with very long phrase hard to
> indent)

Oops... what do you call "good intentation"? I propose a "good
indentation" with Camlp4, it is my opinion and 100% of myself agrees
with me... if you see what I mean...

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 17:01           ` Daniel de Rauglaudre
@ 2002-02-04 17:46             ` Markus Mottl
  2002-02-04 18:08               ` Daniel de Rauglaudre
  2002-02-04 18:28             ` Mattias Waldau
  1 sibling, 1 reply; 44+ messages in thread
From: Markus Mottl @ 2002-02-04 17:46 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

On Mon, 04 Feb 2002, Daniel de Rauglaudre wrote:
> What do you call "standard"? Yes, my revised syntax is "standard": it
> is "standard" Camlp4: the sources of Camlp4 are in the revised syntax.

I don't think there is much point to argue: "standard" is what the
OCaml-reference manual says on the language definition and what the
compilers accept as default. Quite unsurprisingly, this is what >99%
of all OCaml-developers are using...

> I compile the whole compiler with -pp camlp4o, the otherlibs included
> without any problem. I am pretty sure that it would work for your code
> with minor changes which would remain backward compatible. Try it out.

Sure. But programming is also a social activity (well, at least sometimes
I'd hope this were the case ;).

This means that it is out of the question to let everybody write in
whatever style he thinks is right just because some preprocessor does
conversions automagically. Just think of teaching OCaml: would you
really want to have every teacher use his favourite style? - That's an
easy way to drive off prospective users.

> The problem is that if you changed your syntax, you cannot "downgrade"
> your compiler to the previous version.

Nobody changes production code to a new language syntax just for the
fun of it. In any case, I am not sure that this is really a problem:
unless you use new, possibly broken semantic features, you'd only have
to fix potential bugs in the preprocessor to make your sources work with
the old compiler again, wouldn't you?

> > I disagree here. People need a "soft kick" to change.
> 
> No: people will accept a change if they need some.

This is, I fear, not the way the "masses" behave.

> But I am quite sure that many people think this: "yes there is a
> problem of syntax in the language, but not so important".

The current OCaml-syntax is definitely not as broken as the ones of most
(if not all) mainstream languages. In fact, one may get to like its
quirks :-)

> I often heard the argument: "it is only syntax!". A certain "Markus
> Mottl" telling a few mails ago: "Though semantics is usually
> considered the more interesting part of languages..."

This is not a contradiction, IMHO. Semantics is not only more interesting
(= potentially more rewarding), it is also much more difficult to improve
(= higher costs). If you perform a cost/benefit analysis, there may be
a point where the ratio is better for syntactic improvements. I am not
sure whether we are already there. AFAIK, there are still somewhat large
semantic extensions in the development pipeline.

Just to make this clear: being a "normal syntax" user, I am not
pushing for any specific syntactic changes. I am just asking whether
the OCaml-team considers major syntax improvements in their development
strategy at all. It's not a problem for me directly if things stay as
they are. It may, however, benefit the growth of OCaml if there is such
a strategy.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 17:46             ` Markus Mottl
@ 2002-02-04 18:08               ` Daniel de Rauglaudre
  2002-02-06  8:19                 ` M E Leypold @ labnet
  0 siblings, 1 reply; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-04 18:08 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 06:46:38PM +0100, Markus Mottl wrote:

> I am just asking whether the OCaml-team considers major syntax
> improvements in their development strategy at all.

No.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 17:01           ` Daniel de Rauglaudre
  2002-02-04 17:46             ` Markus Mottl
@ 2002-02-04 18:28             ` Mattias Waldau
  2002-02-04 20:11               ` Markus Mottl
  1 sibling, 1 reply; 44+ messages in thread
From: Mattias Waldau @ 2002-02-04 18:28 UTC (permalink / raw)
  To: caml-list

The first step towards a "new" syntax for O'Caml is already taken.
Now, when Camlp4 is included in the standard distribution it
is much easier to try Camlp4 syntax. I think more people 
will make more people try the new syntax.

I am using Markus Mottl's Ocamlmakefile, and having some
files in the new syntax and some in the old in the same project
is very easy and doesn't require any tweaking in the Makefile.

So, I think we should encourage people to try the Camlp4-syntax
and let people have their comments. If people comment into this
mailing list, more people will look into it and maybe have their
own opinion.

Personally, I haven't written any own code using the revised
syntax. However, some of my source files are in the revised 
syntax. 

I agree that the current syntax is error-prone and should be
changed. Emacs solves most of the problems, but not if " 
(or is it \") occurs.

/mattias

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 18:28             ` Mattias Waldau
@ 2002-02-04 20:11               ` Markus Mottl
  2002-02-04 22:52                 ` Chris Hecker
                                   ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Markus Mottl @ 2002-02-04 20:11 UTC (permalink / raw)
  To: Mattias Waldau; +Cc: caml-list

On Mon, 04 Feb 2002, Mattias Waldau wrote:
> So, I think we should encourage people to try the Camlp4-syntax
> and let people have their comments. If people comment into this
> mailing list, more people will look into it and maybe have their
> own opinion.

This will probably not happen: there is just not enough incentive to
learn a new syntax which is unlikely to become widespread - because it
is non-standard.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 14:11 ` [Caml-list] camlp4o problem (was: otags problem) Hendrik Tews
  2002-02-04 14:52   ` Daniel de Rauglaudre
@ 2002-02-04 22:15   ` Shivkumar Chandrasekaran
  1 sibling, 0 replies; 44+ messages in thread
From: Shivkumar Chandrasekaran @ 2002-02-04 22:15 UTC (permalink / raw)
  To: Hendrik Tews; +Cc: caml-list

Thanks for all that info! I was planning to use camlp4. Looks like now 
is a good time to learn. Some simple syntax extensions would make my 
code so much more readable (aka Matlab-like). Thanks,

--shiv--

On Monday, February 4, 2002, at 06:11 AM, Hendrik Tews wrote:

> The problem is that otags uses camlp4o to parse the ocaml sources.
> Sometimes camlp4o is different from ocaml. You just hit one of
> these cases:
>
>     ithif51 ocaml 15> ledit ocaml
> 	    Objective Caml version 3.04
>
>     # let ( <:> ) x y = x + y;;
>     val ( <:> ) : int -> int -> int = <fun>
>     # #load "camlp4o.cma";;
> 	    Camlp4 Parsing version 3.04
>
>     # let ( <:> ) x y = x + y;;
>     Toplevel input:
>     # let ( <:> ) x y = x + y;;
> 	      ^
>     Lexing error: character '<' expected
>
> This difference seems to be a feature: in camlp4 "<:" starts a
> quotation. The only solutions that I see are the following:
>
> - use an infix operator that works in ocaml and in camlp4
> - rewrite otags ;-)
>
> For Daniel de Rauglaudre: Because normal ocaml users are now
> sometimes requested to use camlp4o for parsing (for instance for
> streams) I think it makes sense to provide a camlp4 parser that
> is _exacly_ ocaml. Maybe by placing the quotation syntax in a
> separate file, say pa_q.cmo?
>
>
> Bye,
>
> Hendrik
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: 
> http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: 
> http://caml.inria.fr
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 20:11               ` Markus Mottl
@ 2002-02-04 22:52                 ` Chris Hecker
  2002-02-04 23:04                   ` Benjamin C. Pierce
                                     ` (2 more replies)
  2002-02-05  2:01                 ` Brian Rogoff
  2002-02-06  8:23                 ` [Caml-list] syntax change (was: camlp4o problem) M E Leypold @ labnet
  2 siblings, 3 replies; 44+ messages in thread
From: Chris Hecker @ 2002-02-04 22:52 UTC (permalink / raw)
  To: Markus Mottl, Mattias Waldau; +Cc: caml-list


>This will probably not happen: there is just not enough incentive to
>learn a new syntax which is unlikely to become widespread - because it
>is non-standard.

I agree with this.  I think it'll have to be a top-down decision or it won't happen for real.

I (7660 lines of caml and going up quickly in my project) would make a major syntax change if I thought it was an investment in getting things "right" for moving forward.  I'd like it to happen sooner rather than later, if it was going to happen.  I've been tempted to try the revised syntax, but I didn't want to start mixing multiple syntaxes in a single project, and I would rather use the "standard" (whichever it is, and no definition of "standard" offered or wanted) just to make life easier.

I think you rarely get a chance to change major things, and so you should take the opportunity before it's too late.  I would support such a change if the team wanted to do it.  I don't think they should do it lightly, obviously, but I also don't think they should be terrified of a change like this either.  Decide what's best for the future of caml, weighing user pain (but not overly strongly) and cleanliness benefit, and make a decision.

Chris

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 16:25         ` [Caml-list] syntax change (was: camlp4o problem) Markus Mottl
  2002-02-04 17:01           ` Daniel de Rauglaudre
@ 2002-02-04 23:04           ` Chris Hecker
  2002-02-05  2:47             ` Daniel de Rauglaudre
  1 sibling, 1 reply; 44+ messages in thread
From: Chris Hecker @ 2002-02-04 23:04 UTC (permalink / raw)
  To: Markus Mottl, Daniel de Rauglaudre; +Cc: caml-list


>> I don't propose to start with the normal syntax because it is too much
>> difficult to parse with recursive descent technology. I managed to do
>> it but thanks to hacks.
>Sounds reasonable.  For people who want to learn more about
>advantages/disadvantages of LL-parsers (= recursive descent) vs.
>LALR-parsers (= ocamlyacc), see this article:

I forgot to ask, why is it necessary to move to LL?  Is it the error handling, or is there something about the dynamicness of camlp4 that needs a RD parser to hook into?  I'm not a compiler expert, but I've read about it the differences a bit, but I'd like the expert opinions.  :)

Chris

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 22:52                 ` Chris Hecker
@ 2002-02-04 23:04                   ` Benjamin C. Pierce
  2002-02-04 23:28                     ` Markus Mottl
  2002-02-04 23:20                   ` Markus Mottl
  2002-02-05  2:39                   ` Daniel de Rauglaudre
  2 siblings, 1 reply; 44+ messages in thread
From: Benjamin C. Pierce @ 2002-02-04 23:04 UTC (permalink / raw)
  To: Chris Hecker; +Cc: Markus Mottl, Mattias Waldau, caml-list

> I think you rarely get a chance to change major things, and so you
> should take the opportunity before it's too late.  I would support such
> a change if the team wanted to do it.  I don't think they should do it
> lightly, obviously, but I also don't think they should be terrified of
> a change like this either.  Decide what's best for the future of caml,
> weighing user pain (but not overly strongly) and cleanliness benefit,
> and make a decision. 

[Wearing my computer-science-educator hat...]

I *do* think the OCaml team should be terrified of syntax changes.  At
this stage, one of the things that is most hampering the spread of OCaml,
particularly in educational settings, is the dearth of books.  If
incompatible changes are not kept to a minimum, no one will want to write
any, and the few that do get written will quickly go out of date.

       B

-----------------------------------------------------------------------------
Prof. BENJAMIN C. PIERCE
Dept. of Computer & Information Science                bcpierce@cis.upenn.edu
University of Pennsylvania                                    +1 215 898-2012
200 South 33rd St.                                       Fax: +1 215 898-0587
Philadelphia, PA 19104, USA                http://www.cis.upenn.edu/~bcpierce
-----------------------------------------------------------------------------
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 22:52                 ` Chris Hecker
  2002-02-04 23:04                   ` Benjamin C. Pierce
@ 2002-02-04 23:20                   ` Markus Mottl
  2002-02-05  2:39                   ` Daniel de Rauglaudre
  2 siblings, 0 replies; 44+ messages in thread
From: Markus Mottl @ 2002-02-04 23:20 UTC (permalink / raw)
  To: Chris Hecker; +Cc: Mattias Waldau, caml-list

On Mon, 04 Feb 2002, Chris Hecker wrote:
> I think you rarely get a chance to change major things, and so you
> should take the opportunity before it's too late.  I would support such
> a change if the team wanted to do it.  I don't think they should do it
> lightly, obviously, but I also don't think they should be terrified of
> a change like this either.  Decide what's best for the future of caml,
> weighing user pain (but not overly strongly) and cleanliness benefit,
> and make a decision.

Considering the possibility that OCaml might become more mainstream,
I'd rather want to see this happen with a slightly cleaner syntax. It's
of course up to the OCaml-team to decide where they want to go...

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 23:04                   ` Benjamin C. Pierce
@ 2002-02-04 23:28                     ` Markus Mottl
  0 siblings, 0 replies; 44+ messages in thread
From: Markus Mottl @ 2002-02-04 23:28 UTC (permalink / raw)
  To: bcpierce; +Cc: Chris Hecker, Mattias Waldau, caml-list

On Mon, 04 Feb 2002, Benjamin C. Pierce wrote:
> I *do* think the OCaml team should be terrified of syntax changes.
> At this stage, one of the things that is most hampering the spread of
> OCaml, particularly in educational settings, is the dearth of books.
> If incompatible changes are not kept to a minimum, no one will want to
> write any, and the few that do get written will quickly go out of date.

Nobody is saying that such changes should be done right now or in the
near future, but that there should be a plan about them. I am sure that
nobody would say that keeping the current syntax like a rigid corset
forever would benefit long-term evolution of the language. Note that it
becomes even more difficult to change things if the number of users grows.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 20:11               ` Markus Mottl
  2002-02-04 22:52                 ` Chris Hecker
@ 2002-02-05  2:01                 ` Brian Rogoff
  2002-02-05 10:33                   ` Markus Mottl
  2002-02-06  8:23                 ` [Caml-list] syntax change (was: camlp4o problem) M E Leypold @ labnet
  2 siblings, 1 reply; 44+ messages in thread
From: Brian Rogoff @ 2002-02-05  2:01 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Mattias Waldau, caml-list

On Mon, 4 Feb 2002, Markus Mottl wrote:
> On Mon, 04 Feb 2002, Mattias Waldau wrote:
> > So, I think we should encourage people to try the Camlp4-syntax
> > and let people have their comments. If people comment into this
> > mailing list, more people will look into it and maybe have their
> > own opinion.
>
> This will probably not happen: there is just not enough incentive to
> learn a new syntax which is unlikely to become widespread - because it
> is non-standard.

There is probably not enough incentive to learn a new language, like, say,
OCaml, which is unlikely to become widespread, either. I guess my internal
optimization wetware is badly broken ;-)

If you want Revised to become popular, start writing all of your code in
Revised.

-- Brian
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 22:52                 ` Chris Hecker
  2002-02-04 23:04                   ` Benjamin C. Pierce
  2002-02-04 23:20                   ` Markus Mottl
@ 2002-02-05  2:39                   ` Daniel de Rauglaudre
  2002-02-05  2:55                     ` Chris Hecker
  2 siblings, 1 reply; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05  2:39 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 02:52:29PM -0800, Chris Hecker wrote:

> I think you rarely get a chance to change major things, and so you
> should take the opportunity before it's too late.

Which opportunity? I don't see any opportunity now.

It has always been too late: it was too late 8 years ago when Zinc was
created, which was supposed to be "Zinc Is Not Caml" in the
beginning...  but Zinc became "Caml" Light, because of a lot of
reasons, the same reasons that people continue to use now: it is not
standard, it is complicated because of teaching... The same reasons
continue and I don't see any specific opportunity now.

I don't think that you, users, must wait for us, the caml team, to
change the syntax. The standard syntax will never change in our side,
you can be sure of that.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 23:04           ` Chris Hecker
@ 2002-02-05  2:47             ` Daniel de Rauglaudre
  2002-02-05  2:59               ` Chris Hecker
  0 siblings, 1 reply; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05  2:47 UTC (permalink / raw)
  To: caml-list

Hi,

> I forgot to ask, why is it necessary to move to LL?  Is it the error
> handling, or is there something about the dynamicness of camlp4 that
> needs a RD parser to hook into?  I'm not a compiler expert, but I've
> read about it the differences a bit, but I'd like the expert
> opinions.  :)

It is not mandatory.

LL(1) is just easy to parse. When things are based on a simple system
and are easy to program, they have good properties for possible future
extensions and improvements.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05  2:39                   ` Daniel de Rauglaudre
@ 2002-02-05  2:55                     ` Chris Hecker
  0 siblings, 0 replies; 44+ messages in thread
From: Chris Hecker @ 2002-02-05  2:55 UTC (permalink / raw)
  To: Daniel de Rauglaudre, caml-list


>> I think you rarely get a chance to change major things, and so you
>> should take the opportunity before it's too late.
>Which opportunity? I don't see any opportunity now.

"Opportunity" is a relative thing.  Selling Enron at $30 seemed dumb relative to $90, but it sure seems like a missed opportunity now.  :)

Similarly, Caml is still relatively small.  I think it will get much bigger.  This will seem like a missed opportunity in the future (assuming anybody actually wants to change the syntax in the future).

>I don't think that you, users, must wait for us, the caml team, to
>change the syntax. The standard syntax will never change in our side,
>you can be sure of that.

Well, then that's that.  ;)

Chris


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05  2:47             ` Daniel de Rauglaudre
@ 2002-02-05  2:59               ` Chris Hecker
  2002-02-05  8:42                 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 44+ messages in thread
From: Chris Hecker @ 2002-02-05  2:59 UTC (permalink / raw)
  To: Daniel de Rauglaudre, caml-list


>It is not mandatory.
>LL(1) is just easy to parse. When things are based on a simple system
>and are easy to program, they have good properties for possible future
>extensions and improvements.

The friends I talked to about it were surprised by the fact that it's a hand-written parser in the first place.  Was there something about the camlp4 that made it better to hand-write an RD parser as opposed to using a generator (modified to allow the meta-programming stuff in p4, of course)?

Chris


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 14:52   ` Daniel de Rauglaudre
  2002-02-04 15:08     ` Markus Mottl
@ 2002-02-05  3:40     ` Patrick M Doane
  2002-02-05  8:57       ` Daniel de Rauglaudre
  2002-02-05 15:08     ` Hendrik Tews
  2 siblings, 1 reply; 44+ messages in thread
From: Patrick M Doane @ 2002-02-05  3:40 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

On Mon, 4 Feb 2002, Daniel de Rauglaudre wrote:

> Remark: but to be _exactly_ ocaml, the only solution is to use
> _exactly_ the same technology, i.e. ocamlyacc. There will be
> always differences in the behaviour of the two systems.

Why? The ocaml syntax has changed before - there is no technical reason
that prevents identical behavior between the two systems.  I just don't
see camlp4 as being practical until it can correctly parse standard ocaml
syntax.

> In this case, if you want syntax extensions and quotations, you are
> *obliged* to use the revised syntax:

>From what I can tell, the revised syntax makes more changes to the
language than are necessary to fit into camlp4 parsing technology.  If the
revised syntax only changed the syntax as necessary to support camlp4, and
the standard compiler would be modified to reject anything not accepted by
this new syntax, then the following proposal seems perfectly reasonable.

>   If you want quotations -> revised syntax
>   If you want extensible grammars -> revised syntax
>   If you want ifdef -> revised syntax
>   If you want functionnal streams -> revised syntax
>   If you want extensible functions -> revised syntax
>   If you want Alain Frisch's ocamllex extension -> revised syntax
>   If you want Graydon Hoare's quotations for C -> revised syntax
>   If you want my last baby: IoXML -> revised syntax

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05  2:59               ` Chris Hecker
@ 2002-02-05  8:42                 ` Daniel de Rauglaudre
  2002-02-05  9:09                   ` [Caml-list] LL, LR, and camlp4 (was Re: syntax change) Chris Hecker
  0 siblings, 1 reply; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05  8:42 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 06:59:13PM -0800, Chris Hecker wrote:

> The friends I talked to about it were surprised by the fact that
> it's a hand-written parser in the first place.

What do you mean by "hand-written parser in the first place"? Do you
mean the sources in camlp4/ocaml_src/* ? No, they are not hand-written:
they are pretty printed from the sources in camlp4/*. I never edit
them, I just do "make bootstrap_sources" to update them.

> Was there something about the camlp4 that made it better to
> hand-write an RD parser as opposed to using a generator (modified to
> allow the meta-programming stuff in p4, of course)?

Could you reformulate your question? I don't understand. What is an
*RD* parser?

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-05  3:40     ` [Caml-list] camlp4o problem (was: otags problem) Patrick M Doane
@ 2002-02-05  8:57       ` Daniel de Rauglaudre
  2002-02-06  4:00         ` Patrick M Doane
  0 siblings, 1 reply; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05  8:57 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Feb 04, 2002 at 10:40:04PM -0500, Patrick M Doane wrote:

> Why? The ocaml syntax has changed before - there is no technical reason
> that prevents identical behavior between the two systems.

Just experience. This case is more complicated than "fun x -> x+x"
vs. "fun x -> 2*x".

> I just don't see camlp4 as being practical until it can correctly
> parse standard ocaml syntax.

I have done it, little by little. But with the current ("standard")
syntax I have sometimes problems, in particular lastly with class
types. But there are ways to turn around by adding specific grammar
entries with simple parsers, but loosing the "extensibility" for these
cases. In the revised syntax, there are no such hacks.

> From what I can tell, the revised syntax makes more changes to the
> language than are necessary to fit into camlp4 parsing technology.

Indeed. I was not obliged to use the constructors with currification
or list cons between brackets: I just considered this as better (read
the chapter about revised syntax in the Camlp4 tutorial), more
logical. Yes this syntax is not only to make Camlp4 work, it is an
"opinion", my opinion (built in part from my ideas, but not only).

> If the revised syntax only changed the syntax as necessary to
> support camlp4, and the standard compiler would be modified to
> reject anything not accepted by this new syntax, then the following
> proposal seems perfectly reasonable.

You propose that I add a third syntax? A middle between the normal
and the revised syntax. A norsed (or revmal) syntax?

Mmmm... there is also the problem of unclosed constructions (match,
try) which results in problems sometimes. It is not necessary to add
that to be able to parse with LL(1) Camlp4. The revised syntax is
supposed to fix some problems of the normal syntax.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [Caml-list] LL, LR, and camlp4 (was Re: syntax change)
  2002-02-05  8:42                 ` Daniel de Rauglaudre
@ 2002-02-05  9:09                   ` Chris Hecker
  2002-02-05  9:31                     ` Daniel de Rauglaudre
  2002-02-05  9:33                     ` Xavier Leroy
  0 siblings, 2 replies; 44+ messages in thread
From: Chris Hecker @ 2002-02-05  9:09 UTC (permalink / raw)
  To: Daniel de Rauglaudre, caml-list


> Could you reformulate your question? I don't understand. What is an
>*RD* parser?

Sorry, I'm the farthest thing from a compiler expert, so bear with me.

You said that you liked LL because it was easier and simpler to parse.  You mentioned that you used a recursive descent (RD) parser in camlp4 for the revised syntax (since it's LL) and for the ocaml syntax (but were only able to parse it with recursive descent with hacks because it's LR, I think).  I assume that meant you used a hand-written parser, not a parser generated by a tool.

My question is just why did you hand-write the parser, rather than using a tool like yacc?  Was it because of the extensibility and hooks you needed in camlp4 and there's no way to make an extensible generated parser?  Are parser generators not all they're cracked up to be?  If so, why does caml use yacc?

Make sense now?

I don't really know how camlp4 works internally, nor do I really know much about LL, LR, yacc, recursive descent, etc.  Just enough to be dangerous (where dangerous is defined as asking unintelligible questions :).

Thanks,
Chris


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] LL, LR, and camlp4 (was Re: syntax change)
  2002-02-05  9:09                   ` [Caml-list] LL, LR, and camlp4 (was Re: syntax change) Chris Hecker
@ 2002-02-05  9:31                     ` Daniel de Rauglaudre
  2002-02-05  9:33                     ` Xavier Leroy
  1 sibling, 0 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05  9:31 UTC (permalink / raw)
  To: caml-list

Hi,

On Tue, Feb 05, 2002 at 01:09:11AM -0800, Chris Hecker wrote:

> My question is just why did you hand-write the parser, rather than
> using a tool like yacc?

To preserve the extensibility with a simple way. I could not do that
with a yacc parser except revisiting the whole grammar and rebuiding
the whole table when extensions are done.

In Camlp4, when you extend an "entry level", only the entry level is
modified: an extension is just adding a rule in a tree, like adding a
case in a function. It is simple and I want to keep that simplicity.

> Are parser generators not all they're cracked up to be?  If so, why
> does caml use yacc?

I don't know: when I arrived 10 years ago, there was nothing by yacc.
and for most people:
           parsing <=> yacc

Not for me. I don't agree with that. I discovered parsing by learning
Pascal, 25 years ago and I found amazing the rules:

   expression ::= term + term
                | term - term
         term ::= factor + factor
                | factor - factor
       factor ::= integer
                | variable
                | ( expression )
       
I found this recursivity with "expression between parentheses" as a
marvelous thing... :-)

When I arrived here, I just combined this idea with the Caml language
and its polymorphism, and I wrote the stream parsers, using Michel
Mauny's ideas.

Extensible grammars of Camlp4 are just improved stream parsers.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] LL, LR, and camlp4 (was Re: syntax change)
  2002-02-05  9:09                   ` [Caml-list] LL, LR, and camlp4 (was Re: syntax change) Chris Hecker
  2002-02-05  9:31                     ` Daniel de Rauglaudre
@ 2002-02-05  9:33                     ` Xavier Leroy
  2002-02-05 12:17                       ` Diego olivier FERNANDEZ PONS
  1 sibling, 1 reply; 44+ messages in thread
From: Xavier Leroy @ 2002-02-05  9:33 UTC (permalink / raw)
  To: Chris Hecker; +Cc: Daniel de Rauglaudre, caml-list

> My question is just why did you hand-write the parser, rather than
> using a tool like yacc?  Was it because of the extensibility and hooks
> you needed in camlp4 and there's no way to make an extensible
> generated parser?

Yacc-generated parsers (LALR automata) are certainly not extensible --
or at least not without having to recompute most of the automata at
each extension.

> Are parser generators not all they're cracked up to be?  If so, why
> does caml use yacc?

Like all tools, parser generators work well for what they've been
designed to do.  In the case of Yacc, it works well for fixed grammars
(non extensible) of a certain kind (LALR(1) plus precedences for
disambiguation).  

The Caml compilers (OCaml, Caml Light, and even the original
LeLisp-based Caml) use Yacc-generated parsers because that's the
technology we had available at the time they were written, and it
works relatively well -- some efforts are required to disambiguate the
grammar, but at least Yacc tells you where the ambiguities are.

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05  2:01                 ` Brian Rogoff
@ 2002-02-05 10:33                   ` Markus Mottl
  2002-02-05 11:53                     ` Remi VANICAT
  0 siblings, 1 reply; 44+ messages in thread
From: Markus Mottl @ 2002-02-05 10:33 UTC (permalink / raw)
  To: Brian Rogoff; +Cc: Mattias Waldau, caml-list

On Tue, 05 Feb 2002, Brian Rogoff wrote:
> If you want Revised to become popular, start writing all of your code
> in Revised.

Having seriously considered revised syntax as alternative, the only but
finally decisive argument against switching was that (nearly) nobody else
was using it. If you want to make your code available to other people,
you'll have to take social aspects of programming into consideration, too.

Chicken-and-egg problems can usually only be solved by some authoritative
instance. If the OCaml-team decides otherwise, I'll surely not hang
myself on the next tree. OCaml will still be a great language. It might
just have been an even greater one...

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05 10:33                   ` Markus Mottl
@ 2002-02-05 11:53                     ` Remi VANICAT
  2002-02-05 12:05                       ` Daniel de Rauglaudre
                                         ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Remi VANICAT @ 2002-02-05 11:53 UTC (permalink / raw)
  To: caml-list

Markus Mottl <markus@oefai.at> writes:

> On Tue, 05 Feb 2002, Brian Rogoff wrote:
> > If you want Revised to become popular, start writing all of your code
> > in Revised.
> 
> Having seriously considered revised syntax as alternative, the only
> but finally decisive argument against switching was that (nearly)
> nobody else was using it. If you want to make your code available to
> other people, you'll have to take social aspects of programming into
> consideration, too.

may be. But camlp4 is written in revised syntax, and there are a lot
of people using it (at least I believe). So the fact that a library or a
tool is written in revised or standard library doesn't change anything
for those who use it. The only problem is for those who want to change
the source, but it's not so hard to learn this syntax if you want to
use it.

By the way, is there any caml-mode for Emacs and the revised syntax ? 

-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05 11:53                     ` Remi VANICAT
@ 2002-02-05 12:05                       ` Daniel de Rauglaudre
  2002-02-05 17:23                       ` Stefano Zacchiroli
  2002-02-22 10:15                       ` [Caml-list] Emacs mode for revised syntax? Johan Georg Granström
  2 siblings, 0 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05 12:05 UTC (permalink / raw)
  To: caml-list

Hi,

On Tue, Feb 05, 2002 at 12:53:39PM +0100, Remi VANICAT wrote:

> So the fact that a library or a tool is written in revised or
> standard library doesn't change anything for those who use it. The
> only problem is for those who want to change the source, but it's
> not so hard to learn this syntax if you want to use it.

Exactly.

> By the way, is there any caml-mode for Emacs and the revised syntax ? 

I don't think so but there is a request for that (Gérard Huet asked
me yesterday). I use a very old caml-light-or-what emacs mode and I
am too lazy to look at emacs-lisp to create my mode.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] LL, LR, and camlp4 (was Re: syntax change)
  2002-02-05  9:33                     ` Xavier Leroy
@ 2002-02-05 12:17                       ` Diego olivier FERNANDEZ PONS
  0 siblings, 0 replies; 44+ messages in thread
From: Diego olivier FERNANDEZ PONS @ 2002-02-05 12:17 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

Les grammaires dans les livres (que ce soit Le Dragon, Appel ou Autebert)
ont la beauté fonctionnelle des systèmes de réecriture :

E -> E + T
E -> E - T
E -> T
T -> T * F
T -> T / F
T -> F
F -> id
F -> num
F -> (E)

Quand on en vient à écrire un parseur, les choses se compliquent : on a le
choix entre utiliser Yacc qui certes accepte les grammaires LALR,
nonobstant s'intègre assez mal aux applications, outre sa syntaxe peu
commode ou sinon écrire son propre parseur à la main, bien intégré mais
limitant les grammaires à la classe LL.

Faut-il sacrifier l'expressivité des grammaires LR à la facilité des
grammaires LL ?

La question est erronée... Le CamlP4 montre que l'on a besoin d'un outil
commode pour manipuler des grammaires et que Yacc ne répond plus aux
nécessités en termes d'intégration et d'extensibilité. Par ailleurs, la
grammaire de Caml est LR et le CamlP4 ne permet de la parser qu'avec
beaucoup d'efforts (selon les remarques de Rauglaudre).

En somme, serait nécessaire un outil qui à l'image de l'analyseur lexical
générique dont dispose déjà Caml, serait un analyseur syntaxique générique
et s'occuperait de déterminer la classe de la grammaire (LL, LR, LALR,
SLR, algébrique quelconque) et de générer les outils nécessaires en
fonction (analyseur descendant, automate à pile, tables ...)


	Diego Olivier

Comme les paroles sont toujours plus belles accompagnées d'actions
tangibles, j'y travaille. Comme je suis un médiocre programmeur, je ne
garantis aucun résultat.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-04 14:52   ` Daniel de Rauglaudre
  2002-02-04 15:08     ` Markus Mottl
  2002-02-05  3:40     ` [Caml-list] camlp4o problem (was: otags problem) Patrick M Doane
@ 2002-02-05 15:08     ` Hendrik Tews
  2002-02-05 16:13       ` Daniel de Rauglaudre
  2 siblings, 1 reply; 44+ messages in thread
From: Hendrik Tews @ 2002-02-05 15:08 UTC (permalink / raw)
  To: caml-list

Hi,

Daniel de Rauglaudre writes:
   Date: Mon, 4 Feb 2002 15:52:42 +0100
   Subject: Re: [Caml-list] camlp4o problem (was: otags problem)
   
   > For Daniel de Rauglaudre: Because normal ocaml users are now
   > sometimes requested to use camlp4o for parsing (for instance for
   > streams) I think it makes sense to provide a camlp4 parser that
   > is _exacly_ ocaml. Maybe by placing the quotation syntax in a
   > separate file, say pa_q.cmo?
   
   This is a problem of lexing, not parsing. I could add a flag to set
   or unset the lexing of quotations.
   
I would like to have this flag.

   Remark: but to be _exactly_ ocaml, the only solution is to use
   _exactly_ the same technology, i.e. ocamlyacc. There will be
   always differences in the behaviour of the two systems.
   
Well, what I meant is that 
- camlp4o parses a file if and only if ocamlc parses it, and 
- the resulting ast's are semantically equivalent. 

I think this should be possible. And I would suggest to add an
operation mode to camlp4o that makes it equivalent with ocamlc
(in the above sense). 


[Sorry for starting this discussion about syntax. I don't use the
 revised syntax because it not fully documented (e.g., revised
 syntax of objects). Further there is no grammar for the revised
 syntax. ]


Bye,

Hendrik
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-05 15:08     ` Hendrik Tews
@ 2002-02-05 16:13       ` Daniel de Rauglaudre
  2002-02-06 19:17         ` Yaron M. Minsky
  0 siblings, 1 reply; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-05 16:13 UTC (permalink / raw)
  To: caml-list

Hi,

On Tue, Feb 05, 2002 at 04:08:21PM +0100, Hendrik Tews wrote:

> I would like to have this flag.

Ok, I added it:

    $ ocaml 
	    Objective Caml version 3.04+5 (2002-02-01)
    
    # #load "camlp4o.cma";;
	    Camlp4 Parsing version 3.04+5 (2002-02-01)
    
    # let ( <:> ) x y = x + y;;
    Toplevel input:
    # let ( <:> ) x y = x + y;;
	      ^
    Lexing error: character '<' expected
    # Plexer.no_quotations := true;;
    - : unit = ()
    # let ( <:> ) x y = x + y;;     

> Well, what I meant is that 
> - camlp4o parses a file if and only if ocamlc parses it, and 
> - the resulting ast's are semantically equivalent. 

And what I meant is:
 - this is impossible
 - I can just try to be as close as possible

>  Further there is no grammar for the revised syntax.

BTW, is there a grammar for the normal syntax? I didn't find it in
the documentation.

With Camlp4, you can print the syntax of expressions by typing:
   Grammar.Entry.print Pcaml.expr

Well, I am thinking of using this function to print the syntax of all
grammar in LateX or HTML or so.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-05 11:53                     ` Remi VANICAT
  2002-02-05 12:05                       ` Daniel de Rauglaudre
@ 2002-02-05 17:23                       ` Stefano Zacchiroli
  2002-02-22 10:15                       ` [Caml-list] Emacs mode for revised syntax? Johan Georg Granström
  2 siblings, 0 replies; 44+ messages in thread
From: Stefano Zacchiroli @ 2002-02-05 17:23 UTC (permalink / raw)
  To: caml-list

On Tue, Feb 05, 2002 at 12:53:39PM +0100, Remi VANICAT wrote:
> > nobody else was using it. If you want to make your code available to
> > other people, you'll have to take social aspects of programming into
> > consideration, too.
> 
> may be. But camlp4 is written in revised syntax, and there are a lot
> of people using it (at least I believe). So the fact that a library or a
> tool is written in revised or standard library doesn't change anything
> for those who use it. The only problem is for those who want to change

I think that Markus was talking about _code_ and not about the resulting
(compiled) library or tool.
Obviously the target obtained is syntax independent, but for who wants
to have a look at the code the syntax is relevant.

Cheers.

-- 
Stefano "Zack" Zacchiroli <zack@cs.unibo.it> ICQ# 33538863
Home Page: http://www.cs.unibo.it/~zacchiro
Undergraduate student of Computer Science @ University of Bologna, Italy
                 - Information wants to be Open -
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-05  8:57       ` Daniel de Rauglaudre
@ 2002-02-06  4:00         ` Patrick M Doane
  0 siblings, 0 replies; 44+ messages in thread
From: Patrick M Doane @ 2002-02-06  4:00 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

On Tue, 5 Feb 2002, Daniel de Rauglaudre wrote:

> > If the revised syntax only changed the syntax as necessary to
> > support camlp4, and the standard compiler would be modified to
> > reject anything not accepted by this new syntax, then the following
> > proposal seems perfectly reasonable.
>
> You propose that I add a third syntax? A middle between the normal
> and the revised syntax. A norsed (or revmal) syntax?

Yes, that seems the only reasonable option at this point.  It is important
that either

  1. The standard Ocaml tools use camlp4, or

  2. A new syntax is developed that is used by both ocamlc and camlp4o
     such that they accept the same set of files and produce equivalent
     ASTs, or

  3. camlp4o be hacked until it is equivalent to ocamlc

Option 2 seems easiest to me, but any of them would be beneficial.

Alternatively the documentation should be very clear that using camlp4o is
not equivalent to the standard tools.  There have been a number of false
claims made on the list when streams were removed from the language that
one can simply recompile with camlp4.

Patrick

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 18:08               ` Daniel de Rauglaudre
@ 2002-02-06  8:19                 ` M E Leypold @ labnet
  0 siblings, 0 replies; 44+ messages in thread
From: M E Leypold @ labnet @ 2002-02-06  8:19 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list


Daniel de Rauglaudre writes:
 > Hi,
 > 
 > On Mon, Feb 04, 2002 at 06:46:38PM +0100, Markus Mottl wrote:
 > 
 > > I am just asking whether the OCaml-team considers major syntax
 > > improvements in their development strategy at all.
 > 
 > No.

Well, that's a relief. I really had been getting slightly nervous
because of this thread. I really prefer the 'old' syntax, though I see
the merits of the new syntax when it comes to defining syntax
extensions. Too much parentheses in the revised sysntax if you ask me.

And as far as I see it, ocamlp4 is really a great tool, if I ever
consider experimenting with a new syntax.

Regards -- Markus


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] syntax change (was: camlp4o problem)
  2002-02-04 20:11               ` Markus Mottl
  2002-02-04 22:52                 ` Chris Hecker
  2002-02-05  2:01                 ` Brian Rogoff
@ 2002-02-06  8:23                 ` M E Leypold @ labnet
  2 siblings, 0 replies; 44+ messages in thread
From: M E Leypold @ labnet @ 2002-02-06  8:23 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Mattias Waldau, caml-list

Markus Mottl writes:
 > On Mon, 04 Feb 2002, Mattias Waldau wrote:
 > > So, I think we should encourage people to try the Camlp4-syntax
 > > and let people have their comments. If people comment into this
 > > mailing list, more people will look into it and maybe have their
 > > own opinion.
 > 
 > This will probably not happen: there is just not enough incentive to
 > learn a new syntax which is unlikely to become widespread - because it
 > is non-standard.


Maybe that should be read as: There is no widespread need for a
revised sytnax, the hurt with the old syntax is not big enough to
justify a transition to a new one (for most people)?

Regards -- Markus

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] camlp4o problem (was: otags problem)
  2002-02-05 16:13       ` Daniel de Rauglaudre
@ 2002-02-06 19:17         ` Yaron M. Minsky
  2002-02-06 20:02           ` [Caml-list] Re: bug (was: camlp4o problem) Daniel de Rauglaudre
  0 siblings, 1 reply; 44+ messages in thread
From: Yaron M. Minsky @ 2002-02-06 19:17 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

I've found a similar oddity with respect to camlp4 and the % infix
operator.  In particular:

    dragonfly: yminsky $ ocaml
            Objective Caml version 3.04
    
    # #load "camlp4o.cma";;
    	Camlp4 Parsing version 3.04
    
    # let ( % ) x y = x + y;;
    val ( % ) : int -> int -> int = <fun>
    # 3 % 4;;
    Toplevel input:
    # 3 % 4;;
        ^
    Parse error: ';;' expected after [phrase] (in [top_phrase])
    # 

The above works normally if you don't load camlp4o first.  Any clues as
to what might be going on?

y

On Tue, 2002-02-05 at 11:13, Daniel de Rauglaudre wrote:
> Hi,
> 
> On Tue, Feb 05, 2002 at 04:08:21PM +0100, Hendrik Tews wrote:
> 
> > I would like to have this flag.
> 
> Ok, I added it:
> 
>     $ ocaml 
> 	    Objective Caml version 3.04+5 (2002-02-01)
>     
>     # #load "camlp4o.cma";;
> 	    Camlp4 Parsing version 3.04+5 (2002-02-01)
>     
>     # let ( <:> ) x y = x + y;;
>     Toplevel input:
>     # let ( <:> ) x y = x + y;;
> 	      ^
>     Lexing error: character '<' expected
>     # Plexer.no_quotations := true;;
>     - : unit = ()
>     # let ( <:> ) x y = x + y;;     
> 
> > Well, what I meant is that 
> > - camlp4o parses a file if and only if ocamlc parses it, and 
> > - the resulting ast's are semantically equivalent. 
> 
> And what I meant is:
>  - this is impossible
>  - I can just try to be as close as possible
> 
> >  Further there is no grammar for the revised syntax.
> 
> BTW, is there a grammar for the normal syntax? I didn't find it in
> the documentation.
> 
> With Camlp4, you can print the syntax of expressions by typing:
>    Grammar.Entry.print Pcaml.expr
> 
> Well, I am thinking of using this function to print the syntax of all
> grammar in LateX or HTML or so.
> 
> -- 
> Daniel de RAUGLAUDRE
> daniel.de_rauglaudre@inria.fr
> http://cristal.inria.fr/~ddr/
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr
> 
-- 
|--------/            Yaron M. Minsky              \--------|
|--------\ http://www.cs.cornell.edu/home/yminsky/ /--------|

Open PGP --- KeyID B1FFD916 (new key as of Dec 4th)
Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [Caml-list] Re: bug (was: camlp4o problem)
  2002-02-06 19:17         ` Yaron M. Minsky
@ 2002-02-06 20:02           ` Daniel de Rauglaudre
  0 siblings, 0 replies; 44+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-06 20:02 UTC (permalink / raw)
  To: caml-list

Hi,

On Wed, Feb 06, 2002 at 02:17:17PM -0500, Yaron M. Minsky wrote:

>     # #load "camlp4o.cma";;
>     	Camlp4 Parsing version 3.04
>     
>     # 3 % 4;;
>     Toplevel input:
>     # 3 % 4;;
>         ^
>     Parse error: ';;' expected after [phrase] (in [top_phrase])

Right. This is fixed. Thanks for the report.

Please send rather your bug reports to caml-bugs@caml.inria.fr
or use the Web interface: http://caml.inria.fr/bin/caml-bugs

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 44+ messages in thread

* [Caml-list] Emacs mode for revised syntax?
  2002-02-05 11:53                     ` Remi VANICAT
  2002-02-05 12:05                       ` Daniel de Rauglaudre
  2002-02-05 17:23                       ` Stefano Zacchiroli
@ 2002-02-22 10:15                       ` Johan Georg Granström
  2002-02-22 10:21                         ` Christian Gillot
  2 siblings, 1 reply; 44+ messages in thread
From: Johan Georg Granström @ 2002-02-22 10:15 UTC (permalink / raw)
  To: caml-list

What is the status on this question?

> Markus Mottl <markus@oefai.at> writes:
> [Snip]
>
> By the way, is there any caml-mode for Emacs and the revised syntax ?

With reference to

> Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> writes:
> I don't think so but there is a request for that (Gérard Huet asked
> me yesterday). I use a very old caml-light-or-what emacs mode and I
> am too lazy to look at emacs-lisp to create my mode.

Thanks in advance,

- Johan Granström


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [Caml-list] Emacs mode for revised syntax?
  2002-02-22 10:15                       ` [Caml-list] Emacs mode for revised syntax? Johan Georg Granström
@ 2002-02-22 10:21                         ` Christian Gillot
  0 siblings, 0 replies; 44+ messages in thread
From: Christian Gillot @ 2002-02-22 10:21 UTC (permalink / raw)
  To: Johan Georg Granström; +Cc: caml-list

Hi,

El dv, 22-02-2002 a las 11:15, Johan Georg Granström escribió:
> What is the status on this question?
> 
> > Markus Mottl <markus@oefai.at> writes:
> > [Snip]
> >
> > By the way, is there any caml-mode for Emacs and the revised syntax ?
> 
> With reference to
> 
> > Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> writes:
> > I don't think so but there is a request for that (Gérard Huet asked
> > me yesterday). I use a very old caml-light-or-what emacs mode and I
> > am too lazy to look at emacs-lisp to create my mode.
In the mailing list tuareg's author told he wouldn't adapt it to the
revised syntax, so I'm looking forward doing it this week-end. So if
you're just be patient, you'll got it ;o)


Regards,

-- 
Christian Gillot <cgillot@gruposbd.com>
GNU/Linux programmer
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2002-08-08 22:55 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-02  0:12 [Caml-list] otags problem Shivkumar Chandrasekaran
2002-02-04 14:11 ` [Caml-list] camlp4o problem (was: otags problem) Hendrik Tews
2002-02-04 14:52   ` Daniel de Rauglaudre
2002-02-04 15:08     ` Markus Mottl
2002-02-04 15:41       ` Daniel de Rauglaudre
2002-02-04 15:57         ` Christophe Raffalli
2002-02-04 17:06           ` Daniel de Rauglaudre
2002-02-04 16:25         ` [Caml-list] syntax change (was: camlp4o problem) Markus Mottl
2002-02-04 17:01           ` Daniel de Rauglaudre
2002-02-04 17:46             ` Markus Mottl
2002-02-04 18:08               ` Daniel de Rauglaudre
2002-02-06  8:19                 ` M E Leypold @ labnet
2002-02-04 18:28             ` Mattias Waldau
2002-02-04 20:11               ` Markus Mottl
2002-02-04 22:52                 ` Chris Hecker
2002-02-04 23:04                   ` Benjamin C. Pierce
2002-02-04 23:28                     ` Markus Mottl
2002-02-04 23:20                   ` Markus Mottl
2002-02-05  2:39                   ` Daniel de Rauglaudre
2002-02-05  2:55                     ` Chris Hecker
2002-02-05  2:01                 ` Brian Rogoff
2002-02-05 10:33                   ` Markus Mottl
2002-02-05 11:53                     ` Remi VANICAT
2002-02-05 12:05                       ` Daniel de Rauglaudre
2002-02-05 17:23                       ` Stefano Zacchiroli
2002-02-22 10:15                       ` [Caml-list] Emacs mode for revised syntax? Johan Georg Granström
2002-02-22 10:21                         ` Christian Gillot
2002-02-06  8:23                 ` [Caml-list] syntax change (was: camlp4o problem) M E Leypold @ labnet
2002-02-04 23:04           ` Chris Hecker
2002-02-05  2:47             ` Daniel de Rauglaudre
2002-02-05  2:59               ` Chris Hecker
2002-02-05  8:42                 ` Daniel de Rauglaudre
2002-02-05  9:09                   ` [Caml-list] LL, LR, and camlp4 (was Re: syntax change) Chris Hecker
2002-02-05  9:31                     ` Daniel de Rauglaudre
2002-02-05  9:33                     ` Xavier Leroy
2002-02-05 12:17                       ` Diego olivier FERNANDEZ PONS
2002-02-05  3:40     ` [Caml-list] camlp4o problem (was: otags problem) Patrick M Doane
2002-02-05  8:57       ` Daniel de Rauglaudre
2002-02-06  4:00         ` Patrick M Doane
2002-02-05 15:08     ` Hendrik Tews
2002-02-05 16:13       ` Daniel de Rauglaudre
2002-02-06 19:17         ` Yaron M. Minsky
2002-02-06 20:02           ` [Caml-list] Re: bug (was: camlp4o problem) Daniel de Rauglaudre
2002-02-04 22:15   ` [Caml-list] camlp4o problem (was: otags problem) Shivkumar Chandrasekaran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).