Re: Better? or less good?
David Raymond Christiansen <david-DRnKfiA+q4/[email protected]>
| Newsgroups | gmane.comp.lang.racket.user,gmane.lisp.scheme.plt |
|---|---|
| Message-ID | <[email protected]> |
Hello, > I noticed that Racket detects the variables used without any value. > But let us consider the expression: > > (or #t Gor) > > Since "or" evaluates as few arguments as possible, the result is #t, > but this expression is rejected by Racket because "Gor" is unbound. So > the rule would become: some arguments of "and" and "or" may be not > evaluated, for example: > > (and #f (/ 0)) > > but do not use this feature with unbound identifiers... From my modest > point of view, that is not homogeneous... What do you think, please? There are (at least) two kinds of bad program texts out there: those texts that encode programs that will crash when run, and those texts that are not even programs. Here are some examples of the former: (error "oops") (/ 1 0) Here are some examples of the latter: (/ who-knows 2) ((((- (- ") The latter category are not even programs, because they cannot be translated to a binding tree. The first example in the second group is not a binding tree because it has a name that doesn't point at any binding location, while the latter two have mismatched delimiters. Now let's look at two putative program texts: (or #t (error "oops")) and (or #t fnord) The former has the same meaning as this: (let ((v #t)) (if v v (error "oops"))) This is a program that will not crash. The latter has the same meaning as this: (let ((v #t)) (if v v fnord)) This is not even a program, because "fnord" has no meaning. Does this make sense? /David -- 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+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.