caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] interface printing without generating object code?
@ 2003-02-06  3:07 Chris Hecker
  2003-02-07 21:48 ` Emmanuel Renieris
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Hecker @ 2003-02-06  3:07 UTC (permalink / raw)
  To: caml-list


The -i command to the compilers is useful for generating mli files,
but is there a way to only generate the interface, and not have to
compile?

"ocamlc -i foo.ml" tries to compile and link.
"ocamlc -i -c foo.ml" tries to compile.

I just want the interface printed and that's it.

Thanks,
Chris


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

* Re: [Caml-list] interface printing without generating object code?
  2003-02-06  3:07 [Caml-list] interface printing without generating object code? Chris Hecker
@ 2003-02-07 21:48 ` Emmanuel Renieris
  2003-02-08  2:09   ` Chris Hecker
  0 siblings, 1 reply; 7+ messages in thread
From: Emmanuel Renieris @ 2003-02-07 21:48 UTC (permalink / raw)
  To: Chris Hecker; +Cc: caml-list

What  do you want that's not 
   ocamlc -i -c foo.ml -o /dev/null
?

On Wed, Feb 05, 2003 at 07:07:28PM -0800, Chris Hecker wrote:
> 
> The -i command to the compilers is useful for generating mli files,
> but is there a way to only generate the interface, and not have to
> compile?
> 
> I just want the interface printed and that's it.

> Thanks,
> Chris
-------------------
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] 7+ messages in thread

* Re: [Caml-list] interface printing without generating object code?
  2003-02-07 21:48 ` Emmanuel Renieris
@ 2003-02-08  2:09   ` Chris Hecker
  2003-02-08 22:06     ` Emmanuel Renieris
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chris Hecker @ 2003-02-08  2:09 UTC (permalink / raw)
  To: Emmanuel Renieris; +Cc: caml-list


>What do you want that's not
>    ocamlc -i -c foo.ml -o /dev/null
>?

I tried that (well, the windows version with NUL) and it didn't work.  It 
still generated both a cmi and a cmo.  Doesn't yours generate a cmi at 
least, even on unix?  I want no output except stdout.

Thanks,
Chris


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

* Re: [Caml-list] interface printing without generating object code?
  2003-02-08  2:09   ` Chris Hecker
@ 2003-02-08 22:06     ` Emmanuel Renieris
  2003-02-09 12:08       ` Michal Moskal
  2003-02-09 18:45     ` jeanmarc.eber
  2003-02-10  8:59     ` Xavier Leroy
  2 siblings, 1 reply; 7+ messages in thread
From: Emmanuel Renieris @ 2003-02-08 22:06 UTC (permalink / raw)
  To: Chris Hecker; +Cc: caml-list

It does produce both files.  I will second the request. Under linux, 
(unix in general, I think) it is now impossible to do
    ocamlc -c -i foo.ml > foo.mli
because when the compiler sees foo.ml, there is a foo.mli already,
but there is no accompanying .cmi.

-- Manos

On Fri, Feb 07, 2003 at 06:09:56PM -0800, Chris Hecker wrote:
> 
> >What do you want that's not
> >   ocamlc -i -c foo.ml -o /dev/null
> >?
> 
> I tried that (well, the windows version with NUL) and it didn't work.  It 
> still generated both a cmi and a cmo.  Doesn't yours generate a cmi at 
> least, even on unix?  I want no output except stdout.
-------------------
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] 7+ messages in thread

* Re: [Caml-list] interface printing without generating object code?
  2003-02-08 22:06     ` Emmanuel Renieris
@ 2003-02-09 12:08       ` Michal Moskal
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Moskal @ 2003-02-09 12:08 UTC (permalink / raw)
  To: Chris Hecker, caml-list

On Sat, Feb 08, 2003 at 05:06:48PM -0500, Emmanuel Renieris wrote:
> It does produce both files.  I will second the request. Under linux, 
> (unix in general, I think) it is now impossible to do

This depends on shell, not Linux or Unix. But of course under any
reasonable shell foo.mli will be created before ocamlc is run.

>     ocamlc -c -i foo.ml > foo.mli
> because when the compiler sees foo.ml, there is a foo.mli already,
> but there is no accompanying .cmi.

Couldn't you just:

ocamlc -c -i foo.ml > foo.mli.tmp
mv foo.mli.tmp foo.mli ?

-- 
: Michal Moskal ::::: malekith/at/pld-linux.org :  GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::: Wroclaw University, CS Dept :  {E-,w}-- {b++,e}>+++ h
-------------------
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] 7+ messages in thread

* Re: [Caml-list] interface printing without generating object  code?
  2003-02-08  2:09   ` Chris Hecker
  2003-02-08 22:06     ` Emmanuel Renieris
@ 2003-02-09 18:45     ` jeanmarc.eber
  2003-02-10  8:59     ` Xavier Leroy
  2 siblings, 0 replies; 7+ messages in thread
From: jeanmarc.eber @ 2003-02-09 18:45 UTC (permalink / raw)
  To: Chris Hecker; +Cc: Emmanuel Renieris, caml-list

Quoting Chris Hecker <checker@d6.com>: 
 
>  
> >What do you want that's not 
> >    ocamlc -i -c foo.ml -o /dev/null 
> >? 
>  
> I tried that (well, the windows version with NUL) and it didn't work.  
> It  
> still generated both a cmi and a cmo.  Doesn't yours generate a cmi at  
> least, even on unix?  I want no output except stdout. 
>  
 
 
>>What do you want that's not 
>>    ocamlc -i -c foo.ml -o /dev/null 
>>? 
 
>I tried that (well, the windows version with NUL) and it didn't work.  It 
>still generated both a cmi and a cmo.  Doesn't yours generate a cmi at 
>least, even on unix?  I want no output except stdout. 
 
Indeed, something not too far away from what you want exists today in the 
compiler; look into /utils/clflags.ml: 
 
let dont_write_files = ref false        (* set to true under ocamldoc *) 
 
This flag is used for avoiding the production of a cmi file (look 
at file typing/typemod.ml: 
 
      if not !Clflags.dont_write_files then 
        Env.save_signature sg modulename (prefixname ^ ".cmi"); 
 
when the module is used in conjunction with ocamldoc. 
 
My guess: 
 
It should be enough to 
-make this flag "accessible" by a compiler switch, and 
-to add a similar test in 2 or 3 places, for avoiding any file production 
by the compiler. 
 
I argue also in favor of such an enhancement. 
 
Jean-Marc Eber 
LexiFi 
 
-------------------
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] 7+ messages in thread

* Re: [Caml-list] interface printing without generating object code?
  2003-02-08  2:09   ` Chris Hecker
  2003-02-08 22:06     ` Emmanuel Renieris
  2003-02-09 18:45     ` jeanmarc.eber
@ 2003-02-10  8:59     ` Xavier Leroy
  2 siblings, 0 replies; 7+ messages in thread
From: Xavier Leroy @ 2003-02-10  8:59 UTC (permalink / raw)
  To: Chris Hecker; +Cc: Emmanuel Renieris, caml-list

> >What do you want that's not
> >    ocamlc -i -c foo.ml -o /dev/null
> 
> I tried that (well, the windows version with NUL) and it didn't work.  It 
> still generated both a cmi and a cmo.

Yes, the -o option is ignored when just compiling (ocamlc -c).  It
affects only linking and library construction.

> I want no output except stdout.

That's reasonable, and I'm willing to implement this.  I believe no
one currently relies on the fact that ocamlc -i also compiles and
generates .cmi and .cmo files; if not, drop me a line.

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

end of thread, other threads:[~2003-02-10  8:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-06  3:07 [Caml-list] interface printing without generating object code? Chris Hecker
2003-02-07 21:48 ` Emmanuel Renieris
2003-02-08  2:09   ` Chris Hecker
2003-02-08 22:06     ` Emmanuel Renieris
2003-02-09 12:08       ` Michal Moskal
2003-02-09 18:45     ` jeanmarc.eber
2003-02-10  8:59     ` Xavier Leroy

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