Forums

capitalized member names

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

capitalized member names

Postby neuruss » Tue Feb 12, 2008 7:17 pm

I tried using a cobra .dll from C# and Boo.
It works great, except for a little problem:

If I instantiate a class that has a member called "name", when used from C# I must use it capitalized ("Name").
Otherwise it is not recognized.
When used from Boo, I get this error:

"'name' is not a member of 'Dude'. Did you mean 'Name' ? (BCE0019)"

neuruss
neuruss
 
Posts: 23

Re: capitalized member names

Postby Charles » Tue Feb 12, 2008 8:06 pm

This is normal.

C# programmers will expect that member names are capitalized. For example, a C# programmer will write "someList.Count" and "Console.WriteLine(...)". So in order that your Cobra libraries can be comfortably consumed by C# programmers, Cobra capitalizes the underlying members. When using the same DLL from Cobra, you would still start with lowercase. And I guess from VB, you could start with anything.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: capitalized member names

Postby AlGonzalez » Tue Feb 12, 2008 11:45 pm

Am I correct to assume that enumerations will always be PascalCased?

# .None is PascalCased because it is an enumeration 
.formBorderStyle = FormBorderStyle.None
# .black is camelCased because it is a class
.backColor = Color.black
AlGonzalez
 
Posts: 13
Location: Greenville, SC - USA

Re: capitalized member names

Postby Charles » Wed Feb 13, 2008 12:11 am

Yep.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 109 guests

cron