From: Kristopher Micinski <micinski@cs.umd.edu>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] Why aren't OCaml constructors functions?
Date: Thu, 18 Jun 2015 10:49:25 -0400 [thread overview]
Message-ID: <CAF1Sy-F_UvicE6U0MR10rpBBoBNw1DHJrTN3u84Bd0aBCys_Gw@mail.gmail.com> (raw)
This is an obvious question with an answer that is nonobvious to me.
One potential reason I could believe is that it might be a performance
optimization to ensure that all constructors were known to be fully
applied when used. But that seems unnecessary: a simple rewrite rule
(even syntactic) would likely fix this for the majority of cases.
This leads me to believe it isn't the reason.
Another reason might be to avoid potential name clashes. I typically
name constructors things that might also be reasonable function names,
but not often.
I've done a fair amount of googling on this and can't find any threads
on this, searching back through this list down to 2012. It's possible
I missed something.
Kris
next reply other threads:[~2015-06-18 14:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 14:49 Kristopher Micinski [this message]
2015-06-18 15:16 ` Andreas Hauptmann
2015-06-18 17:00 ` Kristopher Micinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAF1Sy-F_UvicE6U0MR10rpBBoBNw1DHJrTN3u84Bd0aBCys_Gw@mail.gmail.com \
--to=micinski@cs.umd.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox