Forums

long and short

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

long and short

Postby relez » Fri Sep 19, 2008 3:09 am

Is it impossible to define for example i as long o s as short?
As far as i know they are CLS compliant so there should be no problem.... but compiler is not of the same opinion... are these types unused in Cobra? Obvs. no problem but i am somewhat in trouble trying to understand the cooperation between Cobra e .Net ;)
Last edited by relez on Fri Sep 19, 2008 6:08 am, edited 1 time in total.
relez
 
Posts: 69

Re: long and short

Postby Charles » Fri Sep 19, 2008 5:54 am

Try:

int8, int16, int32, int64
uint8, uint16, uint32, uint64

int and uint default to int32 and uint32

I dislike standalone type names such as "short" and "long" because they are adjectives that could apply to other things like floating points, characters, pointers, etc. Also, the naming scheme above is easy to grow, e.g., int128 and uint128.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: long and short

Postby relez » Fri Sep 19, 2008 9:31 am

It sounds reasonable to me.
Thx.
relez
 
Posts: 69

Re: long and short

Postby relez » Fri Sep 19, 2008 10:05 am

Always speaking about types: why Byte begin with capital letter and so is Boolean? int, char, float ... lowercase...Byte, Boolean...uppercase.
I apologize if i am somewhat boring with uppercase-lowercase questions... :oops:
relez
 
Posts: 69

Re: long and short

Postby Charles » Fri Sep 19, 2008 1:04 pm

All the built-in types have corresponding structs in the System namespace which are capitalized. This is true of the other .NET languages as well.

You don't have to say Byte and Int64. You can say: int8, uint8, int64, bool, etc.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: long and short

Postby relez » Fri Sep 19, 2008 4:38 pm

of course.... :oops:
relez
 
Posts: 69

Re: long and short

Postby Charles » Fri Sep 19, 2008 7:06 pm

Hey, no problem. These are natural questions and will help others.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 127 guests

cron