closed Boolean builtin functions?

0 votes
asked Nov 22, 2022 in Wanted features by Todd Musheno (2,680 points)
closed Dec 7, 2022 by Todd Musheno
Could we get builtin funtions for "and", "or" and "xor", I do see "not" listed.
closed with the note: Exactly what I expected

1 Answer

0 votes
answered Nov 22, 2022 by plantuml (294,960 points)
edited Nov 22, 2022 by plantuml

Sure!

One big question is the syntax you would like better:

  • %and(a, b)
  • a and b
commented Nov 23, 2022 by The-Lu (63,920 points)

Hard to find the best syntax...cheeky

Because the both already exists :

  • `&&`
  •  `||`
  • `%not(...)`

Regards.

commented Nov 25, 2022 by Todd Musheno (2,680 points)
I was expecting functions, so %xor(a,b)...
Might want to kitchen sink boolean operators btw, but and or xor, & not are the minimum set IMHO
commented Nov 25, 2022 by plantuml (294,960 points)

You can now have this.

Is this what you were expecting?

commented Nov 28, 2022 by Todd Musheno (2,680 points)
Yes... I would suggest xor is also needed...

You also might want to think about adding while you are at it...

NAND = not (A and B)

NOR = not (A or B)

XNOR = not (A xor B)

... that would round out the full list of rudimentary boolean functions.
commented Nov 29, 2022 by plantuml (294,960 points)
Ok, let's go for it!

Current online version now also supports %xor, %nand, %nor and %nxor

Hope this helps!
...