I'm just thinking out loud in this e-mail, trying to generate alternatives.

What would happen if we had an operator that returned the number of true values? Say we call it "boolean plus", or "bop".

        To give one example: 1 bop 3 = 2

        Say we're looking at: ($x > 1) bop 3 bop ($y < 0)

        To get the boolean-logic definition, we'd do:

        ($x > 1) bop 3 bop ($y < 0) % 2

        To get the natural-language one, we'd do:

        ($x > 1) bop 3 bop ($y < 0) == 1

Drawbacks:
-       Extra typing
-       bop doesn't do xor for just 2 values, so we'd still need something for
        that

        Or, maybe we could somehow overload the "and" operator to do "bop".

        Anyway, just thinking out loud.

        :)


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to