On 2 September 2010 03:40, Jonathan S. Shapiro <[email protected]> wrote:
> I have been thinking more about mixfix and its relationship to macro
> processing. Actually, this was prompted in part by a weird thought
> concerning blocks.
>
But if and, for example, always expected a function, and the function
itself had to be explicit, you would get
if {foo} and {{bar} or {baz}} then ...
Yuck (TCL, anyone?). If thunking is implicit on the other hand
(perhaps suggested by the type of and), it *might* make code review
much more difficult, and we have to do more work to remove implicit
closures.
Warm and fuzzies suggest to me that the standard set of control flow
operators are special enough to warrant their own syntax and that the
ability to implicitly thunk arguments should not be provided to user
signatures.
> mixfix _and_ : lambda(lhs,rhs) { if rhs then if lhs then true else false
> else false }
or more polymorphically,
mixfix _and_ : (() -> 'a) -> (() -> 'a) -> 'a
_and_ lhs rhs = let r = rhs () in { if r then r else lhs () }
--
William Leslie
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev