[r6rs-discuss] Comparison procedures' number of arguments
Abdulaziz Ghuloum
aghuloum at cs.indiana.edu
Tue Oct 21 11:32:12 EDT 2008
On Oct 21, 2008, at 11:04 AM, Ken Dickey wrote:
> No. Actually, I'd like a holds-for-all which returns #f as the
> base case.
You can push it down, but you can't escape making these
exceptions.
Nonrecursive definitions:
for-all p? [a_i, ...] = (and (p? a_i) ...)
holds-for-all p? [] = #f ;;; Exception to the and rule
holds-for-all p? [a_i, ...] = (and (p? a_i) ...)
this holds-for-all is more complex than the plain for-all.
Recursive definitions:
for-all p? [] = #t
for-all p? [a : as] = (and (p? a) (for-all p? as))
holds-for-all p? [] = #f ;;; Exception again
holds-for-all p? [a] = (p? a)
holds-for-all p? [a : as] = (and (p? a) (holds-for-all p? as))
this holds-for-all is also more complex than the plain for-all.
There's a reason why this holds-for-all does not appear as often
in math (even elementary high-school math) as the vanilla for-all.
Aziz,,,
More information about the r6rs-discuss
mailing list