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

Make variadic “vector” and “tuple” words. #140

Open
evincarofautumn opened this issue Nov 9, 2014 · 0 comments
Open

Make variadic “vector” and “tuple” words. #140

evincarofautumn opened this issue Nov 9, 2014 · 0 comments

Comments

@evincarofautumn
Copy link
Owner

vector should take a compile-time constant size and produce a vector of that size. tuple should do a similar thing for tuples. That is, 3 vector should produce code that constructs a vector with three elements.

It is possible to type vector dependently. Pseudocode:

define vector<s, a> (s a n elems, n :: uint -> s, a vector):
  __make_vector

type elems<s, a, n>:
  if (n = 0) { s } else { s a (n - 1) elems, a }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant