Page 1 of 1

capitalized member names

PostPosted: Tue Feb 12, 2008 7:17 pm
by neuruss
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

Re: capitalized member names

PostPosted: Tue Feb 12, 2008 8:06 pm
by Charles
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.

Re: capitalized member names

PostPosted: Tue Feb 12, 2008 11:45 pm
by AlGonzalez
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

Re: capitalized member names

PostPosted: Wed Feb 13, 2008 12:11 am
by Charles
Yep.