diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-09-29 03:41:05 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-09-29 03:41:05 -0700 |
commit | f334aa73e94f2d3787f431a444b347c33afc0bde (patch) | |
tree | b1f557dd8aea9ea5aa9c94209410c892e08f7fd5 /mu.md | |
parent | 9aea89ba73280bcaeee67f6bd01f725a9698b344 (diff) | |
download | mu-f334aa73e94f2d3787f431a444b347c33afc0bde.tar.gz |
6897
Diffstat (limited to 'mu.md')
-rw-r--r-- | mu.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mu.md b/mu.md index 9c26dd67..9ed2f693 100644 --- a/mu.md +++ b/mu.md @@ -470,6 +470,13 @@ type point { Mu programs are currently sequences of `fn` and `type` definitions. +Compound types can't include `addr` types for safety (use `handle` instead). +They also can't currently include `array`, `stream` or `byte` types. Since +arrays and streams carry their size with them, supporting them in compound +types complicates variable initialization. Instead of defining them inline in +a type definition, define a `handle` to them. Bytes shouldn't be used for +anything but arrays of bytes (utf-8 strings). + To access within a compound type, use the `get` instruction. There are two forms. You need either a variable of the type itself (say `T`) in memory, or a variable of type `(addr T)` in a register. |