Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Question on language design (keywords vs Pervasives)
@ 2000-08-18  2:07 Fermin Reig
  2000-08-19 16:57 ` Frank Atanassow
  2000-08-20 19:01 ` Pierre Weis
  0 siblings, 2 replies; 13+ messages in thread
From: Fermin Reig @ 2000-08-18  2:07 UTC (permalink / raw)
  To: caml-list

Hi,

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, for ex., like this:

# type exn = char;;
type exn = char

# let raise x = x + 1;;
val raise : int -> int = <fun>

Similarly for other types in the Pervasives module, like int,
etc. (However, "exception", for declaring a new exception is a
reserved word).

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?

Thanks,

Fermin Reig

------------------------------------------------------
Department of Computing Science, University of Glasgow
http://www.dcs.gla.ac.uk/~reig



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

end of thread, other threads:[~2000-08-22  9:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-18  2:07 Question on language design (keywords vs Pervasives) Fermin Reig
2000-08-19 16:57 ` Frank Atanassow
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox