Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S sweet-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • sweet-js
  • sweet-core
  • Wiki
  • Example macros

Example macros · Changes

Page history
add some examples directly from the sjs website instead of a warning telling you to go there authored Aug 19, 2016 by Justin's avatar Justin
Hide whitespace changes
Inline Side-by-side
Example-macros.md
View page @ 71cf124f
# NOTE: All of these examples are currently **very** out of date. The [SweetJs website](http://sweetjs.org/) has up-to-date reference material and tutorials.
Links to some example macros. If you've written a cool macro and want to share please add! Links to some example macros. If you've written a cool macro and want to share please add!
Note that these gists aren't necessarily kept up to date and might not work with the current version of sweet.js. ## ~2.0.0
* [basic hello](http://sweetjs.org/doc/1.0/tutorial.html#_sweet_hello)
* [let](http://sweetjs.org/doc/1.0/tutorial.html#_sweet_let)
* [cond (better switch)](http://sweetjs.org/doc/1.0/tutorial.html#_sweet_cond)
* [class](http://sweetjs.org/doc/1.0/tutorial.html#_sweet_class)
* [ML-like auto-curried functions](https://gist.github.com/WreckedAvent/9aa698d3e9e6a46c5c62c1e266c95f20#file-curry-js)
## Repos ## ~0.3.0
* [contracts](https://github.com/oleiman/sweet-contracts) * [contracts](https://github.com/oleiman/sweet-contracts)
* [lambda-jam](https://github.com/benjreinhart/lambda-jam) - shorthand function syntax, inspired by clojure's shorthand function macro * [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) * [CSP-style tasks and channels](https://github.com/srikumarks/cspjs)
* [sweetreaction](https://github.com/myfreeweb/sweetreaction) - macros for react * [sweetreaction](https://github.com/myfreeweb/sweetreaction) - macros for react
## Snippets
### ~0.3.0
* [haskell style do-notation](https://gist.github.com/3831514) * [haskell style do-notation](https://gist.github.com/3831514)
* [fragment of scheme](https://gist.github.com/3854258) * [fragment of scheme](https://gist.github.com/3854258)
* [parameter annotations](https://gist.github.com/ozten/8fa2f35d400e38b528dd) * [parameter annotations](https://gist.github.com/ozten/8fa2f35d400e38b528dd)
......
Clone repository
  • Example macros
  • FAQ
  • High level design overview
  • Home
  • Macro resources
  • Patterns
  • Syntax Case
  • case api
  • custom operators
  • design
  • expander design
  • modules
  • node loader
  • pattern_class
  • reader scratch
View All Pages