Is there a way to invert a condition in like ASSERT_HEIGHT_ABSOLUTE in chialisp, such that the program would throw an error if the condition is met, but proceeds normally if it doesn’t?
Not knowing chialisp I can’t answer this ( guess “!” ). Might be worth joining r/Chialisp on Reddit, there is expertise on there…
Id recommend checking out the official keybase development channel. Thats where the devs hang out.
Given, ChiaLisp is a Lisp language, you might find more references for general Lisp.
From what Ive found with a quick search:
Operator | Description | Example |
---|---|---|
= | Checks if the values of the operands are all equal or not, if yes then condition becomes true. | (= A B) is not true. |
/= | Checks if the values of the operands are all different or not, if values are not equal then condition becomes true. | (/= A B) is true. |
> | Checks if the values of the operands are monotonically decreasing. | (> A B) is not true. |
< | Checks if the values of the operands are monotonically increasing. | (< A B) is true. |
>= | Checks if the value of any left operand is greater than or equal to the value of next right operand, if yes then condition becomes true. | (>= A B) is not true. |
<= | Checks if the value of any left operand is less than or equal to the value of its right operand, if yes then condition becomes true. | (<= A B) is true. |
max | It compares two or more arguments and returns the maximum value. | (max A B) returns 20 |
min | It compares two or more arguments and returns the minimum value. | (min A B) returns 10 |
Operator | Description | Example |
---|---|---|
and | It takes any number of arguments. The arguments are evaluated left to right. If all arguments evaluate to non-nil, then the value of the last argument is returned. Otherwise nil is returned. | (and A B) will return NIL. |
or | It takes any number of arguments. The arguments are evaluated left to right until one evaluates to non-nil, in such case the argument value is returned, otherwise it returns nil. | (or A B) will return 5. |
not | It takes one argument and returns t if the argument evaluates to nil. | (not A) will return T. |