But
The only things that can be called are reporters and predicates (also commands that have the report
block).
I see.
Good work!
Optimisation: I think all the parameters doesn't have to be evaluated... you can stop evaluating after you found the 1st false value
false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true
will be false: in this case, we know it when we evaluate the 1st parameter...
Yes has a short-circuit evaluation built-in "for free" so recursion stops early.
I think an interesting related question is why Snap rejects values when e.g. a reporter is expected (like in post 1: "expecting a ring but getting true"). What would go off the rails if values were accepted in these cases?
So recursion stops, period!
It was a hard call, and in fact by coincidence we've been asking ourselves that question. But, in most cases, if a user gives a non-procedure value when a procedure is expected, it's a bug rather than a cleverness. (For example, the user is trying to write WHILE and doesn't get that a non-ringified value can't change each time through the loop.) And it's easy enough for the user to ringify the value.
Yeah,optimization isn't too early
Speaking for myself, I choose to differ of opinion. Therefore, building on @dardoro’s example (post #19), I developed a more inclusive CALL-block:
A limitation is it can’t be augmented “WITH INPUTS” - in those cases Snap!’s CALL will need to be used.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.