New operators block

so this block is a "use string independent comparisons" block, like


it is for use with the

[scratchblocks]
is [] a [ v] :: operators boolean
[/scratchblocks]

and the
[scratchblocks]
< [] = [] >
[/scratchblocks]

blocks.
if the condition was true,
[scratchblocks]
< ((1) + (0)) = (join (1) :: operators)? >
[/scratchblocks]

would return false
and so would
[scratchblocks]
< is (join (0)::operators) a [text? v] ::operators >
[/scratchblocks]

but if the condition was false, those expressions would return true.

Yes, we should revisit comparisons. I want case-independent comparisons, which we have except in names of things (variables, blocks, etc.). You want a sensible treatment of strings of digits. If it were up to me, <is __ a [number] ?> and <is __ a [text string] ?> would both be true for numbers in either form. That's a hard sell because until now (almost) everything has a unique type, but I think it's the right thing. I don't think that should require being turned off and on; it's just the right thing. The fact that we don't quite handle numbers correctly is a bug, not a feature.

The trouble is, Jens complains every time we do anything different from JavaScript in dealing with types, because it requires adding tests (if/then/else) to the implementation, which slows it down. But since hyperblocks, Snap! is so amazingly fast that maybe I can convince him, supposing we ever have the time to do a serious big-picture design review.

ok, so do you think it would be possible?

What are hyperblocks?

stuff like this:
untitled script pic (1)
where, without hyperblocks, you would need to do this instead:
untitled script pic (1)

Someone who programms python will think that multiplying a list duplicates it.
[3,6]*2=[3,6,3,6]
:angry:

well i find what snap does more useful than duplicating a list, since i don't know why anyone would want to duplicate all the items in a list

yeaho

I don't know how to answer this without just repeating what I said before.

We take no responsibility for the bad design of other programming languages.

so you mean yes but @jens doesn't want to

Good grief.

We haven't yet had the discussion I think we should have, and so I don't know for sure what Jens will say when we do. But based on past similar conversations I don't think it'll be an easy question to settle.

yeah :smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.