caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Possible bug in module and class?
@ 2002-10-18 20:16 Bow-Yaw Wang
  2002-10-21  6:26 ` Jacques Garrigue
  0 siblings, 1 reply; 13+ messages in thread
From: Bow-Yaw Wang @ 2002-10-18 20:16 UTC (permalink / raw)
  To: caml-list


Hi,

I don't know if anyone has encountered this. But I'm able
to hang both ocamltop and ocamlc (v 3.06) by the following
code:

class type my_obj_type = 
  object ('a) 
    method me : 'a 
  end

module type EQ_TYPE = 
  sig 
    val you : (#my_obj_type as 'a) -> 'a 
  end

module Eq : EQ_TYPE = struct let you o = o end

class my_obj : my_obj_type = 
  object (self) 
    method me = Eq.you self 
  end

ocamltop doesn't return after I key in my_obj. If I 
separate the code into .mli and .ml, ocamlc hangs
while compiling my_obj. :(

Sorry about the silly code segment. It is in fact
a simplified version of real code. Any help will
be appreciated.

Thanks,

Bow-Yaw


-------------------
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] 13+ messages in thread

* Re: [Caml-list] Possible bug in module and class?
  2002-10-18 20:16 [Caml-list] Possible bug in module and class? Bow-Yaw Wang
@ 2002-10-21  6:26 ` Jacques Garrigue
  2002-10-21 12:16   ` Alessandro Baretta
  2002-10-21 21:00   ` [Caml-list] Possible bug in module and class? Bow-Yaw Wang
  0 siblings, 2 replies; 13+ messages in thread
From: Jacques Garrigue @ 2002-10-21  6:26 UTC (permalink / raw)
  To: bywang; +Cc: caml-list

From: Bow-Yaw Wang <bywang@saul.cis.upenn.edu>

> I don't know if anyone has encountered this. But I'm able
> to hang both ocamltop and ocamlc (v 3.06) by the following
> code:
[..]

Indeed there was such a bug in 3.06.
It has been fixed recently in the CVS version.

Since already a number of bugs have been fixed since 3.06,
and it might be hard to extract just the needed patch for your
problem, I'm afraid you will have to get the cvs version
from camlcvs.inria.fr.

Cheers,

Jacques Garrigue
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Possible bug in module and class?
  2002-10-21  6:26 ` Jacques Garrigue
@ 2002-10-21 12:16   ` Alessandro Baretta
  2002-10-21 12:32     ` Luc Maranget
  2002-10-22  2:16     ` Jacques Garrigue
  2002-10-21 21:00   ` [Caml-list] Possible bug in module and class? Bow-Yaw Wang
  1 sibling, 2 replies; 13+ messages in thread
From: Alessandro Baretta @ 2002-10-21 12:16 UTC (permalink / raw)
  To: Ocaml



Jacques Garrigue wrote:

> Since already a number of bugs have been fixed since 3.06,
> and it might be hard to extract just the needed patch for your
> problem, I'm afraid you will have to get the cvs version
> from camlcvs.inria.fr.
> 
> Cheers,
> 
> Jacques Garrigue

This brings about an interesting problem, which I would like 
the developers to comment on.

I'm using O'Caml in an industrial project. Of course, I'd 
like to make sure that I give my customers the most stable 
environment possible. As more and more bugs are found and 
fixed in the CVS version, the temptation to upgrade from the 
official distribution becomes stronger. But is the CVS 
version usually more or less buggy than the official distro?

I know this is a very diffucult question, and that it is 
much easier to answer, "Try and it, and if you find a bug, 
report it." Yet, I would like the developers to take a stand 
on the use of the cvs source. Do you encourage widespread 
use? Do you encourage use only for testing purposes?

I ask because I would like to stick with official 
reccomendations, rather than experimenting on completely 
unknown grounds.

TIA

Alex

-------------------
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] 13+ messages in thread

* Re: [Caml-list] Possible bug in module and class?
  2002-10-21 12:16   ` Alessandro Baretta
