Skip to content

Conversation

PureFox48
Copy link
Contributor

The purpose of this PR is to enable comparisons between strings as discussed in #1142.

This will be particularly useful when sorting a list of strings.

The String.compareTo instance method is implemented in C for maximum speed and the comparison operators <, <=, >, >=, which call it under the hood, are implemented in Wren.

Tests and documentation are included in the PR.

@mhermier
Copy link
Contributor

mhermier commented Mar 4, 2023

Implementation is good enough, thought the style is not really my taste.
We could squeeze a little bit more efficiency by making operators primitives, but that can wait till we can prove to be a bottleneck.

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