Scheme has:
call-with-current-continuation http://people.csail.mit.edu/jaffer/r4rs_8.html#IDX509
Tail Call Optimisation
A numeric tower http://people.csail.mit.edu/jaffer/r4rs_8.html#SEC50
A Code/Data equivalence and therefore macros
Ports
Javascript has: Prototypal inheritance
Every 'object' is mutable bag of string indexed properties
There's a pile of differences, even just at the semantic level before you get into the syntax or the equivalence semantics.I understand that if you take a specific subset of javascript, you can write code as-though it has some scheme semantics (minus call/cc and TCO), but that's true to a similar extent of any language with lexical scope, closures and anonymous functions.
Also, magically, I can't use empty(functionResult()); but I can say $result = functionResult(); empty($result);
There are poorly designed parser rules but the namespace operator is not due to that. It's due to the fact that a single PHP file will be compiled to byte code without knowing what the symbols represent until runtime. The separate operator is needed because names are resolved before execution begins and before the symbols are known.
> Also, magically, I can't use empty(functionResult()); but I can say $result = functionResult(); empty($result);
Empty is identical to the not (!) operator except that empty() can operate on undefined variables, undefinted array keys, or undefined properties. empty(functionResult()) doesn't make any sense because functionResult() can never be an undefined variable. You just use !functionResult().