Open joelmccracken opened 10 years ago
Yeah we need some syntax to wrap an arbitrary expression in a contract. Here are some possibilities:
var f = @ wrap {
function () { ... }
} in (Num) -> Num
var f = @ wrap {
function () { ... }
} (Num) -> Num
var f = @ (Num) -> Num wrap {
function () { ... }
}
I'm not really excited about any of these. Any ideas?
Of all of them, I certainly like the last the best. I was thinking something like:
@wrap (Num) -> Num Foo.prototype.inc = function(val) {...};
would read the next expression and wrap the first function expression it comes to. I don't know how practical that would be though.
On Fri, Oct 10, 2014 at 6:29 PM, Tim Disney notifications@github.com wrote:
Yeah we need some syntax to wrap an arbitrary expression in a contract. Here are some possibilities:
var f = @ wrap { function () { ... }} in (Num) -> Num var f = @ wrap { function () { ... }} (Num) -> Num var f = @ (Num) -> Num wrap { function () { ... }}
I'm not really excited about any of these. Any ideas?
— Reply to this email directly or view it on GitHub https://github.com/disnet/contracts.js/issues/23#issuecomment-58724258.
I can't seem to get anything to work except for the named function form. EX: