I don't like this idea for Racket. The macros "and" and "or" do not behave like functions any more than "if" does. This isn't Haskell, our functions are eager while our conditional forms are short-circuiting. If we want first-order values that perform conjunction and disjunction, but eagerly, we should give them separate names. Otherwise we're going to get some very confusing programs. For instance, if you treat "and" / "or" as functions, various program transformations that seem sensible no longer hold. For instance,<br>
<br>(and #true 'result (error "oh no"))<br><br>is not the same as<br><br>(let {[f and]} (f #true 'result (error "oh no")))<br><br>...if "and" produces a short-circuiting form in the former case and an eager function in the latter.<br>
<br>I do agree that functions performing boolean conjunction/disjunction are useful. We could call these things andf / orf, and/proc / or/proc, conj / disj, or any number of other paired names that aren't already taken for conditional special forms.<br>
<div class="gmail_extra"><br clear="all"><div>Carl Eastlund</div><br>
<br><br><div class="gmail_quote">On Mon, Dec 10, 2012 at 6:16 PM, J. Ian Johnson <span dir="ltr"><<a href="mailto:ianj@ccs.neu.edu" target="_blank">ianj@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I just made a pull request for making and/or expand to functions that perform and/or following a discussion with stamourv and asumu. Vincent believes these additions should also be made to the student languages, but I thought I'd start a discussion about this before doing that work.<br>
What are people's thoughts on this?<br>
-Ian<br>
_________________________<br>
Racket Developers list:<br>
<a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br>
</blockquote></div><br></div>