Page 1 of 1

[0.15.17] Decider combinator bug

Posted: Thu Jun 01, 2017 6:47 pm
by MikasaTanikawa
Decider will pass any 'Everything' conditional if input has no signals.

Re: [0.15.17] Decider combinator bug

Posted: Thu Jun 01, 2017 7:42 pm
by TruePikachu
Not a bug, this is intentional for consistancy with pretty much every programming languge that has a multi-argument AND, and is correct behaviour. "Everything" additionally only handles nonzero signals, as well, since a zero signal is the same as an absent signal.

Code: Select all

? (defun combinator-equal-1 (&rest signal-values)
    (every (lambda (v) (= v 1))
           (remove-if #'zerop signal-values)))
COMBINATOR-EQUAL-1
? (combinator-equal-1 1 1 1) ; 3 signals, all are one
T
? (combinator-equal-1 1 2 1) ; 3 signals, two are one and one is two
NIL
? (combinator-equal-1 1 2) ; 2 signals, a one and a two
NIL
? (combinator-equal-1 1 1) ; 2 signals, both one
T
? (combinator-equal-1 1) ; 1 signal, a one
T
? (combinator-equal-1 2) ; 1 signal, a two
NIL
? (combinator-equal-1) ; No signals
T
? (combinator-equal-1 1 0 1) ; "3" signals, two ones and a zero (the zero is ignored)
T
? (combinator-equal-1 0) ; "1" signal, a zero (which is ignored)
T
You'll notice all of these tests are consistant with the actual game.