|
Re: syntax questions: msg#00030lang.scala
Jason Kinzer <jmkinzer@xxxxxxxxx> writes: > - It seems the lexer doesn't like access on the 'class' member (e.g. the > expression "Employee.class" yields the error "identifier expected but > 'class' found"). In my case this is an annoyance because a tool I'm using (a > lightweight ORM) requires the class name to be mentioned as part of it's > required metadata. Is this a bug or intended behavior? I don't believe you can do this right now. A possible workaround is: new Employee().getClass() Getting .class to work in a Java-like way has a problem in that Scala classes don't map to just one Java item. They map at least to a class and an interface, and sometimes more. On top of that, the mapping for CLR might or might not be the same. > - I'd love to see a builtin tuple syntax -- e.g. (x,y,z) instead of > Tuple3(x,y,z) for [de]constructors -- is that a remote possibility? As an ML > user, the former feels quite a bit more elegant... but I guess Scala's > probably not targeting my demographic quite as heavily, as say, Java users > ;-) Many people share your pain. I don't know if it's doable or not, e.g. if it would cause ambiguities elsewhere in the syntax. I've missed it too, though. -Lex |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | against the components utopia: 00030, Lex Spoon |
|---|---|
| Next by Date: | Re: Eclipse plugin... scala/java mixed: 00030, Sean McDirmid |
| Previous by Thread: | syntax questionsi: 00030, Jason Kinzer |
| Next by Thread: | self-referential static members: 00030, Jason Kinzer |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |