Hello,
Here's another approach to the "junctive comparisons". A junctive macro:
(define-syntax junctive
(syntax-rules ()
( (junctive compare (f args-1) (g args-2))
(f (lambda (a)
(g (lambda (b)
(compare a b))
args-2))
args-1) )
( (junctive compare arg (g args-2))
(junctive compare (any (list arg)) (g args-2)) )
( (junctive compare (f args-1) arg)
(junctive compare (f args-1) (any (list arg))) )))
It's simpler than it looks. Only the first clause is essential, the
last two are for the special cases of a single element.
Couple of examples from the note on the Perl 6 list:
$dice_sum == 7 | 11
would be:
(junctive = dice-sum (any '(7 11)))
any(@new_values) > all(@existing_values)
(junctive > (any new-values) (every existing-values))
Ed