Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Limited const declarations #62

Open
sunjay opened this issue Mar 5, 2017 · 0 comments
Open

Limited const declarations #62

sunjay opened this issue Mar 5, 2017 · 0 comments

Comments

@sunjay
Copy link
Owner

sunjay commented Mar 5, 2017

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 sunjay changed the title Limited const declarations Limited const declarations Mar 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant