76

Re: Bucket

_> 1. Cutoffs and ranges are not present. Certainly without them it is possible to manage (that you and showed), Mlja, me even was necessary to climb in docks to look as limit is called is perfectly shows a demand of constant cutoffs. _> but after all we here speak about convenience of language, is not simple about possibility to solve the task. It means that developers of language know, how it is used, unlike Swift in which  that recalled all. _> 2. Normal initialization of the dictionary too is not present is a type it is necessary to consider as hands commas not to be mistaken and to transfer a key instead of value? There parameters typified so the confusion could arise only in case of identical types of a key and value. Well and I simply wanted to use standard library. And so there is a heap  builder.put (.).put (.).build _> 3." 42.f ()?.g (40)?.h () "). Similar that map' the problem does not dare... Extension methods are not present. But the problem perfectly dares on map. I entered these functions only for example playback. In real life I would write System.out.println (_try (()-> of (42).map (i-> {if (i <0) throw new IllegalArgumentException (); else return i;} wink.flatMap (i-> i <40? empty (): of (i-40)).map (i-> i / 2))); Give now we compare that I will select Java: users.stream ().filter (user-> user.name.length () <5) Swift: users.filter {$0.name.length () <5} It of that for $0 the such? Java: users.stream ().map (this:: loadPostsFromInternet).parallel () Swift: how it to make? _> orientations of world JVM on  programmers. Oh these . Mind suffices to be measured only by complexity of languages, instead of an amount and complexity of the implemented projects.

77

Re: Bucket

B> Give now it is compared that I will select B> Java: users.stream ().filter (user-> user.name.length () <5) B> Swift: users.filter {$0.name.length () <5} B> It of that for $0 the such? B> Java: users.stream ().map (this:: loadPostsFromInternet).parallel () B> Swift: how it to make? And in  SortedSet <String> s = new TreeSet ();//how to create ordered set in Swift? s.stream ().skip (s.size ()/4).limit (s.zize ()/2)//took from ordered set the middle. How we remember, in Swift what magic cutoffs - the code can show?

78

Re: Bucket

Hello, bzig, you wrote: _>> 1. Cutoffs and ranges are not present. Certainly without them it is possible to manage (that you and showed), B> Mlja, me even was necessary to climb in docks to look as limit is called is perfectly shows a demand of constant cutoffs. Well as time because it is inconvenient in such type (without sugar in language) therefore do not use especially. By the way, from what you took, what they constant is mandatory?))) _>> 3." 42.f ()?.g (40)?.h () "). Similar that map' the problem does not dare... B> Extension methods are not present. But the problem perfectly dares on map. I entered these functions only for example playback. In real life I would write You probably at all did not understand about what speech and what real task modelled my example (and for what this mechanism in Swift and some other languages works). It was simple me laziness to write down long formal introduction and on it I wrote down through Int and extensions. But time you did not understand, it is necessary to spend superfluous time and to write down completely. Means in a reality very often there is a situation of this kind: struct F {var d: Int func f () throws-> G {if (d <0) {throw Errors. Error} return G (d: Double (self.d))}} struct G {var d: Double func g (p: Double)-> H? {if (d <p) {return nil} return H (d:" \(self.d/p) ")}} struct H {var d: String func h ()-> String {return" result:" +d}} Which solve without sugar for options somehow so: var x: String? do {let f=F (d: 2) let g=try f.f () let h=g.g (2.0) if (h! = nil) {x=h!.h ()}} catch {} On Java it naturally registers in the same way. And here if to use considered conveniences similar on Swift it is possible to write down so: let x = (try? F (d: 2).f ())?.g (2.0)?.h () And what analog on Java (you will be wrote, what all similar sugar is present)? B> Give now it is compared that I will select B> Java: users.stream ().filter (user-> user.name.length () <5) B> Swift: users.filter {$0.name.length () <5} B> It of that for $0 the such? Well it at you only from ignorance such questions. That you wrote is short form, with anonymous argument. But if it is not pleasant to you (though, apparently from your example, it it is ready  Java an example) you can easily write exact copy Java of expression: users.filter {user in user.name.length () <5} And still you can at desire (strange enough) to write down the fullest form of a lambda, with the full information on types: users.filter ({(user: User)-> Boolean in user.name.length () <5}) B> Java: users.stream ().map (this:: loadPostsFromInternet).parallel () B> Swift: how it to make? , you want to translate comparing of languages from convenience of their syntax to what possibilities are in their libraries?) it certainly is rather favourable from the point of view of Java since she just tries to correct the ancient syntax various bulky library decisions. But the set example generally ridiculous - you really consider, what in Swift' multisequencing of tasks is inaccessible?) )) Truth here it has no (and can and has, I am simple not in course, but like I do not remember such) some special syntactic sugar, and is set precisely as and in Java, in libraries. _>> orientations of world JVM on  programmers. B> oh these . Mind suffices to be measured only by complexity of languages, instead of an amount and complexity of the implemented projects. With the registration of that actually JVM (I mean HotSpot) is written on a C ++, it sounds especially juicy. Yes, and by the way, and and here actually a C ++? Like here it was considered Java and Scala? Here it is eternal in all subjects of a C ++ drag, and then still tell that I began it...

79

Re: Bucket