Closed fennewald closed 2 years ago
Just read the docs. I was running an ancient version. Similar features already exist. Closing!
I did indeed recently add support for things like 0x10
and 124₅
, so it does work to some degree. However, I wouldn't call the current system complete. I actually think the other suggestions you made would be great to have. Although, I guess there's still the issue of how to deal with letters, since they may exist as variables. Maybe only literals should be allowed inside base
.
The addition of n-base functionality would be very helpful to kalker. I propose three changes: 1.) Literals of standard formats are understood. Namely,
0x
,0o
and0b
. Examples of this functionality:2.) Add the base predefined function, of the format
base(n, m)
, which outputs the string representation of n in base m.Note that if the output is not to the interactive prompt, it should be interpreted simply as n
Optionally, define the functions
hex(n)
,oct(n)
, andbin(b)
as shorthand forbase(n, 16)
,base(n, 8)
, andbase(n, b)
.3.) Add a command line flag
--base=n
to define default base of output. e.g.,kalker --base=16
would result in all outputs being default formatted as base 16.