savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
156 stars 12 forks source link

Add `Integer.Format.Binary` for showing integers in binary format. #300

Closed jemc closed 2 years ago

jemc commented 2 years ago

Integer formatters implement the IntoString trait, which mostly is used in string interpolation, such as in the following example:

    value U8 = 36
    env.out.print("the bits are: \(value.format.binary)")
the bits are: 0b00100100