Remix.run Logo
pansa2 3 months ago

IMO it's much closer to the ideal way to write the function, which would be something like:

    fn stringify(item) =>
        item.is_a(String) then item else
        item.value.convert(item.conversion).format(item.format_spec)

    fn f(template) => template.map(stringify).join()
pphysch 3 months ago | parent [-]

By what definition of "ideal"? You just hid all the complexity in those undefined `convert` and `format` methods.