hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

Unreduced logical connectives #92

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There's an incompatibility in the treatment of unreduced logical connectives 
between lists and matrices:

  > all (>0) [a,1,2,3,x];
  a>0&&x>0&&1
  > all (>0) {a,1,2,3,x};
  <stdin>, line 7: unhandled exception 'failed_cond' while evaluating 'all (flip (>) 0) {a,1,2,3,x}'

Original issue reported on code.google.com by aggraef@gmail.com on 28 Sep 2012 at 8:32

GoogleCodeExporter commented 8 years ago
The behaviour of all and any with unreduced applications of the predicates in 
the list case seems to be an unintended consequence of rev. c8059eb7b83a. The 
original design was to have these operations bail out with an exception in such 
cases, which is consistent with the behaviour of the filter, takewhile and 
dropwhile operations, and is what the matrix implementation still does. Thus 
the appropriate fix seems to be to revert the relevant changes in rev. 
c8059eb7b83a. (Note that this makes it impossible to apply all and any in a 
symbolic way, but if this behaviour is required then it can also be achieved 
with an appropriate combination of foldl and map, such as: foldl (&&) 1 $ map 
(>0) [a,1,2,3,x].)

Original comment by aggraef@gmail.com on 13 Nov 2012 at 3:28

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 57cc51d654d0.

Original comment by aggraef@gmail.com on 13 Nov 2012 at 3:55