caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] Pretty printing Toploop errors?
@ 2006-07-10 10:06 Keiko Nakata
  2006-07-11 13:16 ` Geoffrey Alan Washburn
  0 siblings, 1 reply; 6+ messages in thread
From: Keiko Nakata @ 2006-07-10 10:06 UTC (permalink / raw)
  To: caml-list

>	I'm trying to use Toploop within a program I'm working on and some code 
>I'm feeding it is causing a type error.  Unfortunately, the best I've 
>been able to figure out is to use Toploop.print_exception_outcome or 
>Pcaml.report_error which just tell me
>
>
>		   Uncaught exception: Typecore.Error (_, _)
>
>
>Are there any hooks for printing out a useful type error message?  Or am 
>I going to need to compile directly against the type-checking code from 
>the compiler?  Thanks!

Take a look at driver/errors.ml.
It may be useful. 

Hope this helps,
Keiko.





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

* Re: Pretty printing Toploop errors?
  2006-07-10 10:06 [Caml-list] Pretty printing Toploop errors? Keiko Nakata
@ 2006-07-11 13:16 ` Geoffrey Alan Washburn
  2006-07-12 11:15   ` [Caml-list] " Jonathan Roewen
  0 siblings, 1 reply; 6+ messages in thread
From: Geoffrey Alan Washburn @ 2006-07-11 13:16 UTC (permalink / raw)
  To: caml-list

Keiko Nakata wrote:

> Take a look at driver/errors.ml.
> It may be useful. 

	Thanks, linking against driver/errors.cmo and using Errors.report_error 
worked.  However, is there some other library I could link against that 
wouldn't require end-users having access to the OCaml sources?  I did 
some some investigation, but wasn't able to find one.  I've seen some 
posts in the past where people have been using Errors.report_error, but 
it wasn't obvious from the context what they were linking to get it.


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

* Re: [Caml-list] Re: Pretty printing Toploop errors?
  2006-07-11 13:16 ` Geoffrey Alan Washburn
@ 2006-07-12 11:15   ` Jonathan Roewen
  2006-07-12 11:53     ` Geoffrey Alan Washburn
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Roewen @ 2006-07-12 11:15 UTC (permalink / raw)
  To: Geoffrey Alan Washburn; +Cc: caml-list

> worked.  However, is there some other library I could link against that
> wouldn't require end-users having access to the OCaml sources?

Have you tried toplevellib.cma?


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

* Re: Pretty printing Toploop errors?
  2006-07-12 11:15   ` [Caml-list] " Jonathan Roewen
@ 2006-07-12 11:53     ` Geoffrey Alan Washburn
  2006-07-30 19:40       ` [Caml-list] " Brian Campbell
  0 siblings, 1 reply; 6+ messages in thread
From: Geoffrey Alan Washburn @ 2006-07-12 11:53 UTC (permalink / raw)
  To: caml-list

Jonathan Roewen wrote:
>> worked.  However, is there some other library I could link against that
>> wouldn't require end-users having access to the OCaml sources?
> 
> Have you tried toplevellib.cma?

	I am, but if I only link against that ocamlc claims that it cannot find 
the Errors module.  If I add drivers/errors.cmo it works, but that is 
only in available in the actual OCaml source tree.  Is there something 
else I should be trying?


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

* Re: [Caml-list] Re: Pretty printing Toploop errors?
  2006-07-12 11:53     ` Geoffrey Alan Washburn
@ 2006-07-30 19:40       ` Brian Campbell
  2006-08-01 14:36         ` Geoffrey Alan Washburn
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Campbell @ 2006-07-30 19:40 UTC (permalink / raw)
  To: Geoffrey Alan Washburn; +Cc: caml-list

On Wed, Jul 12, 2006 at 07:53:15AM -0400, Geoffrey Alan Washburn wrote:
> Jonathan Roewen wrote:
> >>worked.  However, is there some other library I could link against that
> >>wouldn't require end-users having access to the OCaml sources?
> >
> >Have you tried toplevellib.cma?
> 
> 	I am, but if I only link against that ocamlc claims that it cannot 
> 	find the Errors module.  If I add drivers/errors.cmo it works, but that is 
> only in available in the actual OCaml source tree.  Is there something 
> else I should be trying?

You might have solved this in the meantime, but in case you haven't:

The problem is that the interface file errors.cmi isn't installed along
with ocaml.  You could keep a copy of errors.mli with your program and
use that to make a suitable errors.cmi for compiling against.  At least,
that seems to work for me.

  Brian


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

* Re: Pretty printing Toploop errors?
  2006-07-30 19:40       ` [Caml-list] " Brian Campbell
@ 2006-08-01 14:36         ` Geoffrey Alan Washburn
  0 siblings, 0 replies; 6+ messages in thread
From: Geoffrey Alan Washburn @ 2006-08-01 14:36 UTC (permalink / raw)
  To: caml-list

Brian Campbell wrote:

> You might have solved this in the meantime, but in case you haven't:
> 
> The problem is that the interface file errors.cmi isn't installed along
> with ocaml.  You could keep a copy of errors.mli with your program and
> use that to make a suitable errors.cmi for compiling against.  At least,
> that seems to work for me.

	That seems to have solved the problem.  Thanks!


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

end of thread, other threads:[~2006-08-01 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-10 10:06 [Caml-list] Pretty printing Toploop errors? Keiko Nakata
2006-07-11 13:16 ` Geoffrey Alan Washburn
2006-07-12 11:15   ` [Caml-list] " Jonathan Roewen
2006-07-12 11:53     ` Geoffrey Alan Washburn
2006-07-30 19:40       ` [Caml-list] " Brian Campbell
2006-08-01 14:36         ` Geoffrey Alan Washburn

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