caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Toplevel Wish
@ 2006-02-10  2:58 Jonathan Roewen
  2006-02-10  3:05 ` Eric Cooper
  2006-02-10  6:16 ` Michel Mauny
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Roewen @ 2006-02-10  2:58 UTC (permalink / raw)
  To: OCaml

Hi,

I think it would be awesome if the toplevel would be able to spit out
the interface to a module.

Like:

# Printf;;
and it prints out a Module = sig ... end of the module if found.

or some other facility to view this information in the toplevel. Seems
it is capable of displaying pretty much everything else...

Jonathan


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

* Re: [Caml-list] Toplevel Wish
  2006-02-10  2:58 [Caml-list] Toplevel Wish Jonathan Roewen
@ 2006-02-10  3:05 ` Eric Cooper
  2006-02-10 11:23   ` Jon Harrop
  2006-02-10  6:16 ` Michel Mauny
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Cooper @ 2006-02-10  3:05 UTC (permalink / raw)
  To: caml-list

On Fri, Feb 10, 2006 at 03:58:14PM +1300, Jonathan Roewen wrote:
> I think it would be awesome if the toplevel would be able to spit out
> the interface to a module.
> 
> Like:
> 
> # Printf;;
> and it prints out a Module = sig ... end of the module if found.

# module P = Printf;;
module P :
  sig
    val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
    val printf : ('a, out_channel, unit) format -> 'a
    ....
  end

-- 
Eric Cooper             e c c @ c m u . e d u


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

* Re: [Caml-list] Toplevel Wish
  2006-02-10  2:58 [Caml-list] Toplevel Wish Jonathan Roewen
  2006-02-10  3:05 ` Eric Cooper
@ 2006-02-10  6:16 ` Michel Mauny
  1 sibling, 0 replies; 4+ messages in thread
From: Michel Mauny @ 2006-02-10  6:16 UTC (permalink / raw)
  To: Jonathan Roewen; +Cc: OCaml

Jonathan Roewen a écrit :

> I think it would be awesome if the toplevel would be able to spit out
> the interface to a module.
>
> Like:
>
> # Printf;;
> and it prints out a Module = sig ... end of the module if found.
>

Or like this: (;-))

# module P = Printf;;
module P :
  sig
    val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
    val printf : ('a, out_channel, unit) format -> 'a
    val eprintf : ('a, out_channel, unit) format -> 'a
    val sprintf : ('a, unit, string) format -> 'a
    ...

Maybe *module _ = Printf ;;* would be slightly more elegant, but the
above does work.

Regards,

-- Michel


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

* Re: [Caml-list] Toplevel Wish
  2006-02-10  3:05 ` Eric Cooper
@ 2006-02-10 11:23   ` Jon Harrop
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Harrop @ 2006-02-10 11:23 UTC (permalink / raw)
  To: caml-list

On Friday 10 February 2006 03:05, Eric Cooper wrote:
> # module P = Printf;;
> module P :
>   sig
>     val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
>     val printf : ('a, out_channel, unit) format -> 'a
>     ....
>   end

Or if you don't want to pollute the namespace with a module called P:

# module Printf = Printf;;
module Printf :
  sig
    val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
    val printf : ('a, out_channel, unit) format -> 'a
    ...
  end

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


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

end of thread, other threads:[~2006-02-10 11:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-10  2:58 [Caml-list] Toplevel Wish Jonathan Roewen
2006-02-10  3:05 ` Eric Cooper
2006-02-10 11:23   ` Jon Harrop
2006-02-10  6:16 ` Michel Mauny

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