Replies: 3 comments 2 replies
-
|
I've found one thing that i can almost work with: the unit-type. If i feed the scope with unit type the user (creating the expression) can then use the ?? to use a default value. But its very limited |
Beta Was this translation helpful? Give feedback.
-
|
Well, If you want to push an Using the unit type to indicate missing or unavailable information is idiomatic. Many standard library functions do so. |
Beta Was this translation helpful? Give feedback.
-
|
Oki! Is there any easy way to check if the variable is of unit-type? In ideal world for me users could use But I guess i would need |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! Thanks for an excellent crate!
I have a question regarding nulls in Rhai:
Is it supported? How do i use it?
I want my users to be able to check for null/None/nil or whatever the notion is. Some values that i feed them are missing and I want the option for them to also return null/missing.
I've read somewhere that Option gets set to null in Rhai if it's None. But if i print the value as a string it say tyhe type of it is "core::option::Option" which seems correct I guess? But I cant use that type in an if-statement.
When i try some statements with null in Rhai playground i get an error on simple
let q = null;saying null is reserved.Beta Was this translation helpful? Give feedback.
All reactions