Re: Converting from 0 and 1 to -1 and 1
- From: Lie Ryan <lie.1296@xxxxxxxxx>
- Date: Wed, 12 May 2010 17:34:14 +1000
On 05/10/10 18:12, Jussi Piitulainen wrote:
Yes, I have trouble thinking up any naturally ternary operations. AsAnything vaguely usable with three operands would do. Median of
three numbers. Majority vote of three booleans.
Many of these are just special cases of N-operand operators. The
challenge is an operator syntax that allows an arbitrary number of
operands (and which doesn't look like a single operand which happens
to be a list, although that is another way of doing it).
soon as the notation has brackets and a comma in it, it is natural to
extend the number of operands arbitrarily. We do zero, one, two, many.
Think again: function call is an N-ary operator
all the unary, binary, ternary operator can be thought a syntax sugar
for calling functions (some gotcha: laziness).
btw, is there any language that have zero-ary operator? otherise we
should go one, two, many not zero, one, two, many...
- Prev by Date: Re: Questions about my Parallel Sort Library...
- Next by Date: Re: Converting from 0 and 1 to -1 and 1
- Previous by thread: Re: Converting from 0 and 1 to -1 and 1
- Next by thread: Re: Converting from 0 and 1 to -1 and 1