-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactorings based on Steffan153's work #40
Conversation
Requires 0.1.81 before merging. |
if amount < 0: | ||
die: 'amount must be greater than 0' | ||
else: amount | ||
reduce _ closed operations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a net negative. This loses the spirit of the exercise. The tests need to adjusted.
|
||
defn reverse(list): | ||
core/reverse: list | ||
list:reverse.reduce(function initial) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also not a good example of reimplementing the language in the language, though it already wasn't...
vector a: | ||
if b > 9: (b - 9) b | ||
digits =: value.replace(' ').map(\(_ - \\0)):reverse | ||
digits.#.gt(1) &&: digits.every?(\(0 <= _ <= 9)) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair for now, but also a bit of hack because of no precedence
These are now the best known yamlscript solutions.