I believe the answer is no, but wouldn't hurt to check: anything in Scala that's equivalent to C#'s dynamic
keyword? Anything on the horizon?
I know about scala.Dynamic, which is not the same thing - in C# you don't know the types at compile time, and the dynamic type propagates.
I also know about invokedynamic, which is not the same thing - invokedynamic is the infrastructure that would make language constructs like dynamic
performant.
Anything on the horizon?
Any is the supertype of all types, also called the top type. It defines certain universal methods such as equals , hashCode , and toString . Any has two direct subclasses: AnyVal and AnyRef . AnyVal represents value types.
: _* is a special instance of type ascription which tells the compiler to treat a single argument of a sequence type as a variable argument sequence, i.e. varargs.
Use the with Keyword in ScalaThis keyword is usually used when dealing with class compositions with mixins. Mixins are traits that are used to compose a class. This is somewhat similar to a Java class that can implement an interface.
Any has two direct subclasses: AnyVal and AnyRef. AnyVal represents value types. There are nine predefined value types and they are non-nullable: Double, Float, Long, Int, Short, Byte, Char, Unit, and Boolean. AnyRef represents reference types.
Yes there is: objects extending the Dynamic trait behave similarly to variables declared as dynamic in C#.
This is a new feature in Scala 2.9 (but still considered experimental), see the scaladoc at http://www.scala-lang.org/api/current/index.html#scala.Dynamic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With