Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
The main aspect of CoffeeScript I'd like to see available also for Dart in form of a different, Dart-based language would be less verbosity, less brackets, less Java-style.
Does such solution exist ?
No.
If you don't want to have your field static you can omit the static keyword.
If you don't want to have your field final you can write var or a concrete type instead of the final keyword.
And if you don't want a loop you can omit for, while, forEach, ...
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
It's known, that when assigning an instance of structure to another instance, or passing it to a function, Swift essentially copies the instances by value. However I could not find anywhere if we actually have control over this process, like in C++ copy constructors. My question is whether Swift has analogue to C++ copy constructors and if not, are there anything in the language what helps to take control over passing-by-value process in Swift?
Copy constructors are implicit in Swift, and can't be user-customized.
They always copy all fields of a struct. For fields that are references to object, copying is defined as the increment of reference count (a retain).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I was thinking it would be useful if the property name clearly signaled it was readonly.
Take this object as an example:
{
"id":"12154",
"name":"some name",
"email":"email#something.com",
"joinDate":"05/04/2012"
}
id and joinDate are of course properties that are readonly and will not allow a change through a PUT/POST request. Is there some type of convention for marking these as such? I was thinking of doing this with underscores:
{
"_id":"12154",
"name":"some name",
"email":"email#something.com",
"_joinDate":"05/04/2012"
}
There is no naming convention for read-only properties in REST. You should, of course, feel free to establish whatever conventions you like for your own API. As Fiver said in his comment, you should make sure they are clearly documented, or your conventions will be some combination of (a) confusing, and (b) noise.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm looking for a list of methods that I can use on Array in Swift.
For example you can run isEmpty on an array, but I couldn't find a list of all methods.
For exmaple I couldn't find global functions like find in the formal documentation
When you cmd-click a built-in function or type Xcode displays a generated file with the entire contents of the module to which that function or type belongs. In this case, if you cmd-click a Swift type (like String) or function (like find), you can see the declarations for the entire Swift built-in library.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I understand these two methods are identical (one is defined in terms of the other) according to this previous question:
Scala Buffer: Size or Length?
But is there a reigning best practice or recommended convention? I can think of three options:
(1) Always use size
(2) Always use length
(3) Use size for all collections exception Array
I'm leaning towards (1) or (3). The rationale behind (3) is that these methods are inherited from Java. And in Java you'd be invoking collection.size() and array.length. The argument for (1) is that it builds on and simplifies (3). The argument for (2) I'm not really sure about.
They are the same. It makes no difference. Use whatever you want.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
If you start typing in Xcode something like [selfSpace you see something like this:
What I want now is instead of filtering the results by method names I want to type e.g. NSString and get all methods back that return NSString (like description in this example) or all properties that I can set with NSString.