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

[FR]: ord, chr, hex #418

Closed
aryeh-looker opened this issue May 3, 2023 · 3 comments
Closed

[FR]: ord, chr, hex #418

aryeh-looker opened this issue May 3, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@aryeh-looker
Copy link

What is the current behavior?

The canonical starlark implementation does not have these methods.

Describe the feature

Implementing the Python functions ord, chr, hex. At the moment, I don't see a way to do this code-points (ord) without a lookup table; but it's certainly possible. url_encode and url_decode could also be neat; e.g. becomes %20.

@aryeh-looker aryeh-looker added the enhancement New feature or request label May 3, 2023
@github-actions github-actions bot added the untriaged Requires traige label May 3, 2023
@alexeagle
Copy link
Collaborator

alexeagle commented May 3, 2023

@aryeh-looker
Copy link
Author

% bazel run src/main/java/net/starlark/java/cmd:starlark
>> ord 
<stdin>:1:1: name 'ord' is not defined
>> hash('a')
97
>> hash('/')
47
% python3 -c "print(ord('a'), ord('/'))" 
97 47

@thesayyn
Copy link
Collaborator

fixed by #425

@github-project-automation github-project-automation bot moved this to ✅ Done in Open Source May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants