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

Procedures would be kinda useless #14

Open
Botffy opened this issue Oct 18, 2019 · 0 comments
Open

Procedures would be kinda useless #14

Botffy opened this issue Oct 18, 2019 · 0 comments

Comments

@Botffy
Copy link
Owner

Botffy commented Oct 18, 2019

Assignment of arrays in PLanG is by value, that is, they are recursively cloned during assignments. Passing an array as an argument to a function or procedure would follow the same behaviour.

The problem is, this makes procedures kinda useless. Traditionally, in Pascal, procedures are used to alter passed arrays, and that'd be a good usecase for Plang too. But that's impossible with these pass-by-value semantics, unless we introduce out parameters. Without it, the only possible usecase for procedures is to output things. Which is underwhelming.

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

1 participant