ramdascript icon indicating copy to clipboard operation
ramdascript copied to clipboard

export form

Open quangv opened this issue 7 years ago • 1 comments

Hi, ramdascript looks awesome.

I was curious what the correct export form?

Input:

(def x (fn []
  (console.log 'hi')))

(export x)

Expected:

var x = function () {
    return console.log('hi');
}

export default x;

Actual:

var x = function () {
    return console.log('hi');

https://yosbelms.github.io/ramdascript/#link:(def%20x%20(fn%20%5B%5D%0A%20%20(console.log%20'hi')))%0A%0A(export%20x)

quangv avatar Apr 20 '18 01:04 quangv

RamdaScript compiler supports several output formats. Try putting the source code in a file and run

ram compile -src ./my-file.ram

The result should be a my-file.js with the exported object according to the CommonJS standard.

yosbelms avatar Apr 23 '18 22:04 yosbelms