4. Builtin library API

This chapter describes API of builtin mods and val types.

Val types are described in the page of its companion mod. For example, methods of str vals are described in the page of kink/STR mod.

Note that every val contains `repr` var. The target of `repr` var is expected to be a nullary method returning a str which describes the val. For example:


stdout.print_line(new_val.repr)         # => (val val_id=123)
stdout.print_line([1 2 3].repr)         # => [1 2 3]
stdout.print_line(BIN.of(1 2 3).repr)   # => (bin 0x01 0x02 0x03)
stdout.print_line("hello world\n".repr) # => "hello world\n"