From 77075d6c792580715d3a8616af65bc0ea896a1db Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Thu, 17 Jan 2019 19:28:41 -0600 Subject: [PATCH] DOCS: Added boolean expressions and TODO items. --- TODO.md | 14 ++++++++++++-- docsite/site/content/reference/expressions.md | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) 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