Browse thread
Re: Proposal for study: Add a categorical Initial type to ocaml
- chet@w...
[
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: | chet@w... |
| Subject: | Re: Proposal for study: Add a categorical Initial type to ocaml |
I read the referenced note [http://caml.inria.fr/caml-list/0967.html] and while I agree with most of what's said there, I think that putting the "option" attribute onto a field would reduce its value. Specifically, it is a highly common (albeit problematic) idiom in C, C++, Java, and other languages, to program with a pointer to X, which is perhaps null, and is only checked late, at the point when it is destructured somehow. That sort of idiom would not be possible to capture -- when we fetch the value of an "option" field, we are implicitly asking for the field to be checked for non-null-ness. In other words, I think that "nullability" is a useful property of types in general, and not merely of types of fields. --chet--