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

Upgrade random-int to be compatible with HE #259

Open
ngeiswei opened this issue Mar 6, 2025 · 1 comment
Open

Upgrade random-int to be compatible with HE #259

ngeiswei opened this issue Mar 6, 2025 · 1 comment
Labels
compatibility Issues related compatibility with other versions of MeTTa

Comments

@ngeiswei
Copy link
Contributor

ngeiswei commented Mar 6, 2025

What is your problem?

random-int is no longer compatible with the HE version, it needs to support random generators. See https://github.com/trueagi-io/hyperon-experimental/blob/8463e00c6a64fdddd485278bc2ad33fde27451cd/lib/src/metta/runner/stdlib/stdlib.metta#L206-L239

How to reproduce your problem?

Run the following code in MeTTaLog

!(random-int (new-random-generator 0) 0 2)

What do you get?

[(random-int (new-random-generator 0) 0 2)]

What should normally expect?

A random number within [1, 2).

@ngeiswei ngeiswei added the compatibility Issues related compatibility with other versions of MeTTa label Mar 6, 2025
@ngeiswei
Copy link
Contributor Author

ngeiswei commented Mar 6, 2025

I must add that there is an undocumented default random generator &rng.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issues related compatibility with other versions of MeTTa
Projects
None yet
Development

No branches or pull requests

1 participant