rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

better print string concatenation

Open bobzhang opened this issue 7 years ago • 4 comments

instead of print it as

a ^ (b ^ c)

print it as

a ^ b ^ c 

bobzhang avatar Apr 10 '17 19:04 bobzhang

I would love to work on this, is it still available?

GlenDC avatar Aug 27 '17 23:08 GlenDC

yes, it is, thanks!

On Mon, Aug 28, 2017 at 7:50 AM, Glen De Cauwsemaecker < [email protected]> wrote:

I would love to work on this, is it still available?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BuckleScript/bucklescript/issues/1534#issuecomment-325232787, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtmKxuaB2UzSYzLaqgVTcdPatuK2D57ks5scgDIgaJpZM4M5OFp .

-- Regards -- Hongbo Zhang

bobzhang avatar Aug 28 '17 03:08 bobzhang

Does this include JS output for string interpolation? E.g., currently the output for the following:

let x = 1;
let y = false;
let result = {j|The number is $x, the condition is $y|j};

is this:

var result = "The number is " + (String(1) + (", the condition is " + (String(/* false */0) + "")));

yawaramin avatar Jan 22 '18 05:01 yawaramin

In ReScript v9.1.2, this

let concat = (a, b, c) => a ++ b ++ c

let x = 1
let y = false
let result = j`The number is $x, the condition is $y`

compiles to

function concat(a, b, c) {
  return a + b + c;
}

var result = "The number is " + 1 + ", the condition is " + false;

Does that mean this issue can be closed?

Minnozz avatar Jun 13 '21 15:06 Minnozz

As far as I can see this is resolved already. Closing.

cknitt avatar May 27 '23 19:05 cknitt