Open MinmoTech opened 1 year ago
From discussion on discord:
NGS does not print quotes around strings in arrays, while python does:
ngs -e 'echo(["1"])' [1] ngs -e 'echo([1])' [1] ngs -e 'echo("1")' 1 ngs -e 'echo(1)' 1
python -c 'print([9])' [9] python -c 'print(["9"])' ['9'] python -c 'print(9)' 9 python -c 'print("9")' 9
This can be surprising behavior (it was for me).
NGS also has echo(code(EXPR)) as an alternative:
echo(code(EXPR))
ngs -e 'echo(code(["9"]))' ['9'] ngs -e 'echo(code([9]))' [9] ngs -e 'echo(code(9))' 9 ngs -e 'echo(code("9"))' '9'
Thinking and gathering information.
$ node -e 'console.log([1,"2"])' [ 1, '2' ] $ ruby -e 'puts [1,"2"]' 1 2 $ python3 -c 'print([1, "2"])' [1, '2'] # Raku, online print [1, "a"] 1 a
From discussion on discord:
NGS does not print quotes around strings in arrays, while python does:
This can be surprising behavior (it was for me).
NGS also has
echo(code(EXPR))
as an alternative: