Browse thread
[Caml-list] mutually dependent modules
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Issac Trotts <ijtrotts@u...> |
| Subject: | Re: [Caml-list] mutually dependent modules |
Christophe TROESTLER wrote:
>On Thu, 20 Feb 2003, Issac Trotts <ijtrotts@ucdavis.edu> wrote:
>
>
>>Christophe TROESTLER wrote:
>>
>>
>>> let () = ...
>>>
>>>
>>I only know of one place where that would be needed: [...]
>>
>>
>
>What about the simple example:
>----------------------------------------------------------------------
>print_int
>let f x = x + 1
>----------------------------------------------------------------------
>
>Compiling this gives no warning (like what you mention for let _ =
>print_int). On the other hand, if one had written
>----------------------------------------------------------------------
>let () = print_int
>let f x = x + 1
>----------------------------------------------------------------------
>
>Please correct me if I misunderstood the intent of your mail.
>
>Cheers,
>ChriS
>
Sure, you're right in this case, but I don't tend to write code that way.
In files it would tend to be something like
let foo() =
print_int;
let f x = x + 1 in
f 3;;
File "foo.ml", line 2, characters 8-17:
Warning: this function application is partial,
maybe some arguments are missing.
On the command line I would break it up with ;;'s:
# print_int;;
- : int -> unit = <fun>
# let f x = x + 1 in f 3;;
- : int = 4
Issac
-------------------
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