On 6/13/12 6:37 PM, Niko Matsakis wrote:
On 6/12/12 3:33 PM, Graydon Hoare wrote:
Try sketching some code in a buffer, see how it looks. Might be
possible to come up with an abbreviation (!T perhaps, or the old
unused sigil ?T maybe?), might be possible for inference and a couple
rules about the boundaries of extern functions to fill in the details.
We could use ^T for unsafe ptrs, like Pascal.
I've been thinking that the idea of an unsafe region is perhaps not the
best thing ever. It's not clear where it fits into the "region"
hierarchy. We'd need various weird special-case code to cope with it
(it's kind of the longest lived region there is, but illegal to
dereference, and illegal to use as the value of a function's region
argument, unless you're in an unsafe block...). Probably cleaner to just
keep unsafe pointers as their own thing.
+1 for ^T. There's also precedent in Managed C++ (although ^ is a
managed pointer there, while we'd be using it for the opposite).
^ is somewhat ugly, but unsafe pointers are by their very nature ugly
and it's at least a lightweight-looking sigil.
fn free(^void);
vs.
fn free(*unsafe.void);
fn free(&unsafe.void);
fn free(&void);
Patrick
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev