diff --git a/TODO.md b/TODO.md index 758ef4c..f935e8f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,18 @@ # Major Planned Features -## Boolean operations and type +## Compile Errors as expression -* contains (for lists or strings) +## String handling + +Mostly handled by ranges and indexing for strings? + +Type comparisons? + +``` +let foo = "foo"; +foo is str; // evaluates to true +foo is int; // evaluates to false +``` ## Query Language (Experimental) diff --git a/docsite/site/content/reference/expressions.md b/docsite/site/content/reference/expressions.md index f967ab4..2ea1d20 100644 --- a/docsite/site/content/reference/expressions.md +++ b/docsite/site/content/reference/expressions.md @@ -144,6 +144,16 @@ let lst = [1, "two", {three = 3}]; {three = 3, two = 2} in lst // evaluates to false ``` +### Boolean Operators + +UCG has the standard boolean operators: `&&` and `||`. Both of them short circuit and they require the expressions on each +side to be boolean. + +``` +true && false == false; +false || true == true; +``` + #### Operator Precedence UCG binary operators follow the typical operator precedence for math. `*` and