class M: C {
func test(x: A) {}
}
there's no "override" keyword, so I think you're overloading.
C. Keith Ray
https://leanpub.com/wepntk <- buy my book?
http://agilesolutionspace.blogspot.com/
twitter: @ckeithray
http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
> On Jan 17,
people may want digits as characters in order to see zeros. parsing phone
numbers and social security numbers need zeros.
C. Keith Ray
https://leanpub.com/wepntk <- buy my book?
http://agilesolutionspace.blogspot.com/
twitter: @ckeithray
Could someone measure how bad the "random(32 bits) mod m" problem actually is?
It's prominent when the number of bits is close to m, eg 4 bits and m == 3. Is
it bad when bits == 32 and m is less than 2^16? Or bits == 64 and m is less
than 2^32?
C. Keith Ray
https://leanpub.com/wepntk <- buy my
(I know isTrue is redundant. I only considered it for symmetry.)
> On Jan 13, 2018, at 11:09 AM, C. Keith Ray wrote:
>
> If you would like something better than "== false" I suggest adding computed
> properties 'isTrue' and 'isFalse' to Boolean.
>
>
>> On Jan 13, 2018, at
If you would like something better than "== false" I suggest adding computed
properties 'isTrue' and 'isFalse' to Boolean.
> On Jan 13, 2018, at 11:06 AM, Karl Wagner via swift-evolution
> wrote:
>
>
>
>> On 12. Jan 2018, at 20:54, Alejandro Martinez via
That looks great. One thing I would look for is iterating over multiple matches
in a string. I'd want to see lazy and non-lazy sequences.
let wordMatcher = Regex(":w*") // or whatever matches word-characters
// separated by non-word character.
for w in aString[allMatches:
Simple is better. Int indexes, please.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
* http://agilesolutionspace.blogspot.com/
> On Jan 10, 2018, at 10:44 AM, Karl Wagner via swift-evolution
>
in https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438
there is this statement:
"For this reason, the compiler only permits conformance of this protocol on the
original type definition, not extensions"
and this example:
extension JSON : DynamicMemberLookupProtocol {
You can create a binary operator that tests the left-hand operand for nil, and
passes the unwrapped value to the right-hand operand (a function taking one
value), this operator can be made left-associative to allow chaining.
let m = String(contentsOfFile: "README.md") ??? Markdown
where ??? is
I agree.
Instead of a magic protocol, think I'd rather see "@dynamic" used like "@objc"
is today. Maybe only applicable to class declarations.
Implicitly unwrapped sounds reasonable... need to think on that some more.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
*
ote:
>
>
>> Le 7 déc. 2017 à 16:33, C. Keith Ray via swift-evolution
>> <swift-evolution@swift.org> a écrit :
>>
>> Let's see what disasters were created by people abusing NSProxy, the ObjC
>> moral equivalent of a dynamic member lookup type.
>>
Let's see what disasters were created by people abusing NSProxy, the ObjC moral
equivalent of a dynamic member lookup type.
I'm not aware of anything.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
*
static type checking is no guarantee of program correctness.
you can take a correct, functioning program in Java, for example, strip out all
the type declarations and change the syntax to Groovy, and still have a
correct, functioning program.
(if you avoid methods overloaded on parameter
BTW, Java via JNI would be another good application of this proposal. I once
used a JNI wrapper library in C++ and it was pretty hairy and tedious.
I think we might want to declare a "Python object" as implementing swift
protocols. If the methods that implement a protocol are NOT implemented in
Not everyone uses the IDE as a crutch for writing code. As someone who has used
many languages, editors, and operating systems, I don't rely on autocomplete
and sometimes turn it off because it gets in my way.
my experience with C# was sometimes frustrating because it could be hard to
find the
> Yes, IMO such code should be second class citizen in Swift.
Just have the compiler emit "your code is bad and you should be ashamed of it."
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
*
I *don't* want dynamic calls to stand out. I want seamless interoperability.
let arrayOfDogs = [ Python.Module(dog).Dog("Brianna"),
Python.Module(dog).Dog("Kevin") ] // Swift array of Python objects
let b = arrayOfDogs.sorted() // use Swift 'sort' function on Python objects
(invoking Python '<'
Should we compare dynamic member lookup to Microsoft's DLR ?
https://docs.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/dynamic-language-runtime-overview
Quote:
The dynamic language runtime (DLR) is a runtime environment that adds a set of
services for dynamic languages to the
> On Nov 12, 2017, at 10:54 AM, Paul Cantrell via swift-evolution
> wrote:
>
>
>> On Nov 11, 2017, at 8:35 AM, Gwendal Roué via swift-evolution
>> wrote:
>>
>> I'd suggest `compactMap` as an alternative name, should `filterMap` find
> Another option that reads nicely IMHO is
>
> func fn(param: T) throws -> T where T : Equatable [foo, bar] { … }
>
I changed my mind. Putting the capture list just before { } is where I'd rather
see it.
> I think #4 is ambiguous with array literals unfortunately.
>
> Perhaps this proposal
I'd vote for # 1
Starting with "func" helps signal that the context is a function. (Though I
know some things can precede "func".)
Having the function name second is important to me: you don't have to scan
further for its name.
Template arguments seem more important than capture lists, so
how does c code (and Python code, etc, other than ObjC) call Swift functions,
methods, etc?
C. Keith Ray
https://leanpub.com/wepntk <- buy my book?
http://agilesolutionspace.blogspot.com/
twitter: @ckeithray
http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
> On Nov 11, 2017, at
utionspace.blogspot.com/
> On Nov 3, 2017, at 8:33 AM, C. Keith Ray via swift-evolution
> <swift-evolution@swift.org> wrote:
>
> If protocols can (1) store data (2) implement methods (3) force "subclasses"
> to implement methods, then I'm ok that it isn't spelled &q
If protocols can (1) store data (2) implement methods (3) force "subclasses" to
implement methods, then I'm ok that it isn't spelled "abstract". And yes, I
know 2 and 3 done.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
*
, particularly around metatypes and
> constructors, because now we have this new concept of a class that cannot be
> directly instantiated. I’m not sure the cost is worth the benefit.
>
> Slava
>
>> On Nov 2, 2017, at 12:45 PM, C. Keith Ray via swift-evolution
>> &l
How many "subclass must override" assertions or comments in base class methods
do we need to see, to want to add "abstract" to the Swift language? 5? 50? 500?
It's a not uncommon idiom in Objective-C.
I'm about to port a substantial amount of C++ code to swift, and compiler help
to enforce
Access levels are not a security mechanism. You have to trust your (fellow)
programmers. Lots of good software has been created in Smalltalk and other
languages without "private" access levels.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
*
There's surprisingly little information about Cython interoperability with
Cocoa/Mac applications. It's might be linkable if the app can embed Python.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
*
It would be really nice if Cython code could be linked into iOS and Mac apps
written in Swift or Objective-C.
http://cython.org
--
C. Keith Ray
Senior Software Engineer / Trainer / Agile Coach
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
> On Oct 29, 2017, at 1:34 PM,
is there a roadmap for strings + unicode in swift 5?
will unicode normalization and other functionality be available in the standard
library?
https://docs.oracle.com/javase/8/docs/api/java/text/Normalizer.html
https://www.unicode.org/reports/tr31/
http://www.unicode.org/reports/tr44/
> On Oct 28, 2017, at 1:47 AM, Tino Heth via swift-evolution
> wrote:
>
> How about
> func localFunc[weak self](input: Double) {
> }
> ?
> Seems to be the obvious choice for me...
+1
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
*
class A {
func foo() -> ()->String {
func local() -> String { [weak self] in
return "foo \(self.i)"
}
return local
}
...
compares well with this...
class A {
func foo() -> ()->String {
let local : () -> String = { [weak self] in
Why not use an equals Implementation that doesn't rely on order?
Something like this (which doesn't compile in my iPad playground). If two sets
have the same number of elements, and every element in one can be found in the
other, they are equal, otherwise they are not equal.
protocol Set {
+1 to "discardable" or "@discardable" next to the result type.
] A simple “discardable” would be great. If the result is Bool and
] “discardable” is placed right in front of it, it’s not only more readable
] but also eliminates the redundant word “Result”. Also no at sign is great.
--
C. Keith
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html
Says...
"Alternatively, you can mark an extension with an explicit access-level
modifier (for example, private extension) to set a new default access level for
all members
35 matches
Mail list logo