MPSEND "" gives error
Root / SmileBASIC Bug Reports / [.]
SquareFingersCreated:
When multiplayer communications are on, MPSEND with an empty string generates the error "Illegal function call".
Besides the fact that this really shouldn't generate an error, it generates the wrong error. MPSEND is not a function.
There's no difference that you acknowledge, if you choose not to acknowledge the difference that functions can have their actual parameters surrounded by parentheses, sure.
EDIT: To be more precise, their actual parameter list.
It's true that you can call every builtin (but not keyword) as an OUT without receiver variables. As with functions, you can call them as OUT with only one receiver variable. Just as well, you can use RETURN in non-function DEFs, and you can pass SOME values to the statement and get away with it (I forget if this is just a parsing ambiguity or not.) So he may have a point, that every statement in SB is just some kind of function; there are just some that don't return anything. Just as well, the command syntax and the function/expression syntax are likely just sugar which could boil down to OUT and some intermediates, I don't know.
In terms of implementation, every built-in name that when called, does something, can just be implemented as a function anyway. Random mentioned this about PRINT being a keyword, and he as well makes a point. This is programming, not math (unless you're Haskell, I guess,) so we're allowed to write routines that don't return anything (or some null value, or something) and just that has happened many times. Void functions in C, for example. These languages don't have any sort of "subroutines" at all, because they don't need them. Just functions.
Ruby is an interesting example. Everything you define with the def keyword is just a function, with parens around the arguments, and they all return values. But semantically, you can treat them as though they're just "commands." You don't have to wrap the arguments in parentheses if it's not ambiguous, and you don't need anything to receive the return value. puts, for example, Ruby's print function.
puts "Hello!" puts("Hello!") string = puts "Hello!" # returns the output stringSo BASIC in general is somewhat of an outlier in this regard. Functions and other statements are different here, on the surface, but not by necessity. It could be possible that internally it's all some kind of function call, or weird OUT chain, or something.. But yeah, they're different.