caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] what does let () = ... define?
@ 2016-03-18 18:04 Mr. Herr
  2016-03-18 18:26 ` Nick Lucaroni
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Mr. Herr @ 2016-03-18 18:04 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

Hi,

in a small presentation of OCaml (Linux User Group Bremen) I got some interesting
questions, and
trying to answer I noticed I took something for granted that was not fully understood.

Looking at this in the toplevel:

# let () = () ;;
# () ;;
- : unit = ()
# let _ = () ;;
- : unit = ()
# let None = None;;
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
Some _
#

... the question is: okay, pattern matching left of the equal sign, but what does it
define?
It defines unit and None in the environment, and then that value is just sitting there?

/Str.

[-- Attachment #2: Type: text/html, Size: 1046 bytes --]

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

end of thread, other threads:[~2016-03-18 22:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18 18:04 [Caml-list] what does let () = ... define? Mr. Herr
2016-03-18 18:26 ` Nick Lucaroni
2016-03-18 18:52 ` Christoph Höger
2016-03-18 22:06   ` Nicolas Barnier
2016-03-18 19:00 ` octachron
2016-03-18 19:42 ` Stefan Monnier
2016-03-18 21:29 ` Raphaël Proust
2016-03-18 21:54   ` Mr. Herr

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