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

The pass-by-value catastrophe #6

Closed
akkuankka opened this issue May 28, 2021 · 0 comments · Fixed by #8
Closed

The pass-by-value catastrophe #6

akkuankka opened this issue May 28, 2021 · 0 comments · Fixed by #8

Comments

@akkuankka
Copy link
Owner

Currently everything in the computation side of the code (i.e. not the lexer) is pass-by value (i.e. fn foo(self)). I think this is mostly OK, because stuff doesn't need to be used once it's combined into another value e.g. let c = a + b once that's been done it really doesn't matter what a is, it can go out of scope, but for things like DivisibleBy where you are just gaining some knowledge about a number and then using that to decide what to do with the number, pass-by-reference (i.e. fn foo(&self)) should be used.

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

Successfully merging a pull request may close this issue.

1 participant