-
Notifications
You must be signed in to change notification settings - Fork 375
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
feat: add realm /r/demo/math_eval #965
Conversation
This realm adds a lexer/parser for integer expressions
Can you rename this realm to something else than « eval », maybe « bc » to match the Unix utility, or « math_eval ». Up to you. |
@moul yes, no problem! |
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 miss gno.mod
files :)
@harry-hov, we need an explicit CI check for this. Edit: started working on it here: #981 |
This PR introduces a new `gno lint` subcommand, currently focused on checking for the presence of a `gno.mod` file in a package, and it's linked with the CI. In the future, we plan to expand `gno lint` to support additional checks, enhancing its utility for developers and CI integration. Addresses #850 Addresses #927 Related with #965 (comment) Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> Co-authored-by: Miloš Živković <milos@zmilos.com>
This PR introduces a new `gno lint` subcommand, currently focused on checking for the presence of a `gno.mod` file in a package, and it's linked with the CI. In the future, we plan to expand `gno lint` to support additional checks, enhancing its utility for developers and CI integration. Addresses gnolang#850 Addresses gnolang#927 Related with gnolang#965 (comment) Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> Co-authored-by: Miloš Živković <milos@zmilos.com>
This eval realm is capable of evaluating 32-bit integer expressions as they would appear in Go. For example, you can use this package (and realm) to evaluate an expression like
"(32*32+4)-1"
when presented as a string.This could have several applications. This current "eval" realm is simply demonstrating it as a 32-bit integer calculator.
I would like to also add floats, but it seems
strconv.ParseFloat
is not available yet.In the future I would like to use the int32 version of this package in the bytebeat realm (#840) which could then utilize this library to generate audio directly from string expressions, instead of programmed realms - which ultimately gets closer to an audio NFT platform where expressions are uploaded if they are parsed correctly.
To test, you can just add the
eval
package and realm:Then open up to
localhost:8888/r/demo/math_eval
and try expressions in the URL query, likelocalhost:8888/r/demo/math_eval:1+1
.Checklists...
Contributors Checklist
BREAKING CHANGE: xxx
message was included in the descriptionMaintainers Checklist
CONTRIBUTING.md
BREAKING CHANGE:
in the body)