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

Refactorings based on Steffan153's work #40

Merged
merged 4 commits into from
Nov 2, 2024
Merged

Refactorings based on Steffan153's work #40

merged 4 commits into from
Nov 2, 2024

Conversation

ingydotnet
Copy link
Contributor

These are now the best known yamlscript solutions.

@ingydotnet ingydotnet marked this pull request as draft October 30, 2024 18:22
@ingydotnet
Copy link
Contributor Author

Requires 0.1.81 before merging.

@ingydotnet ingydotnet requested a review from vendethiel October 30, 2024 18:22
if amount < 0:
die: 'amount must be greater than 0'
else: amount
reduce _ closed operations:

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)

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)) &&

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

@ingydotnet ingydotnet marked this pull request as ready for review November 2, 2024 22:05
@ingydotnet ingydotnet merged commit 084ef73 into main Nov 2, 2024
3 checks passed
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 this pull request may close these issues.

2 participants