Browse thread
Estimating the size of the ocaml community
-
Yaron Minsky
-
Christopher A. Watford
-
Frédéric_Gava
-
skaller
-
Erik de Castro Lopo
- Olivier_Pérès
-
Thomas Fischbacher
-
Frédéric_Gava
-
Thomas Fischbacher
- Paul Snively
- josh
- Richard Jones
-
Jon Harrop
-
Michael Walter
-
Jon Harrop
- Damien Doligez
- Thomas Fischbacher
- Michael Walter
-
Radu Grigore
- Gerd Stolpmann
- Jon
-
Jon Harrop
- Thomas Fischbacher
- Richard Jones
-
Michael Walter
- Ville-Pertti Keinonen
-
Oliver Bandel
-
Thomas Fischbacher
-
Oliver Bandel
- Richard Jones
-
Oliver Bandel
-
Thomas Fischbacher
- Basile STARYNKEVITCH
-
Thomas Fischbacher
- ronniec95@l...
- skaller
- chris.danx
-
Frédéric_Gava
-
Erik de Castro Lopo
- sejourne_kevin
- Stefano Zacchiroli
-
skaller
-
Frédéric_Gava
- Kenneth Knowles
- Michael Jeffrey Tucker
- Richard Jones
- Nicolas Cannasse
- Evan Martin
- Eric Stokes
- chris.danx
- Sylvain LE GALL
- sejourne_kevin
- Sven Luther
- Johann Spies
-
Christopher A. Watford
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Richard Jones <rich@a...> |
| Subject: | Why can't types and exceptions be nested (was: Re: [Caml-list] Estimating the size of the ocaml community) |
On Sat, Feb 05, 2005 at 02:14:18PM +0100, Oliver Bandel wrote: > ...well.... > > type sometimes_t = Integer of int | One_symbol | Another_symbol Another annoyance of OCaml is that 'type' definitions (and exception defns for that matter) can't be nested. I'm a big big fan of nested functions, and sometimes I want to return a type which is only used briefly between two nested functions. Instead the type has to go right at the start of the outer function, which may be many pages of code away. This reduces readability. Is there a reason why types (and exceptions) can't appear nested? I suppose that a nested type might "escape" the scope where it appears, but then surely it becomes an opaque type, just like types hidden in modules. The reason why exceptions cannot be nested is slightly more understandable, because the runtime appears to build up a global list of exceptions, but I'm sure there's some workaround. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com