Why does <a called block = itself> not equal true?

Sorry about making so many topics recently, just I was wondering why
didn't report true?

Don't be sorry; asking questions is how you learn. And you're asking about Snap!, rather than about who hates whom.

We've tried to design the gray ring user interface so that you can use higher order functions without thinking too hard about how they work. But to answer your question, you need to understand a bit about how they work. Running a gray ring creates a procedure. Most of the time that doesn't matter, but it does if the procedure uses local variables of the script that includes it:

preloaded libraries script pic

preloaded libraries script pic

preloaded libraries script pic (1)

Those two procedures were made by the same gray ring, but in different contexts, one with number=3 and the other with number=5. So they're two different procedures.

Calling a gray ring repeatedly makes a new procedure each time, even in cases where it doesn't matter because there are no inherited local variables. (Note, this doesn't mean calling the procedure made by the gray ring; when you use MAP, for example, the gray ring around its first input is called only once, to create the procedure input to MAP; inside map, that procedure, not the gray ring, is called repeatedly, without making a new procedure each time.

In your example, it isn't even the same gray ring, so it should be extra clear that those are two different procedures.

If you say
preloaded libraries script pic
both inputs to = are the same procedure.

I had to read that a few times to get it, but I think I understand now.

a while ago (like months ago), I found out that there is a way to detect if the blocks are the same (although it doesn't look at inputs). Just do
untitled script pic - 2020-11-12T155746.717
but I am thinking of creating something like that, but it also checks for inputs.

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