satyr/coco

unexpected result when using -bps to compile a small snippet

larroy opened this issue · 4 comments

cat|coco -bps
I = (x) -> x
[Function]

Output should be:
(function(){
var I;
I = function(x){
return x;
};
}).call(this);
~

-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

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);

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.

Feel free to tweak the wiki and/or pull-req for #232 if you dare.