On 12-06-13 6:43 PM, Patrick Walton wrote:
+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.
Compare (adopting the proposed revision back to ., for module-separator):
fn trans_binary(bcx: ^block, op: ast.binop, lhs: ^ast.expr,
rhs: ^ast.expr, dest: ^dest, ex: ^ast.expr) -> block;
vs.
fn trans_binary(bcx: *block, op: ast.binop, lhs: *ast.expr,
rhs: *ast.expr, dest: *dest, ex: *ast.expr) -> block;
I actually think if you're going to go down that road you want * to be
unsafe as it is now, and ^ to be your region pointer. That has both more
precedent in other languages and, looking at the above examples, is a
bit less visually noisy.
Bonus intuitions: * evokes C, which is what it's used for, and region
pointers always point "up" the stack to a root pinned in an earlier frame :)
-Graydon
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev