jonathandavid wrote:Chuck wrote:-- Entering more tickets (feel free to enter those we have discussed).
Yes, I'll add a couple of them as soon as I have some spare time.
Chuck wrote:-- Marking which tickets are crucial for Cobra 0.9.
Is there a way to so from the Trac interface?
Yeah, I've already set up the milestone called
"Cobra 0.9", but all the tickets are not in. It's not obvious because they call the link "Roadmap".
Chuck wrote:Axing the "is shared" requirement of "def main". (It's making my mind itch.
)
jonathandavid wrote:May I suggest we change main to be a cue? This way it is more clear that we are not defining a regular method, but one with special meaning (entry point) and with some compiler magic going on under the hoods ("is shared" by default, command line args implicit).
The command line args are not implicit. If you don't define the args there are no args except through CobraCore.commandLineArgs (and Environment.something). Also, the "is shared" won't be added--your .main will still be an instance method. Instead, Cobra will create a separate class with main() that conforms to the virtual machine and calls yours. JVM, for example, is much more strict about the declaration, so this treatment is necessary if we continue to support no return type vs. int return type and args vs. no args.
Nevertheless, I've considered "cue main" but have not decided.
jonathandavid wrote:class Program
cue main # "cue" indicates clearly that this is a special method
pass
Chuck wrote:-- That contract problem with invariants and derived classes. Still banging on a SmartEiffel sample to investigate how they treat the situation.
I've installed Nemerle, they have contracts as well (the semantics are based on Spec#, or so they say). I'll write a test program to see how they deal with invariants and derived classes as soon as I can. By the way, I like the way Nemerle deals with mutability. By default, Nemerle's variables are immutable (equivalent to C# readonly variables). You have to explicitly declare them as mutable in order to modify them after they're initialized). I think this makes code more clear and readable.
Let me know as soon as your test is done.
Nemerle's immutable default has to do with it being a functional language. I'm not planning on immutable as the default in Cobra which is more in the vein of Python and C# and less in the vein of Haskell et al.
jonathandavid wrote:Nemerle also has inference of the return type for private methods and anonymous methods, which its also a nice feature (they don't provide type inference in public and protected methods because they say it's a bad thing, which I agree with). Any chance we'll get that in Cobra someday?
Regards,
Manuel
I agree with them on "no inferred return type" on the public and protected. And yes, to inference on the anonymous. It's not clear to me that private methods should have inferred return types. You could argue for it because the method is not externally used outside that class, or you could argue against it for the sake of consistency and in the context of partial classes. When writing one of the partials, you may feel like a consumer of the main class declaration similar to when subclassing.
I favor leaving any "def foo" methods as requiring an explicit return type.