Tim Disney
Tim Disney
Ha, good catch. That contract is definitely not what we want to say. Maybe something like this is better. ``` js @ (x: Pos) -> res:Num | res > (Math.sqrt(x)...
Good call, that's probably a bit more clear.
So I haven't used immutable.js too much yet but this should just be a contract on the `get`/`set` interface right? ``` js import @ from "contracts.js" var Immutable = require('immutable');...
Yeah we need some syntax to wrap an arbitrary expression in a contract. Here are some possibilities: ``` js var f = @ wrap { function () { ... }...
> All examples in the doc are broken. Do they not work with the npm package for you (surprising)? Or are you working off master (expected, we're about to release...
Yeah this is expected. All the forms that MDN calls precedence 19 (static/computed member access, `new`, call) are not really operators in the sense that Sweet understands. This is because...
The escape syntax for syntax templates is the same as normal templates: ``` js #`a literal backtick \` and then we're done` ```
Oops. That's supposed to be the escape but looks like we have a bug: ``` js syntax test = function (ctx) { return #`let x = \`template string\`;` } test...
I'm excited you're looking into this! Definitely a perfect area to explore with macros. Unless you want to go down exactly the JSX route I don't think you necessarily need...
For custom tags (tags that aren't pre-defined) you could have a parameterized macro: ```js import X_ from 'tag-macros'; var doc = X_(MyOwnTag) { X_(AnotherTagThatDidNotExistPreviously) { X_(ThisOneIsntAvailableAtCompilineTime) { } } }...