353 karma · joined February 8, 2013
Exactly which statements should be included (certainly if and switch, any others)?
Further, it is important to consider whether the code written using this will actually be better than the code written with these things as statements. For example, the “switch” blocks tend to be very large, and turning them into expressions encourages additional indentation. Swift already allows ‘let’ values to be initialized on multiple paths, so is the win actually that great?
Given that statements-as-expressions would provide another way to do things (they are a purely syntax extension) the barrier should high to add them. They will add complexity and surface area to the language, so they need to pay that complexity.
[0] https://lists.swift.org/pipermail/swift-evolution/2015-Decem...
[1]: https://gist.github.com/jayrhynas/49945331e41314fc3ede
Edit: I just realized that with this method, the protocol extension is useless, you could just define `move` on Robot. So protocol extensions can give you a mix of abstract & default methods but if you need to inherit state you need to use a base class.
class SunnyRobot : Robot {
func gas() { ... }
func findSun() { ... }
}> Note: We should not use this way in the real development, because it is a reference to a local object. Here just show how to make RVO happened.
[1]: http://git.io/hFmk
The problem isn't producing output for another program, but relying on that other problem to catch your mistakes
Edit: it will use the local user.email if that is set. It also will use the GIT_AUTHOR_EMAIL but only as a fallback if user.email is unset
[1] http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=99042...
1. Return type is `instancetype` or `MyClassName *`
2. Method takes at least one argument
3. Method name starts with a "class suffix"; that is, a suffix of the class name, with the restriction that you can't have partial words. The first letter may optionally be lower case.
The class suffix (optionally followed by "With" like in the `initWith` conversion) is stripped off and the rest of the method name is used for the first parameter, with the first letter lower-cased.
For example, the following conversions apply:
+[MyClassName myClassNameWithObject:obj] -> MyClassName(object: obj)
+[MyClassName classNameWithObject:obj] -> MyClassName(object: obj)
+[MyClassName nameObject:obj] -> MyClassName(object: obj);
However, since those all map to the same swift initializer, only one will be available (generally the first one declared)In terms of sharing, Facebook definitely isn't required - you can email the song to your friends or you can upload it to our Discover service and share the link.