You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var contracts = require("contracts-js");
setupContracts(contracts);
fun (Num) -> Num
function dbl(x) { return x + x; }
console.log(dbl(4));
But when I run, it fails because "npm install sweet-contracts" doesn't seem to have "contracts-js" as a dependency. No worries; I "npm install contracts-js" and that works fine--it's installed. When I "sweet-contract" the source above, no errors. But when I run, I get "ReferenceError: C is not defined"; the output file looks like this:
var contracts$0 = require('contracts-js');
var C$2 = contracts$0;
var dbl$5 = C.guard(C.fun([C.Num], C.Num), function (x$8) {
return x$8 + x$8;
});
console.log(dbl$5(4));
Sure enough, if I manually edit the output to change "C$2" to "C", it works great. It looks like C is getting picked up by another macro and transformed.
Is this a known issue, am I doing this wrong, or am I misunderstanding things here?
The text was updated successfully, but these errors were encountered:
I do the sample from the README:
var contracts = require("contracts-js");
setupContracts(contracts);
fun (Num) -> Num
function dbl(x) { return x + x; }
console.log(dbl(4));
But when I run, it fails because "npm install sweet-contracts" doesn't seem to have "contracts-js" as a dependency. No worries; I "npm install contracts-js" and that works fine--it's installed. When I "sweet-contract" the source above, no errors. But when I run, I get "ReferenceError: C is not defined"; the output file looks like this:
var contracts$0 = require('contracts-js');
var C$2 = contracts$0;
var dbl$5 = C.guard(C.fun([C.Num], C.Num), function (x$8) {
return x$8 + x$8;
});
console.log(dbl$5(4));
Sure enough, if I manually edit the output to change "C$2" to "C", it works great. It looks like C is getting picked up by another macro and transformed.
Is this a known issue, am I doing this wrong, or am I misunderstanding things here?
The text was updated successfully, but these errors were encountered: