Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let arrays with non-constant elements not supported #37

Closed
bradunov opened this issue Sep 20, 2014 · 2 comments
Closed

Let arrays with non-constant elements not supported #37

bradunov opened this issue Sep 20, 2014 · 2 comments

Comments

@bradunov
Copy link
Collaborator

Add constant size arrays with variable values. For example,
let y = {x1, x2} in
currently does not compile, but seems to have very clean sematics:
var tmp:arr[2] : int;
tmp[0] := x1; tmp[1] := x2;
let y = tmp

For example:

let f(a:arr int) =
let x1 = 5;
let x2 = 4;
let b = {x1, x2} in
let c = b[1] in
return c
in

read[int] >>> emit f({1,2}) >>> write[int]

@edsko
Copy link
Collaborator

edsko commented Dec 16, 2014

This is related to #28. Currently array values can only have scalar values as elements in the AST (that is, bits, ints, doubles, bools, strings, or unit values). This issue asks for this to be extended to variables, and issue #28 asks for this to be extended to contain nested structs. Both extensions will require modifications to the AST and hence to the rest of the compiler pipeline, in addition to extensions to the parser.

@edsko
Copy link
Collaborator

edsko commented Dec 31, 2014

Partly implemented. See #85.

@edsko edsko closed this as completed Dec 31, 2014
edsko added a commit that referenced this issue Dec 31, 2014
This partly implements #28 and #37, but I not updated codegen (#85). However,
this may also be useful in the optimizer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants