On 07/08/2015 22:43, Alexander D. Knauth wrote:
On Aug 7, 2015, at 12:27 PM, Michael Titke <michael.tied...@o2online.de> wrote:
I always suspected this to be a logical joke of forcing people to write their
own quantifiers and to not let them fall for predicate logic.
The best thing about a logic scheme declaring everything but really everything
to be true when it is not false are expressions like the following:
(when (cond (#f 'true)) 'what-is-true?) => 'what-is-true?
The confusing thing about your example, I think, is that cond returns #<void>
if none of the clauses match, when it would be slightly less bug-prone if it raised
an error in that case.
Right!
Yes, even unspecified is not false but it could have been. But that was not
specified. ;-)
Do you mean #<void>? I think it's great that #<void> is a truthy value,
because it allows things like:
Yes, I meant #<void>. That's even better then /unspecified/ even if it
doesn't alway capture the concept.
(and
(some-predicate ...)
(some-effect-returning-void ...)
(some-predicate ...)
(some-effect-returning-void ...)
...)
Or possibly one of those effects could return void on success, but false on a
failure, which would cause the `and` expression to stop and return false,
signaling a failure. That's one nice use of that, at least.
As a matter of style I prefer the form /(and predicate1 ... predicate-n
side-effect)/ or I know about the return values of a row of side-effects.
Also the simpler the true/false separation is, the better, in my opinion.
Additionally it's a good idea to keep it on a level where you can
distinguish it from error reporting.
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.