"all of" block problem?

this is ok:
brush training v1 script pic1
this is not working:

why? Is it a bug?

all of is predicate input special form
it expects a ring in each of the inputs
if you use its inputs it gives you rings
if you dont it can do anything to that

so i need a ring here?

no you dont
@bh pls make it so that if the inputs are not of type predicate then treat them as booleans(in library,the inputs are fine)

No, pit tje rings around the inputs.

like this?

doesn't work...

No, around each list item.

oh, like this...
brush training v1 script pic

That's right.

Oh, that's interesting. I guess I'll accept that as a bug in the library, which I should fix.

Booleans are a little weird because they work both as niladic functions and as self-quoting constants. If they were just functions I'd say no, not a bug, you shouldn't expect that to work. But in your example they're clearly intended as constants. And it's possible to catch this case in the library procedure.

Just yesterday we had a meeting at which my colleague Prof. Dan Garcia asked for variadic AND and OR. Jens started out saying that wasn't possible because they're lazy. (If the first input determines the result, the second input isn't evaluated.) But Dan convinced him that lazy variadic inputs are possible to implement and so he's considering it. And if we actually do that, the library functions will be unnecessary, so this may become a moot point.

What you really want is for the LIST block, when used in a lazy variadic input slot, to "inherit" the laziness with respect to its own inputs. That would be an elegant solution for these two functions, but I can't think of any other use cases offhand, and it'd be a horrible kludge to implement, so I'm guessing we're not going to do that.

thank you

untitled script pic (2)

or allow call to be used with a constant.

one extra ring

Rather two... :smile: as item(1) may already be a ring expression
untitled script pic (3)

untitled script pic (5)

ah right i only spot call(ring(x)) without further inspection

I tried to fix it within the Programming tools script pic (14) and Programming tools script pic (15) implementation scripts, with a more 'general' solution than @dardoro 's, but to no avail (every time I thought I had solved it something else went wrong). Did these functions work universally before Snap! 8.1?

Maybe post Your test cases.


All of block problem script pic (1)
Works for me with any combination of primitive values and rings.

Or, a simpler version doing the same job: