brain icon indicating copy to clipboard operation
brain copied to clipboard

Limited const declarations

Open sunjay opened this issue 9 years ago • 0 comments

We already have the ScopeItem variants to support this for basic constant values (like booleans), byte literals and numbers. We could add a feature similar to what Rust has for const declarations. These are values with no memory address. They get inlined during compilation. They must have a declared type.

const foo: u8 = 17;
const bar: [u8; _] = b"bar spam";
const DEBUG: bool = false;

These const declarations would support very limited code on the right-hand side (literal values only for now).

sunjay avatar Mar 05 '17 20:03 sunjay