@ 2002-10-21 12:32     ` Luc Maranget
  2002-10-21 12:51       ` Alessandro Baretta
  2002-10-22  2:16     ` Jacques Garrigue
  1 sibling, 1 reply; 13+ messages in thread
From: Luc Maranget @ 2002-10-21 12:32 UTC (permalink / raw)
  To: Alessandro Baretta; +Cc: Ocaml

> 
> 
> 

> I'm using O'Caml in an industrial project. Of course, I'd 
> like to make sure that I give my customers the most stable 
> environment possible. As more and more bugs are found and 
> fixed in the CVS version, the temptation to upgrade from the 
> official distribution becomes stronger. But is the CVS 
> version usually more or less buggy than the official distro?
No one can tell, but an important point is that the CVS version is
unstable by nature.

> 
> I know this is a very diffucult question, and that it is 
> much easier to answer, "Try and it, and if you find a bug, 
> report it." Yet, I would like the developers to take a stand 
> on the use of the cvs source. Do you encourage widespread 
> use? Do you encourage use only for testing purposes?
By using the CVS version you help the developpers, not your product.
If I were you, I would be selfish!

Of course in the long run helping Caml is helping yourself, but I
assume  you are coding for food and that you eat every day. 


> 
> I ask because I would like to stick with official 
> reccomendations, rather than experimenting on completely 
> unknown grounds.
> 

I am no industrial.

But for hevea I stick to the following guidelines.

- Always develop with the current distributed version.
- Avoid new features as much as possible.
- I check hevea at every compiler release.
- I case of bug I favor work-arounds in my code over enforcing upgrade (at
least until the next official Ocaml release).

I do not think my statement can be considered ``official'', just
common sense.

> TIA
> 
> Alex

--Luc
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Possible bug in module and class?
  2002-10-21 12:32     ` Luc Maranget
@ 2002-10-21 12:51       ` Alessandro Baretta
  0 siblings, 0 replies; 13+ messages in thread
From: Alessandro Baretta @ 2002-10-21 12:51 UTC (permalink / raw)
  To: Luc Maranget, Ocaml



Luc Maranget wrote:

> 
> I am no industrial.
> 
> But for hevea I stick to the following guidelines.
> 
> - Always develop with the current distributed version.
> - Avoid new features as much as possible.
> - I check hevea at every compiler release.
> - I case of bug I favor work-arounds in my code over enforcing upgrade (at
> least until the next official Ocaml release).
> 
> I do not think my statement can be considered ``official'', just
> common sense.
This is more or less what I've been doing up to now. Yet, 
the CVS version, is still tempting, in some respects. I'm am 
considering running a double installation setup with the 
official distro in /usr/bin and /usr/lib and the cvs in 
/opt/bin and /opt/lib. I could then test my code againsta 
the CVS snapshot by simply using a pinch of makefile magic.

The bottom line is that I don't like to work-arounds in my 
code. I'd like my code to be as obvious and idiomatic as 
possible.

Alex

-------------------
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] 13+ messages in thread

* Re: [Caml-list] Possible bug in module and class?
  2002-10-21  6:26 ` Jacques Garrigue
  2002-10-21 12:16   ` Alessandro Baretta
@ 2002-10-21 21:00   ` Bow-Yaw Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Bow-Yaw Wang @ 2002-10-21 21:00 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: caml-list


Hi Jacques:

I install the cvs version and it works. Thanks. For the time
being, I think I'll use the cvs version just to get my work
done. I hope I won't bump into any bug until 3.07 comes out. :)

Best,

Bow-Yaw

> 
> From: Bow-Yaw Wang <bywang@saul.cis.upenn.edu>
> 
> > I don't know if anyone has encountered this. But I'm able
> > to hang both ocamltop and ocamlc (v 3.06) by the following
> > code:
> [..]
> 
> Indeed there was such a bug in 3.06.
> It has been fixed recently in the CVS version.
> 
> Since already a number of bugs have been fixed since 3.06,
> and it might be hard to extract just the needed patch for your
> problem, I'm afraid you will have to get the cvs version
> from camlcvs.inria.fr.
> 
> Cheers,
> 
> Jacques Garrigue
> -------------------
> 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
> 

-------------------
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] 13+ messages in thread

* Re: [Caml-list] Possible bug in module and class?
  2002-10-21 12:16   ` Alessandro Baretta
  2002-10-21 12:32     ` Luc Maranget
@ 2002-10-22  2:16     ` Jacques Garrigue
  2002-10-22  4:35       ` [Caml-list] Camlp4 pretty print comments Quetzalcoatl Bradley
  1 sibling, 1 reply; 13+ messages in thread
From: Jacques Garrigue @ 2002-10-22  2:16 UTC (permalink / raw)
  To: alex; +Cc: caml-list

