What I could see is that sometimes when I use a reporter or predicate with that list, such as , it reports the same list! My mind's going to explode rn.
Think it's a JS bug, but I'm not sure. Hope this gets fixed bc I'm making a category for the Better saga.
I'm having a little trouble reading your mind (an important skill for teachers), but your use of JOIN is incoherent, so I think you're confused about how the CALL surrounding it works.
but COMMAND doesn't take any inputs, so even that wouldn't mean anything.
No matter what you try to wrap around it, COMMAND is a command; it doesn't report a value, and so you can't use that nonexistent value in a larger expression.
You're not doing that ERR_RESET. I don't know what that does, exactly, not having read the relevant code in the Snap! source files, but it wouldn't be there if it weren't important! So you have to do this:
Nope, error upvar is set to "error" when the command is run. I want to set it to "" so that's why I use
. So, for example, I want to convert
to , to finally call it as .
And what if the command reports something? I'm going to lose that value.
I tried doing err_reset but doesn't work either.
As can you see, the real problem is the list. I need another solution.
By definition the command doesn't return anything! That's what makes it a command.
There is a separate block
(note its round shape) for calling reporters and catching errors.
The real problem is that you're putting a command block in a CALL. That's known to give strange results. If it's a command block, you have to RUN it. If you want to CALL it, it has to be a reporter (or a script with a REPORT block).
P.S. Would Snap! be a better language if it only had reporters, like Scheme? Maybe it would, maybe it wouldn't. But it is what it is.
This happens sometimes when you have the report block in the definition of a “safely try” block. It’s quite strange, but basically the report block overrides all its parent scripts so that it can report the value. I’ve encountered this back in the days when JS wasn’t disabled.
Try using the reporter version of the gray PRIMITIVE block instead.
Using REPORT in a command block is an error. Apparently we don't give an error message for it, but we should.
Perhaps you're using it wrong, e.g., not calling err_reset? The reporter SAFELY TRY in the library doesn't use it, to my surprise; it has a command SAFELY TRY inside.
I guess I don't really understand why you want to rewrite this library...