def hello(world:String):String
fun hello(world: String): String {
fun String.myExt(whatever: Class) {
def String.myExt(whatever:Class):void
The syntax I've be mooting is kind of like Ruby's refinements. It allows one extension to extend multiple types. I'm not super attached to it, but it's the one I like most of the ones I've come up with so far.
The separate jar works by allowing you to have it be a mirahc compile time dependency, but not a javac or runtime dependency. It's ok for the annotations to be in the runtime class path though, because they have the compile time flag set and are ignored by the jvm runtime.
As far as package access goes, I've been thinking it'd be nice to have something like Scala's package.scala files where default imports for a package could be defined. Package level extension usage could be setup there.
On initializers that set ivars like that, my feelings are mixed. I think if you have a large number of fields in an object, its construction should start to feel awkward because that's a sign that the class has too many responsibilities.
On the other hand, it'd be really cool if making struct-like classes were easier. I'm not sure whether that should be in mirahc, or in a library. It should be doable using macros without changing the compiler itself.
--
You received this message because you are subscribed to the Google Groups "The Mirah Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirah+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On the other hand, it'd be really cool if making struct-like classes were easier. I'm not sure whether that should be in mirahc, or in a library. It should be doable using macros without changing the compiler itself.
Value objects are a good vote in favor of creating a syntax and implementation in the compiler itself, because then we could intrinsify them as native value objects on the jvm if you target one that supports it.
What should they look like?
--