yasl icon indicating copy to clipboard operation
yasl copied to clipboard

`str.repr` and related functions

Open CoffeeTableEspresso opened this issue 3 years ago • 1 comments

these should return a string representation that is legal YASL code.

for example:

const x = 'string'
echo x           # string
echo x->repr()   # 'string'

Strings will be quoted, certain characters will be escaped, etc.

list.repr and table.repr will behave recursively.

Possibly, we need a set.repr as well.

CoffeeTableEspresso avatar Apr 26 '21 02:04 CoffeeTableEspresso

For many types, these could defer to type.tostr, for example booleans and ints.

CoffeeTableEspresso avatar Aug 18 '21 02:08 CoffeeTableEspresso

Added a parameter to tostr in v0.13.0

CoffeeTableEspresso avatar Apr 21 '23 03:04 CoffeeTableEspresso