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

Default inputs #33

Open
PeterShaggyNoble opened this issue May 19, 2017 · 2 comments
Open

Default inputs #33

PeterShaggyNoble opened this issue May 19, 2017 · 2 comments

Comments

@PeterShaggyNoble
Copy link
Contributor

As it stands U-Z all default to 0. Would it be possible to change those defaults to something else, with each parameter being different?

This would give room for 6 new variables/shortcuts, presuming, of course that no arguments are passed through them.

I haven't given much thought to what the new defaults could be yet but one possibility might be an empty array of length U, equivalent to [...Array(U)] in ES6. Unless I've missed a trick, which could well be the case after less than 24 hours working with it, there's currently no shortcut for that in Japt.

@ETHproductions
Copy link
Owner

Yes, good idea. I've been considering changing the default value of V to 1 to help with recursive programs (fibonacci, for example), not sure what the others should be though. If you need to, you can get an all-zero array of the same length as U with .

@PeterShaggyNoble
Copy link
Contributor Author

Thanks, @ETHproductions. I've since figured out a few other ways of generating an array of length U - as [...Array(U)] generates an array of empty elements, usually in order to map over it, avoiding the need for any sort of loop, the contents of the array don't much matter.

Back to the issue at hand, I still haven't put much more thought into what the new default parameters could be, but I'd suggest that they be assigned to the input variables in order of least to most useful, thereby reducing the risk of overwriting the most useful ones.

@ETHproductions ETHproductions changed the title Default Parameters Default inputs Feb 16, 2018
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