unexpected result when using -bps to compile a small snippet
larroy opened this issue · 4 comments
larroy commented
cat|coco -bps
I = (x) -> x
[Function]
Output should be:
(function(){
var I;
I = function(x){
return x;
};
}).call(this);
~
vendethiel commented
-bps
means --bare --print --stdin
. So it doesn't compile and won't add the iife wrapper (--bare
).
If you want to compile, use -bpcs
satyr commented
coco
's --print
works more like node
's and (unlike coffee
) doesn't imply --compile
.
$ coco -pe 0
0
$ node -pe 0
0
$ coffee -pe 0
(function() {
0;
}).call(this);
larroy commented
Thanks. I was just trying to migrate to coco from coffee and didn't found a clear syntax reference. These discrepancies led me to think that it wasn't working properly. I think if there could be more documentation adoption could be improved. Is there a way to help for the novice in this respect?
Pedro.