Page 1 of 1

Specifying type of Integer Literals

PostPosted: Tue Apr 29, 2008 4:16 am
by hopscc
There was some discussion a while ago about specifying the type of a fractional literal ( decimal, float) using various suffixes
(see "New Number type and -number:type option" topic)

I thought a logical extension of that would be to allow suffixes for integer literals to specify size and sign so that rather than
this sort of casting redundancy
Code: Select all
a as int64 = 1000 as int64
l = 73 as int64

you could do something 'nicer' :) like this
Code: Select all
a as int64 = 1000_i64
l as int64 = 73_i64
# or more conveniently
l = 73_i64


Heres a patch that supports int literals with a suffix (i|_i)(8,16,32,64)? or (u|_u)(8,16,32,64).

Re: Specifying type of Integer Literals

PostPosted: Tue Apr 29, 2008 5:07 am
by hopscc
And heres the test file

Re: Specifying type of Integer Literals

PostPosted: Tue Apr 29, 2008 7:33 am
by Charles
Thanks. I'll take a look this week.

Re: Specifying type of Integer Literals

PostPosted: Sat May 03, 2008 2:27 pm
by Charles
Applied. Thanks.