--
You received this message because you are subscribed to the Google Groups "Dart Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to core-dev+u...@dartlang.org.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
whileObject
automatically gets one that returnsfalse
var {
a : int;
b : String;
}
var {
a: int;
b: String;
}
final {
c: num;
d: bol;
}
var a: int;
Reified genericsI don't know the consequences but since Patrice explained to me that `<TypeA,TypeB>{}` is not the same than `new Map<TypeA,TypeB>()` I don't like reified generics much.
Type testswhileObject
automatically gets one that returnsfalse
I would expect object always to return `true` not `false`
Type annotations on the rightI'm not used to this style (never really developed in a language with this style)I feels quite cumbersome. Especially that `var` is necessary in addition to the type everywhere.Something like
var {
a : int;
b : String;
}would easy this pain a lot.
This might even be a solution for (or instead of) final by default
var {
a: int;
b: String;
}
final {
c: num;
d: bol;
}
This is meant in addition to
var a: int;not instead of.
+10 Constructor initialization listsfor moving `super` into the constructor block and treat the statements before `super` like the initializer list but more powerful.
Uniformity of referenceI guess this would be harder to swallow than type annotations on the right.How to differentiate between calling a function referenced by a field and getting the reference to the function?
+1 Removing newI don't care too much, but I find it often cumbersome to differentiate between static methods returning an instance and (factory) constructors.If `const` goes away `new` definitely has to go as well.
Sounds to me mostly as a change for the sake of not looking to Java-like. Couldn't the function type be expressed like such?
class Observable { void() observer; }
--
You received this message because you are subscribed to the Google Groups "Dart Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to core-dev+u...@dartlang.org.
On Fri, Sep 4, 2015 at 10:09 AM, Günter Zöchbauer <gzo...@gmail.com> wrote:Reified genericsI don't know the consequences but since Patrice explained to me that `<TypeA,TypeB>{}` is not the same than `new Map<TypeA,TypeB>()` I don't like reified generics much.I would like to see that explanation - it should be exactly the same.
Type testswhileObject
automatically gets one that returnsfalse
I would expect object always to return `true` not `false`If the "is" method is on the object and takes the type as argument, thenthe default method should use the type of the current object and see if it implements the type represented by the argument. It should neither return always true or always false.
class SomeClass {
SomeClass() {
// initalize finals here;
}
super() {
// further initialization
}
}
Uniformity of referenceI guess this would be harder to swallow than type annotations on the right.How to differentiate between calling a function referenced by a field and getting the reference to the function?Good point. If the "()" is optional, then you can call a nullary function both as a getter "x.foo" and as a function "x.foo()". That means you have two ways to write the same thing, which is not great. It makes "x.foo()" ambiguous - is it calling a nullary function with no arguments and then calling the result, or is it just calling a nullary function.It'll likely be disambiguated to mean calling the method with no arguments, and then you have to write (x.foo)() to call the result of a getter.
Also, should you be allowed to pass zero arguments to a getter?+1 Removing newI don't care too much, but I find it often cumbersome to differentiate between static methods returning an instance and (factory) constructors.If `const` goes away `new` definitely has to go as well.+5.It's still not perfect - a generative constructor is different from any other member because it's necessary for extending a class.Maybe we should drop "extends" from the language, and replace it with auto-delegation.Instead of "class C extends D { something(); }" you do:class C implements D as _d {final D _d;something();}which automatically adds delegates for all members on D to call the same method on _d.Then you don't need to have publicly visible generative constructors at all.
Type annotations on the right
I think that if Dart 2.0 would go in that direction, would the ":" really be needed? I know Go is a different language in many ways but it works for them...Yes, I do understand that it's easier to parse of course, but I feel that it could be parsed without the ":" as well... I can see that the "function as a variable" example might benefit from the ":" for better readability, but for variables (that are way more common), I find it somewhat in the way. It looks almost cumbersome to add types because of the extra typing, I might grow to like it, I don't know, but I don't really like looking at it right now..I would not go as far as to say that I "HATE HATE HATE this" hehe, but I agree that it does look almost plain weird for normal vars and I think it would be off putting to a lot of devs... Some of you core language people might not really see this as you guys have seen so many different syntaxes, it's not that different if you have seen it before yourself, but lots of devs have never ever seen this type of syntax, where as I feel "just moving the type to the right" is a lot less unfamiliar. Sure any dev could get used to it, but Dart right now wants to add lots of new users not just adapt the existing ones...
As alternatives, while still keeping type annotations on the right (I think that alone is okay) I can think of three different ways to do it:1. Simply remove the ":"2. Make the ":" optional, then it can be added where needed for readability (like the function case) but not for simple String and int vars3. Make the ":" required only for function variables, I know adding special cases might not be the "right way" in some sense, but it could maybe be a compromise worth doing in this case
Something that was not mentioned in this meeting but that I read about earlier, was the idea of maybe making ";" optional. I think it was Bob that said basically that removing them completely might be a too big breaking change, but making them optional could be done since existing code would not break.I feel that there are a lot of similarities between the existing use of ";" and the proposed used of ":". It feels like both are added mostly to make parsing easier, while the truth is that the code could still be parsed quite good without them. I might be wrong, but it almost feel like a premature optimization considering how fast computers are today (no offense intended, I do way too much premature optimization myself as well).I think the idea of making both ";" and ":" optional could be worth considering as it would be simple to explain and understand... You can add them if you want for readability where needed or simply not use them at all. I understand the drawback of making something optional, it's not as "clean", but in this case I feel the compromise might be worth more to existing and new Dart developers.Removing newYes, I was previously against this but after thinking some more and looking at examples I have switched over to the "yes camp". I now feel it would be a nice change if it was removed.
On Thursday, September 3, 2015 at 11:08:22 PM UTC+2, Bob wrote:
On Friday, September 4, 2015 at 10:35:43 AM UTC+2, Lasse Reichstein Holst Nielsen wrote:On Fri, Sep 4, 2015 at 10:09 AM, Günter Zöchbauer <gzo...@gmail.com> wrote:Reified genericsI don't know the consequences but since Patrice explained to me that `<TypeA,TypeB>{}` is not the same than `new Map<TypeA,TypeB>()` I don't like reified generics much.I would like to see that explanation - it should be exactly the same.It's quite some time back, I guess it was a discussion on some Angular issue.AFAIR he mentioned `<TypeA,TypeB>{}` doesn't doesn't reify generic arguments. If you say it's the same I believe you of course ;-) and will have a better rest at night from now on.
Map<A,B> m = {}
Map<A,B> m = <A,B>{}
Maybe we should drop "extends" from the language, and replace it with auto-delegation.Instead of "class C extends D { something(); }" you do:class C implements D as _d {final D _d;something();}which automatically adds delegates for all members on D to call the same method on _d.Then you don't need to have publicly visible generative constructors at all.
... I was quite confused about Dart type annotations back then - even more than now ;-)
Thanks for clarification and sorry for accusing you of making invalid statements!
--
You received this message because you are subscribed to the Google Groups "Dart Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to core-dev+u...@dartlang.org.
// normal return
return 'foo';
// non-local return
^return 'foo';
More useful Enums (by which I mean ability to add values like print(myEnum.ThirdPlanet); //earth
Swift's code looks cleaner than Dart's and avoids clutter. Notably, it avoids semi-colons and doesn't use round brackets in for loops, switch statements and if blocks. Swift also has some nice syntax sugar e.g. you can say "for n in 0..<10 {" which in Dart is "for (int n=0;n<10;n++) {"Any chance of some of that goodness?
> "for n in 0..<10"
Why not justfor (int n<10) {...}The case is very common; if something deserves special syntax, this is the first candidate. Will become an instant hit.
Current syntax (borrowed all the way from C) is error-prone, especially if you have nested "for" loops: you copy&paste the first one and forget to change i to j somewhere.When you (rarely) need a general case, use full syntax - it will also serve as indication that something unusual is going on here.
WRT "parts": FWIW, I think the problem was originally misdiagnosed. Access to private variables of another library is often necessary. "part" feature tries to address this, but it's too restrictive, so it doesn't really solve the problem.When libraries x and y reside in the same package, there's no justification for imposing draconian restrictions on what each of them can see in a sibling library.Maybe this should require special "show" clause in import statement like:import "my_sibling.dart" show _foo,_barBTW, we discussed this problem a couple of times on this forum already. Some ugly workarounds were mentioned as possible solutions..
> Dart doesn't have a notion of "package", "package" is from pub instead.
Effectively, there's a notion of package anyway. E.g. latest proposal on "packages" config deals with instructions to compiler on how to locate ... what?.
On Sun, Sep 13, 2015 at 5:56 PM, tatumizer-v0.2 <tatu...@gmail.com> wrote:> Dart doesn't have a notion of "package", "package" is from pub instead.Effectively, there's a notion of package anyway. E.g. latest proposal on "packages" config deals with instructions to compiler on how to locate ... what?.Dart doesn't have the notion of "same package". It resolves package: URIs to something and loads the individual libraries, but it doesn't have a concept of things being in the same package or not. That is, it doesn't know what "a package" is, just that there is "something package related" that it can load.It's not hard to add - it's just checking whether the first path segment is the same - so if it makes sense to add some kind of "package privacy" to Dart, then it's definitely doable. It's just not necessarily a very good design since it only works for packages, it depends on *how* a file is imported (using a file: reference to a Dart file instead of a package: reference would make things break?), and not all Dart files come from packages (for example the dart: platform libraries don't).A shared private namespace might make sense, but I don't think only applying it to packages is a good idea./L 'And I want "protected" first!'
+1 for @protected and @private annotations, not a fan of the "_" for private variables.
Does Dart currently have any notion of protected variables / way to simulate protected variables?
On Sat, 19 Sep 2015 at 06:57 George Moschovitis <george.mo...@gmail.com> wrote:
While we are talking about Dart 2.0 stuff, how about adding a @protected (and @private instead of '_') annotation, honored by DartAnalyzer etc?
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Unless the @private annotation is just a transformer converting @private test; to _test, then there's only a penalty at compile time.
Here's my notes from this week's now hour long meeting:I mention this in the notes, but I want to call it out here. We're starting to discuss this vague notion of "Dart 2.0". We don't know what that means yet, and that means we'll be talking about all kinds of crazy radical ideas which may or may not come to pass.
--
You received this message because you are subscribed to the Google Groups "Dart Core Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to core-dev+u...@dartlang.org.
It's important to note that the C# design team is still in charge of the language. This is not a democratic process. We derive immense value from comments and UserVoice votes, but in the end the governance model for C# is benevolent dictatorship. We think design in a small close-knit group where membership is long-term is the right model for ensuring that C# remains tasteful, consistent, not too big and generally not "designed by committee".