Forums

Enum

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

Enum

Postby relez » Sun Sep 14, 2008 8:08 am

I wrote a very silly program, playing with enums

Code: Select all
class Program
   enum Numeri
      uno
      due
      tre
   
   def main is shared
      print Numeri.uno
      print Numeri.due


the ouput is:

Uno
Due

it seems a bit strange... i never wrote "Uno" or "Due" but "uno" and "due"... why those capital letters?
relez
 
Posts: 69

Re: Enum

Postby Charles » Sun Sep 14, 2008 9:32 am

Cobra is capitalizing underlying members of types such as classes, structs, etc. so that any class libraries you create in Cobra will be friendly to C# developers (and to some extent, VB). Looks like enums are getting the same capitalization. Perhaps they should be left out.

Btw are you using the last Cobra release (0.8) or building out of source? Just curious.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Enum

Postby relez » Sun Sep 14, 2008 10:17 am

Hi Chuck, i suspected something like this.... It is a good idea, i believe enum can be treated the same way
i'm using 0.8 version.
relez
 
Posts: 69


Return to Discussion

Who is online

Users browsing this forum: No registered users and 43 guests

cron