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

merge LocalArray and LocalArrayRead, rename to LocalVector #77

Closed
stevengj opened this issue Jun 1, 2016 · 4 comments
Closed

merge LocalArray and LocalArrayRead, rename to LocalVector #77

stevengj opened this issue Jun 1, 2016 · 4 comments

Comments

@stevengj
Copy link
Contributor

stevengj commented Jun 1, 2016

We could probably have a single type LocalArray{T,readonly} where readonly is true or false

Also, in keeping with Julia nomenclature, it should probably be called LocalVector since it is a subtype of AbstractVector (or DenseVector ala #76).

@JaredCrean2
Copy link
Contributor

I like the name change. The problem with making readonly a static parameter is I don't see a way to doing it that doesn't lead to the #59 or requires excessive information. We could either have the outer constructor

LocalVector{T}(v::Vec; readonly=false)
  return LocalVector{t, readonly}(...args...)

which is type unstable, or the inner constructor:

type LocalVector{T, readonly}
  ... fields...
  function LocalVector(x::Vec)
     return new(...args...)
  end
end

which requires specify the element type T again, even though it is already contained in x.

@stevengj
Copy link
Contributor Author

stevengj commented Jun 3, 2016

We could have type-stable outer constructors LocalVector{T}(v::Vec{T}) = LocalVector{T,false}(...) and LocalVector_readonly{T}(v::Vec{T}) = LocalVector{T,true}(...), though I'm not completely happy with the latter name.

@JaredCrean2
Copy link
Contributor

I'm not happy with the latter name either, but I can't think of anything better, so let's go with it for now.

@JaredCrean2
Copy link
Contributor

This was closed by #80

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

2 participants