A component based functional template language

implement type conversion #23

Open t.ewert.foo
Open opened by t.ewert.foo

Currently there is no concept of type conversion in pinc. However, for string concatenation, the required type is a string. This leads to the following code throwing an error:

let delay = 200;
let time = "$(delay)ms";

It should be made possible to convert the 200 to a string. Maybe this should also happen automatically for string concatenation, though only for specific types (like int and float).

Open questions:

  • Should there also be a Int.of_string, Bool.of_string, Float.of_string etc, or is this not needed in a template language?

Int.to_string and Float.to_string are implemented.

Lets just watch this if other conversion functions are needed.

Sign up or Sign in to add to the discussion.