Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Frank Atanassow <franka@cs.uu.nl>
To: reig@dcs.gla.ac.uk
Cc: caml-list@inria.fr
Subject: Question on language design (keywords vs Pervasives)
Date: Sat, 19 Aug 2000 18:57:44 +0200 (MET DST)	[thread overview]
Message-ID: <14750.48264.608634.961622@silvester.cs.uu.nl> (raw)
In-Reply-To: <200008180207.LAA05417@ropas.kaist.ac.kr>

Fermin Reig writes:
 > I'm curious about some interesting language design choices in ocaml
 > 3.0.
 > 
 > * "raise", "exn" are not keywords, but definitions in the Pervasives module.
 > 
 > This means that I can rebind them, [..elided..]
 > 
 > I can speculate that the intention is precisely that praogrammers be
 > able to rebind them at will, or maybe that it simplifies implementing
 > interpreters/compilers, but I don't know for sure. Could anyone
 > (preferably someone involved in the design) comment on the rationale
 > for these choices?

Maybe the ability to rebind was some small motivation, but I imagine the goal
of simplicity was the more significant factor. Why make "int" or "raise" a
keyword if you don't need to? Even if you rebind "int", say, functions
operating on the new "int" will not work on the old.

Conversely, if you made "int" or "raise" a keyword, why stop there? You could
also make a whole range of other notions special: reals, complex numbers,
associative maps, commands (procedures with types of the form A -> unit), file
I/O primitives, regular expressions, certain shell-related procedures... maybe
you can guess where I'm heading. :)

Of course, it's true OTOH that as keywords we could be slightly more confident
that we haven't made a mistake and overlooked some rebinding, but in practice
most people leave "int" and "raise" alone, or if they're rebound, then that's
done in another module and the fact that we're not talking about
Pervasives.int, say, is explicit in the fact that we call it "ModuleX.int",
say.

(BTW, I'm not involved with Ocaml.)

-- 
Frank Atanassow, Dept. of Computer Science, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-1012, Fax +31 (030) 251-3791



  reply	other threads:[~2000-08-20 17:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-18  2:07 Fermin Reig
2000-08-19 16:57 ` Frank Atanassow [this message]
2000-08-20 19:01 ` Pierre Weis
2000-08-20 19:55   ` John Prevost
2000-08-21  8:58     ` Pierre Weis
2000-08-21 19:47       ` John Prevost
2000-08-21 21:41         ` Pierre Weis
2000-08-21 16:44   ` John Max Skaller
2000-08-21 21:24     ` Pierre Weis
2000-08-22  0:38       ` Kwangkeun Yi
2000-08-22  2:25         ` John Max Skaller
2000-08-22  9:08           ` Pierre Weis
2000-08-22  8:31         ` Pierre Weis

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=14750.48264.608634.961622@silvester.cs.uu.nl \
    --to=franka@cs.uu.nl \
    --cc=caml-list@inria.fr \
    --cc=reig@dcs.gla.ac.uk \
    /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