From: Alessandro Baretta <alex@baretta.com>

> I'm using O'Caml in an industrial project. Of course, I'd 
> like to make sure that I give my customers the most stable 
> environment possible. As more and more bugs are found and 
> fixed in the CVS version, the temptation to upgrade from the 
> official distribution becomes stronger. But is the CVS 
> version usually more or less buggy than the official distro?

There is no official guideline that I know, but considering other
problems like binary compatibility, switching to a CVS version can
always create trouble. Personally I would not suggest doing that for
an industrial project, except maybe if the deadline is more than 9
month ahead (i.e. you are reasonnably sure that a new release will be
available by that time).
On the upside, you can profit immediately from bug fixes, and
avoid preemptively bugs that would break your code in an upcoming
release. From this point of view, if you're a very active user, maybe
having the CVS version around for testing can be useful.

Concerning whether there are more or less bugs in the CVS versions,
like for all projects I would say this goes in cycles.
Typically, just after a release people do not immediately introduce
new features, and many bug reports come in, so that for a while the
number of bugs is actually going down.  Then you may get a big change
and it suddenly goes up, then down again thanks to benevolent CVS
testers.
Since there is no strict rule about when to commit (except code
freezes just before releases), it is very hard to tell what is the
current situation.
My personnal feeling that the CVS version of a few days ago is
more stable than 3.06, but then I don't test all parts of the
compiler.

Last thing, for people who might be tempted to use the CVS version:
please do not release code requiring the CVS version to run.  Forcing
it on other people may break their own programs.  But this is just
classical advice I believe.

Cheers,

        Jacques Garrigue
-------------------
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] 13+ messages in thread

* [Caml-list] Camlp4 pretty print comments
  2002-10-22  2:16     ` Jacques Garrigue
@ 2002-10-22  4:35       ` Quetzalcoatl Bradley
  2002-10-22 11:15         ` Daniel de Rauglaudre
  0 siblings, 1 reply; 13+ messages in thread
From: Quetzalcoatl Bradley @ 2002-10-22  4:35 UTC (permalink / raw)
  To: caml-list


I'm trying to pretty print with camlp4 and have found a confusing 
discrepancy:

qbradley% cat comment.ml
(* abc *)
qbradley% camlp4r pr_r.cmo -impl comment.ml
(* abc *)
qbradley% cat comment.ml | camlp4r pr_r.cmo -impl -
qbradley% camlp4r -v
Camlp4 version 3.06

Why are comments not printed when the input is from standard input?

Thanks,

Quetzalcoatl Bradley
qbradley@blackfen.com
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Camlp4 pretty print comments
  2002-10-22  4:35       ` [Caml-list] Camlp4 pretty print comments Quetzalcoatl Bradley
@ 2002-10-22 11:15         ` Daniel de Rauglaudre
  2002-10-22 12:40           ` Sven Luther
  2002-10-22 13:18           ` Stefano Zacchiroli
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel de Rauglaudre @ 2002-10-22 11:15 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Oct 21, 2002 at 09:35:47PM -0700, Quetzalcoatl Bradley wrote:
> 
> Why are comments not printed when the input is from standard input?

Because comments are not represented in the syntax tree. To pretty
print, Camlp4 reads the file again, using the locations inside the
syntax tree to determine where the comments are located.

If the input file is standard input, it is not possible since it is
not possible to read it twice.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Camlp4 pretty print comments
  2002-10-22 11:15         ` Daniel de Rauglaudre
@ 2002-10-22 12:40           ` Sven Luther
  2002-10-22 13:18           ` Stefano Zacchiroli
  1 sibling, 0 replies; 13+ messages in thread
From: Sven Luther @ 2002-10-22 12:40 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: caml-list

On Tue, Oct 22, 2002 at 01:15:30PM +0200, Daniel de Rauglaudre wrote:
> Hi,
> 
> On Mon, Oct 21, 2002 at 09:35:47PM -0700, Quetzalcoatl Bradley wrote:
> > 
> > Why are comments not printed when the input is from standard input?
> 
> Because comments are not represented in the syntax tree. To pretty
> print, Camlp4 reads the file again, using the locations inside the
> syntax tree to determine where the comments are located.
> 
> If the input file is standard input, it is not possible since it is
> not possible to read it twice.

What about storing the comments when parsing the standard input with
their location in the file, so you can easily add them again when
generating the file ?

Friendly,

Sven Luther
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Camlp4 pretty print comments
  2002-10-22 11:15         ` Daniel de Rauglaudre
  2002-10-22 12:40           ` Sven Luther
@ 2002-10-22 13:18           ` Stefano Zacchiroli
  2002-10-22 13:44             ` Maxence Guesdon
  2002-10-22 14:21             ` Daniel de Rauglaudre
  1 sibling, 2 replies; 13+ messages in thread
From: Stefano Zacchiroli @ 2002-10-22 13:18 UTC (permalink / raw)
  To: caml-list

On Tue, Oct 22, 2002 at 01:15:30PM +0200, Daniel de Rauglaudre wrote:
> Because comments are not represented in the syntax tree. To pretty
> print, Camlp4 reads the file again, using the locations inside the
> syntax tree to determine where the comments are located.

Why comments are not represented? It's because the lexer don't return
them or because the standard ocaml grammar rules skip them?

If the first case does apply, is possible to add a camlp4 rule to
retain them, right?

BTW, does ocamldoc use the same trick (reading twice)?

TIA,
Cheers.

-- 
Stefano Zacchiroli - undergraduate student of CS @ Univ. Bologna, Italy
zack@cs.unibo.it | ICQ# 33538863 | http://www.cs.unibo.it/~zacchiro
"I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!" -- G.Romney
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Camlp4 pretty print comments
  2002-10-22 13:18           ` Stefano Zacchiroli
@ 2002-10-22 13:44             ` Maxence Guesdon
  2002-10-22 14:21             ` Daniel de Rauglaudre
  1 sibling, 0 replies; 13+ messages in thread
From: Maxence Guesdon @ 2002-10-22 13:44 UTC (permalink / raw)
  To: caml-list

> 
> Why comments are not represented? It's because the lexer don't return
> them or because the standard ocaml grammar rules skip them?

Having comments in the syntex tree could be a pain since you can add comments where you want (in an expression, between phrases, ...). They are just skipped.

> If the first case does apply, is possible to add a camlp4 rule to
> retain them, right?
> 
> BTW, does ocamldoc use the same trick (reading twice)?

Yes.

-- 
Maxence Guesdon
-------------------
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] 13+ messages in thread

* Re: [Caml-list] Camlp4 pretty print comments
  2002-10-22 13:18           ` Stefano Zacchiroli
  2002-10-22 13:44             ` Maxence Guesdon
@ 2002-10-22 14:21             ` Daniel de Rauglaudre
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel de Rauglaudre @ 2002-10-22 14:21 UTC (permalink / raw)
  To: caml-list

Hi,

On Tue, Oct 22, 2002 at 03:18:38PM +0200, Stefano Zacchiroli wrote:
> 
> Why comments are not represented? It's because the lexer don't return
> them or because the standard ocaml grammar rules skip them?
> 
> If the first case does apply, is possible to add a camlp4 rule to
> retain them, right?

Well, as Maxence Guesdon says, it is really a pain to retain them.
Because it implies complicated actions in the lexer *and* in the parser.

Storing the comments, as Sven luther suggests, well, why not? But it
is complicated also.

A simple solution would be to store... the whole input! This way I
could read the "input file" in memory, and I am sure the change would
be easy to program.

I can do that, just for the case when the input is the standard one.
Are you interested and OK for this solution, even if it uses more
memory? (but now, machine memory spaces is big).

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
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] 13+ messages in thread

end of thread, other threads:[~2002-10-22 14:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-18 20:16 [Caml-list] Possible bug in module and class? Bow-Yaw Wang
2002-10-21  6:26 ` Jacques Garrigue
2002-10-21 12:16   ` Alessandro Baretta
2002-10-21 12:32     ` Luc Maranget
2002-10-21 12:51       ` Alessandro Baretta
2002-10-22  2:16     ` Jacques Garrigue
2002-10-22  4:35       ` [Caml-list] Camlp4 pretty print comments Quetzalcoatl Bradley
2002-10-22 11:15         ` Daniel de Rauglaudre
2002-10-22 12:40           ` Sven Luther
2002-10-22 13:18           ` Stefano Zacchiroli
2002-10-22 13:44             ` Maxence Guesdon
2002-10-22 14:21             ` Daniel de Rauglaudre
2002-10-21 21:00   ` [Caml-list] Possible bug in module and class? Bow-Yaw Wang

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).