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

Guards - list supported operators #13

Open
rokf opened this issue Jan 21, 2024 · 2 comments
Open

Guards - list supported operators #13

rokf opened this issue Jan 21, 2024 · 2 comments

Comments

@rokf
Copy link

rokf commented Jan 21, 2024

Hi,

Currently the description in the Guards lesson of the tour says the following:

Only a limited set of operators can be used in guards, and functions cannot be called at all.

Source: https://tour.gleam.run/flow-control/guards/

Could (should) we list the supported operators or link to an external resource where there's an up-to-date list of them?

Cheers!

@lpil
Copy link
Member

lpil commented Jan 23, 2024

Good idea!

@espretto
Copy link

Hi,
I was recently asked this same question on exercism's gleam track. From the compiler source code I gathered that the following are allowed:

  • integer, float and boolean operators
  • access to variables and constants
  • access to tuple and record contents (thru index/field)
  • access to public members of an imported module

I am no rust programmer so this would have to be confirmed.

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

No branches or pull requests

3 participants