From 128379a75481caf0154e278946bc775fbc4378ff Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Sat, 21 Sep 2013 15:53:52 -0700 Subject: [PATCH] Created Sigil reference (markdown) --- Sigil-reference.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Sigil-reference.md diff --git a/Sigil-reference.md b/Sigil-reference.md new file mode 100644 index 0000000..aa5441e --- /dev/null +++ b/Sigil-reference.md @@ -0,0 +1,10 @@ +A quick reference of the sigils and their meaning: + +| Sigil | Meaning | +| ----- | ------- | +| `~` | Owned pointer; like a normal value, but always pointer-sized, and allocated on the heap | +| `&` | Borrowed pointer; a pointer to data that you do not own and thus cannot free | +| `&mut`| Mutable borrowed pointer; like a borrowed pointer, but cannot alias with any other pointer, and you can mutate through it | +| `@` | Managed pointer; a pointer to data that no one owns. Allows cycles. Garbage collected | +| `'` | Lifetime/label marker; used to label loops for labeled break and to indicate the lifetime of a borrowed pointer (eg `&'a T`) | +| `*` | Raw pointer; just like a pointer in C. Requires unsafe code to dereference. Can be NULL | \ No newline at end of file