Module Pattern in JavaScript and CoffeeScript
robots.thoughtbot.com
robots.thoughtbot.com
MyModule = do ->
# module body
No need for any parens. do ->
# module bodysounds like op was specifically referencing to parens for execution.
> CoffeeScript provides the do keyword, which immediately invokes a passed function, forwarding any arguments.
Apparently in April 2012 they updated the code to make it simulate namespacing.
> A tweak to the semantics of do, which can now be used to more easily simulate a namespace: do (x = 1, y = 2) -> ...
class Calculator
prettyText = "Answer is: "
printResult = (result) -> console.log result
add: (addedOne, addedTwo) =>
sum = addedOne + addedTwo
printResult prettyText + sum
calculator = new Calculator(); new GlobalNS.App.MicroViews.TableRow extends Backbone.View
new GlobalNS.App.Models.TableCell extends Backbone.View
...
Essentially you can namespace to Babylon from existing conventions and build "interaction models" (complex namespaces) for standard digital content types like "lists", etc., from say http://pea.rsJS and Hypermedia have always been in harmony. Other boring ideas: https://github.com/nerdfiles/nerdfiles_net_dev/blob/master/t..., https://github.com/nerdfiles/nerdfiles_net_dev/blob/master/t...