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

Avoid using Str #2

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Avoid using Str #2

merged 1 commit into from
Mar 26, 2024

Conversation

AltGr
Copy link
Contributor

@AltGr AltGr commented Mar 26, 2024

The "str" library is still shipped together with the OCaml stdlib but generally considered obsolete; better alternatives include the re library that we use in Catala, but here, the use-case being very simple, Scanf is powerful enough and reasults in more readable code.

To be honest, my main motivation was avoiding the need to link another dependency into the Catala runtime :)

Note/advice: side effects within assert should be avoided, assert in OCaml is not a standard function and it would break your code if compiled with the -noassert flag.

The "str" library is still shipped together with the OCaml stdlib but generally
considered obsolete; better alternatives include the `re` library that we use in
Catala, but here, the use-case being very simple, `Scanf` is powerful enough and
reasults in more readable code.

To be honest, my main motivation was avoiding the need to link another
dependency into the Catala runtime :)

Note/advice: side effects within `assert` should be avoided, `assert` in OCaml
is not a standard function and it would break your code if compiled with
the `-noassert` flag.
@rmonat rmonat merged commit c409b7d into CatalaLang:main Mar 26, 2024
1 check failed
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