Hi Darren,
The require(.) call ensures that there are no clashes between the
modules it loads in. If there are, then an error will be thrown.
So if you have a module 'a.sjs' with an export 'foo', and a module
'b.sjs' also with an exported 'foo', then calling "require(['a',
'b'])" will give an error.
'@' itself doesn't care about what you set on it. If you do '@foo = 1'
and later '@foo = 2', then '@foo' will just be overwritten.
'@' is really just a module-local object that gets initialized to {}
at the beginning of a module, and that allows access to its members
without a '.'. Internally, SJS translates the code:
@ = require('a');
...
@foo()
...
doSomethingWith(@bar)
into
var __alt_namespace = {};
__alt_namespace = require('a');
...
__alt_namespace.foo();
...
doSomethingWith(__alt_namespace.bar);
Cheers,
Alex
> --
> You received this message because you are subscribed to the Google Groups
> "StratifiedJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
stratifiedjs...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
Alexander Fritze
http://onilabs.com