Please fill out these questions for all feature requests and bug reports. If you're requesting a feature, please let us know why this feature is important or useful, not just what it should do.
Thanks!
What browsers show this problem?
any
Please share an example project (if possible).
Nope,Its the manual
Describes the steps to reproduce this issue.
Turn the manual to page 71
What does Snap! currently do?
show:
if(<(parent) is a reporter>){
return(call(parent)with inputs(message))
}
What should Snap! do instead?
show:
if(<(parent) is a command>){
return(call(parent)with inputs(message))
}
Objects are functions with locals and can be callen at any time.They are commands , NOTreporters !
I think this is the third time you've posted this, and you're still not understanding what a command is and what a reporter is. Instead of just saying the same thing again, maybe ask a question?
OH! Sorry, now I see what you're saying. But it's not the manual that's wrong; it's the IS_A_ block that gives the wrong answer for anonymous functions. That's a bug, but I'm not promising it'll be fixed soon, since it's a little difficult to know what type of procedure an anonymous one is. For named procedures, we can look at the declared type -- the shape of the block. But for anonymous ones there is no block and no declaration.
In principle we could look inside the body for REPORT blocks, and maybe we should do that. Or maybe we should just collapse Command, Reporter, and Predicate into one Procedure type in the IS_A_ block.
But, again, the manual is right: the object reports a method when called, so it's a Reporter.
Hi!
Maybe I'm missing something... and maybe we can check some definitions, but I don't see a bug here.
My ideas (maybe wrong): a reporter block is a reporter, a command block is a command, and a stack of blocks (a script) is also a command (that script can report or not).
Then, this is running fine. In your project:
"new block" is a reporter and it reports a script. You say an "unevaluated script", yes, becuase if it was evaluated it would not return that script, it would return the evalutation.
Yes it's a reporter.
But its report is a command (a stack of commands)
And doing this with variables, it's the same... but you have to take care if you are pointing to the reporter or to its evaluation.
I see that the REPORT block is a command block, so I understand your point of view. But, when viewed as a script, it's a reporter script, i.e., the script of a reporter, not a command script. So I guess this terminology is ambiguous.
To make everyone happy, since this issue isn't the point of the OOP example, I propose to say
Hi Brian,
I think I understand your ideas, and yes I understand the meaning of "report". But I think we are talking about blocks, and about our Snap! metaphor. And I think it is consistent and great.
Talking about "scripts" we will find there are not reporters and commands, only functions or scripts. For example...
Is this script a reporter? I don't know. Depending of "bool" it reports or not. No!! Because maybe "some code" is reporting first!
You know more than me about programming and about Snap! The only I want to point is that we can take advantage of our metaphor and enjoy it. I understand the predicates "is reporter" or "is command" (or "is predicate") are asking for the type of Snap! element: is talking about blocks (not about their inner scripts)
Then I think my last post can help and answer the "error" of the first question. It explain the behavior of this predicates, and their logic is only "formal", reporting which Snap! elements are.
A reporter block is a reporter (even if it reports nothing, it will be a bad reporter (error) but it's a reporter block)
A command block is a command (even it can report something)
OK,everyone,that block tells us the return value's type of the input.So its correctness depends on what value do you think its reporting...the block type or the return value's type!