You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exponentiation operator, **, would be an infix, right-associative operator (operator **(arg)) with a precedence just stronger than the multiplicative operators. It would be user-implementable, and implemented by num.
It would be hard to type in a useful way, because unlike other arithmetic operators, we can't special case int ** int to have static type int. That's only true if the exponent is non-negative.
The slice operator would be a new ternary suffix operator, operator [:]([arg1, arg2). It would probably also have a slice-set operator operator [:]=(arg1, arg2, value). The calling convention would be that arg1 and arg2must be nullable, because they can be omitted, or only make them omitable if they are nullable. (Making them optional works badly, unless we make the named, and that's very different than other operators).
Then x[:] would pass null for both parameters, x[1:] would pass null for the second parameter and x[:4] would pass null for the first parameter.
I'm not sure that function belongs in the platform libraries. Console input is not something that you will use in any real program (it's a really horrible UI), so it'd just be there for people learning Dart. I'd probably prefer to make dartpad.dev easier to use instead.
Dart is pretty simple, but there are a few additions that ould be nade to dart core.
The text was updated successfully, but these errors were encountered: