Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "open!" mean?

I'm looking at an OCaml source file that begins with the following instruction:

open! MiscParser 

I understand that open MiscParser means "open the MiscParser module", but I don't know what the exclamation mark means.

like image 254
John Wickerson Avatar asked Mar 24 '14 11:03

John Wickerson


People also ask

What does it mean if someone is open?

adjective. If you describe a person or their character as open, you mean they are honest and do not want or try to hide anything or to deceive anyone. He had always been open with her and she always felt she would know if he lied. Synonyms: frank, direct, natural, plain More Synonyms of open.

What does I'm open mean?

I am open to receiving... means "you can send me group invitations, I don't mind, I welcome it".

What does open mean in text?

interested in someone romantically. Derived from the phrase "nose open", implying that one is literally smelling the object of their affection, similar to the way dogs sniff other dogs buttocks. James got me open. Last edited on Oct 21 2013.

What does it mean to open something?

Definition of open (someone or something) to (someone or something) 1 : to allow (a particular group of people) to enter, use, or participate in (something) He opens his home to anyone who needs a place to stay.


2 Answers

It's to avoid triggering warnings if the open shadows an exisiting identifier. See the manual.

like image 151
Daniel Bünzli Avatar answered Oct 15 '22 13:10

Daniel Bünzli


Extending what Daniel said, it also tells the compiler to not warn if the open is not used anywhere in the code. One of the common things people do is to open! Core, since Core is such a useful library that one should just open it even they may not be using it.

like image 24
ethan xu Avatar answered Oct 15 '22 14:10

ethan xu