Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't log into http://yorick.sourceforge.net/phpBB3/ #16
Sorry to post this here, I know it's not a Yorick issue, but I cannot for the life of me log into the user forums (I used link off website: http://yorick.sourceforge.net/phpBB3/).
I know the following works
All well and good. Should the following work?
I was hoping that eq_nocopy()ing an array slice would not copy the slice but copy a reference to the slice. Should eq_nocopy be doing this (i.e., am i using it wrong) or is this not what it is for?
Yes, sorry about the forums. I can't figure out how to fix it -- if you are a phpBB3 expert, any advice on how to migrate to the sourceforge supported BB would be greatly appreciated.
You cannot do what you want in yorick -- there is no way a yorick array variable can reference a discontiguous hunk of memory. Yorick treats eq_nocopy like any other function, so it's arguments are evaluated before eq_nocopy is ever called. Thus,
have precisely the same effect, although the former is slightly slower. However, in the second case, yorick makes a distinction when the RHS is a simple variable reference::
Usually, yorick uses references to arrays wherever possible. However, in my opinion, the overwhelming majority of the cases in which you write this statement, what you mean is for
To go beyond your question, you might ask, so why do you ever need
I still haven't told you what
The same problem arises with
Unlike numpy, yorick does not have any way to refer to a slice of an object. All slicing operations happen immediately and result in a temporary array. On the LHS of an assignment statement, the slicing is deferred until the assignment takes place. Instead of creating a slice object, yorick encourages you to keep an index array pointing into your object when you want to assign back into the same subset you used for a calculation. This typically increases performance at the expense of using more memory than having an abstraction for slices. In your case, what you wanted was::
The question is, why would you want to assign to