Forums

Invalid expression term "char"

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

Invalid expression term "char"

Postby torial » Thu Dec 15, 2011 11:06 pm

I realize this may be simple and I'm overlooking something. But when I use the following code:

Code: Select all
if char.isLetterOrDigit(key) or key == c'_'
        return CompletionDataProviderKeyResult.NormalKey


I get error:
Invalid expression term "char"


Any pointers?
torial
 
Posts: 229
Location: IA

Re: Invalid expression term "char"

Postby Charles » Fri Dec 16, 2011 1:12 pm

Cobra tries to be more OOP-ish in the Smalltalk vein rather than in the Java "static methods everywhere" vein. Try:

... key.isLetterOrDigit ...

See PrimitiveTypeMembers

This looks like an opportunity for one of those nice error messages that tells you straight away what's expected.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 47 guests

cron