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

Re-introduce out-variables as optional function variants. #20

Open
shakesoda opened this issue Dec 16, 2016 · 1 comment
Open

Re-introduce out-variables as optional function variants. #20

shakesoda opened this issue Dec 16, 2016 · 1 comment

Comments

@shakesoda
Copy link
Member

Sometimes you actually do need those extra percentage points, so we should have an optional UI. We took the outvars out of 1.2.9, but they did have merit.

This could be implemented as foo_inplace which the main function variants wrap with additional checks.

@revolucas
Copy link

I think the main problem was in the original library out was the first param. Out vars should be last param and then you can just simply use:
out = out or self for most situations and out = out or new()
Which should allow you to use temp variables or reuse variables, example:

m:transpose() -- will alter original in place
m:transpose(tmp) -- will keep original intact but return altered tmp
m:translate(tmp):rotate(vec4):scale(vec3) -- will keep original intact but tmp will be translated, rotated and scaled

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