... | ... | @@ -2,30 +2,38 @@ Links to some example macros. If you've written a cool macro and want to share p |
|
|
|
|
|
Note that these gists aren't necessarily kept up to date and might not work with the current version of sweet.js.
|
|
|
|
|
|
* [C-style assert() function](https://gist.github.com/TooTallNate/baa25c0a58b7bd181bab) - No longer working
|
|
|
* [haskell style do-notation](https://gist.github.com/3831514) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230304))
|
|
|
* [fragment of scheme](https://gist.github.com/3854258) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230315))
|
|
|
* [parameter annotations](https://gist.github.com/3902112) (update for v0.3.x [here](https://gist.github.com/ozten/8fa2f35d400e38b528dd))
|
|
|
* [coffeescript's `do` syntax](https://gist.github.com/4013740) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230362))
|
|
|
* [chained comparisons](https://gist.github.com/4027626) (update for v0.3.x [here](https://gist.github.com/ozten/c9330efe9ee16ce4da3c))
|
|
|
* [rudimentary enum](https://gist.github.com/4065056) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230455))
|
|
|
* [y-combinator](https://gist.github.com/4133116) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230476))
|
|
|
* [repo with lots of examples](https://github.com/fabriceleal/SweetJsTests) (updated for v0.3.x)
|
|
|
* [null checking](https://gist.github.com/4165526) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230494))
|
|
|
* [hygienic destructuring using the coffeescript-style `$do` macro](https://gist.github.com/4554165) (update for v0.3.x [here](https://gist.github.com/Nami-Doc/8230514))
|
|
|
## Repos
|
|
|
* [contracts](https://github.com/oleiman/sweet-contracts)
|
|
|
* [case matching](https://gist.github.com/disnet/6024833) (update for v0.3.x [here](https://gist.github.com/ozten/0a2e982044de8830f105))
|
|
|
* [cond (better switch)](https://gist.github.com/disnet/6024991) (update for v0.3.x [here](https://gist.github.com/ozten/f4a23d85e49a628c4a35))
|
|
|
* [randomly disappearing code](https://gist.github.com/Nami-Doc/95e8334830aced6d1e52)
|
|
|
* [shorthand function syntax, inspired by clojure's shorthand function macro](https://github.com/benjreinhart/lambda-jam)
|
|
|
* [lambda-jam](https://github.com/benjreinhart/lambda-jam) - shorthand function syntax, inspired by clojure's shorthand function macro
|
|
|
* [CSP-style tasks and channels](https://github.com/srikumarks/cspjs)
|
|
|
* [sweetreaction](https://github.com/myfreeweb/sweetreaction) - macros for react
|
|
|
|
|
|
## Snippets
|
|
|
### ~0.3.0
|
|
|
* [haskell style do-notation](https://gist.github.com/3831514)
|
|
|
* [fragment of scheme](https://gist.github.com/3854258)
|
|
|
* [parameter annotations](https://gist.github.com/ozten/8fa2f35d400e38b528dd)
|
|
|
* [coffeescript's `do` syntax](https://gist.github.com/4013740)
|
|
|
* [chained comparisons](https://gist.github.com/ozten/c9330efe9ee16ce4da3c)
|
|
|
* [rudimentary enum](https://gist.github.com/4065056)
|
|
|
* [y-combinator](https://gist.github.com/4133116)
|
|
|
* [repo with lots of examples](https://github.com/fabriceleal/SweetJsTests)
|
|
|
* [hygienic destructuring using the coffeescript-style `$do` macro](https://gist.github.com/4554165)
|
|
|
* [case matching](https://gist.github.com/ozten/0a2e982044de8830f105))
|
|
|
* [cond (better switch)](https://gist.github.com/ozten/f4a23d85e49a628c4a35)
|
|
|
* [arrow functions](https://gist.github.com/btd/8663940)
|
|
|
* [for loops with `for(x <- items)` and `for(x, i <- items)` syntax](https://gist.github.com/ayosec/8794795)
|
|
|
* [high-resolution timing macro for Node.js](https://gist.github.com/raysohn/8892286)
|
|
|
* [Array.prototype.filter-like method call expanded into an efficient loop](https://gist.github.com/andreypopp/8978374)
|
|
|
* [CSP-style tasks and channels](https://github.com/srikumarks/cspjs)
|
|
|
* [various sugars for the Meteor framework](https://gist.github.com/michaelstephendavies/983790a7ecd49a29981f)
|
|
|
* [compile-time toString](https://gist.github.com/natefaubion/74e4d6d1440d9baa5c05)
|
|
|
* [sweetreaction](https://github.com/myfreeweb/sweetreaction) macros for the React library
|
|
|
* [tail call 'optimization'](https://gist.github.com/J-Chaniotis/4d4f516de7bd0acd38a8)
|
|
|
* [JSHint-clean array/object iterators & array comprehensions](https://gist.github.com/09d7fb45cd510f37b70f)
|
|
|
* [constexpr](https://gist.github.com/natefaubion/f4be4c8531ef45de87b4) - evaluate expressions at compile time
|
|
|
|
|
|
## <0.3.0
|
|
|
* [parameter annotations](https://gist.github.com/3902112)
|
|
|
* [chained comparisons](https://gist.github.com/4027626)
|
|
|
* [case matching](https://gist.github.com/disnet/6024833)
|
|
|
* [cond (better switch)](https://gist.github.com/disnet/6024991)
|
|
|
* [compile-time toString](https://gist.github.com/natefaubion/74e4d6d1440d9baa5c05)
|
|
|
* [C-style assert() function](https://gist.github.com/TooTallNate/baa25c0a58b7bd181bab) |
|
|
\ No newline at end of file |