Re: [swift-users] [swift-dev] how to write package.swift if i want to use dependency file in local?

2016-01-06 Thread Ankit Agarwal via swift-users
I am assuming by downloaded you meant Downloaded the zip from github. Suppose you have all three downloaded side by side some-dir ├── PlayingCard ├── FisherYates └── DeckOfPlayingCards since you downloaded as a zip and not cloned these directories will not be under git version control anymore. p

Re: [swift-users] Optionals and method overloading with Any

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 7:16 PM, Don Wills via swift-users > wrote: > > Swift method lookup obviously chose the second mth func if it exists, but why? >From the behavior here, it looks like the compiler is first looking for a >matching method, then if it can’t find one it unwraps the optional pa

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Brent Royal-Gordon via swift-users
> It would be interesting to see how far Swift’s syntax can be pushed to create > a cleaner syntax for queries. I’m thinking of C#’s LINQ, which is really > sweet. Some LINQ stuff can be replicated in Swift, I believe, but there are > parts of it that rely on a super-powerful C# feature where a

Re: [swift-users] Optionals and method overloading with Any

2016-01-06 Thread Joe Groff via swift-users
> On Jan 6, 2016, at 7:16 PM, Don Wills via swift-users > wrote: > > I really don't understand optionals. This code fails with "Call can throw, > but is not marked with try ..." on the program line:t1.mth("abc", s1); > > class Test { > private var s1 : String! > > func tst()

[swift-users] Optionals and method overloading with Any

2016-01-06 Thread Don Wills via swift-users
I really don't understand optionals. This code fails with "Call can throw, but is not marked with try ..." on the program line:t1.mth("abc", s1); class Test { private var s1 : String! func tst() { let t1 : Test1 = Test1() t1.mth("abc", s1)

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Erica Sadun via swift-users
With regard to bullet 3, playgrounds vastly improve performance when you move code into Sources: http://ericasadun.com/2015/03/16/swift-vroom-vroom-fast-playgrounds/ (but then you can't see the code or tweak it *in* the play

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Dru Satori via swift-users
Believe it or not, it is on my list of things to explore. I’ve already partially implemented a very rudimentary DataObject for hiding some of the medium lifting in PG (and TSQL, though it’s not public at this time). I’ve been poking at LINQ and thinking about possible ways to implement something

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 5:04 PM, Dru Satori wrote: > > Oh, on OS X, swift works fine with PostgreSQL and ODBC datasources via Obj-C > frameworks, that isn’t the challenge. It would be interesting to see how far Swift’s syntax can be pushed to create a cleaner syntax for queries. I’m thinking of

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Dru Satori via swift-users
Oh, on OS X, swift works fine with PostgreSQL and ODBC datasources via Obj-C frameworks, that isn’t the challenge. I’ve started porting both of those frameworks to Swift already. There are some ‘challenges’ that are slowing that process down, and even more so, there are some decisions to be ma

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Dave Fenton via swift-users
So far it seems to me that Swift is a powerful "c" type language that can also be used in a script-like way. Definitely a win. Hopefully as version 3 gets closer there will have emerged some useful pure swift modules for DB access (Oracle, SQL Server/MongoDB etc) as well as other middleware.

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Dru Satori via swift-users
I would argue that the language syntax is forgiving though, as my follow examples demonstrated. The funny thing, is that your point about minutes versus hours is the very reason BASIC came to be ( easier math language ). But I think to a degree, we are discussing semantics. It seems we agree on

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 4:27 PM, Dru Satori wrote: > > The thing that I see about Swift is that right now, today, on Linux or OS X, > if Swift is installed, I can open a terminal: > > Touch hello.swift > vim hello.swift > i > print("Hello Swift"); > Esc > :wq > swift hello.swift You can do tha

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Dru Satori via swift-users
Jens, Pretty sure that we aren’t far apart here, but it is more a matter of perspective. I should preface this next bit by the statement that I was heavily invested in personally in getting Mono running on OS X, and today, I consider it a steaming pile of dung for OS X development because somew

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 2:49 PM, Dru Satori wrote: > > It may use LLVM, but it is not a “C” style language, in fact, it feels more > like a scripting language than many languages at this level. I disagree. Scripting languages are pretty universally dynamically-typed, interpreted, and have no vis

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Dru Satori via swift-users
See, while discussing applicability to the Edu world, I think you can really dissect the languages themselves, and create compelling cases. The problem you guys have flipped this too, the business development world is a ton more complex. I love Swift as a language. I enjoy working with Xcode.

Re: [swift-users] Very unexpected automatic behaviour between StringLiteralConvertible and pattern matching!

2016-01-06 Thread Joe Groff via swift-users
> On Jan 6, 2016, at 2:31 PM, David Hart wrote: > > I can file those bugs. Would it be beneficial if I also created failing unit > tests? > David. Definitely. Thanks for uncovering these issues. -Joe ___ swift-users mailing list swift-users@swift.or

Re: [swift-users] Very unexpected automatic behaviour between StringLiteralConvertible and pattern matching!

2016-01-06 Thread David Hart via swift-users
I can file those bugs. Would it be beneficial if I also created failing unit tests? David. > On 06 Jan 2016, at 20:05, Joe Groff wrote: > >> >> On Jan 5, 2016, at 9:28 AM, David Hart via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> How is it that Swift allows code like this: >>

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 1:12 PM, Don Wills wrote: > > It also means that every third party API provider will *never* be able to > change any method signature from failable to non-failable or vice-versa. > That is a really bad thing! API consistency is a good thing. A method that can fail is fun

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Joe Groff via swift-users
> On Jan 6, 2016, at 1:12 PM, Don Wills via swift-users > wrote: > > >> On Jan 6, 2016, at 1:15 PM, Jens Alfke wrote: >> >> * The requirement of the ‘try’ prefix means that if a function that isn’t >> failable later gets modified to be failable, every call site will now >> trigger a compil

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Victor Guerra via swift-users
Thank you for sharing the playground Donald! Great stuff! On Wed, Jan 6, 2016 at 10:52 PM Donald Pinckney via swift-users < swift-users@swift.org> wrote: > Hi Erica, and others with feedback, > > Thanks for your positive feedback about my playground. Top of my list for > critical features would

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Donald Pinckney via swift-users
Hi Erica, and others with feedback, Thanks for your positive feedback about my playground. Top of my list for critical features would be what Loïc mentioned, some mathematical notation support inside the playground markdown. Currently I embedded PDFs which I rendered using LaTeX, but it would

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Greg Parker via swift-users
> On Jan 6, 2016, at 1:12 PM, Don Wills via swift-users > wrote: > >> On Jan 6, 2016, at 1:15 PM, Jens Alfke wrote: >> >> * The requirement of the ‘try’ prefix means that if a function that isn’t >> failable later gets modified to be failable, every call site will now >> trigger a compile e

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Don Wills via swift-users
> On Jan 6, 2016, at 1:15 PM, Jens Alfke wrote: > > * The requirement of the ‘try’ prefix means that if a function that isn’t > failable later gets modified to be failable, every call site will now trigger > a compile error due to the missing ‘try’ keyword. This means the programmer > who mad

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 11:40 AM, Jeremy Pereira via swift-users > wrote: > > In Swift, you throw errors, not exceptions. The word exception is (more or > less) reserved for conditions that terminate the process. > > There are no unchecked errors but then why would you not want to handle an >

Re: [swift-users] Binding NSTextField value to NSNumber

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 11:25 AM, Etan Kissling via swift-users > wrote: > > I now bind such en object to an NSObjectController, > and bind the value binding of an NSTextField to the object controller's > selection.someNumber key path. This is a Cocoa question, not a Swift question; a better pl

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 10:30 AM, Don Wills wrote: > > The cost of !, ? and ?? everywhere in the language is a huge coding and > maintenance inconvenience for the programmer error condition referencing a > variable that contains the value null. It’s not so much about null, as it is about whether

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jeremy Pereira via swift-users
> On 6 Jan 2016, at 18:30, Don Wills via swift-users > wrote: > > Points well taken. > >> On Jan 6, 2016, at 11:02 AM, Jens Alfke wrote: >> >> > > I didn't want to post a tome about String, but here's a basic list of > features/methods missing in String: > > 1. The lack a Character type

[swift-users] Binding NSTextField value to NSNumber

2016-01-06 Thread Etan Kissling via swift-users
Hey there, I have a model that contains an optional NSNumber. @objc(Model) final class Model : NSObject { dynamic var someNumber: NSNumber? } I now bind such en object to an NSObjectController, and bind the value binding of an NSTextField to the object controller's selection.someNumber key

Re: [swift-users] Very unexpected automatic behaviour between StringLiteralConvertible and pattern matching!

2016-01-06 Thread Joe Groff via swift-users
> On Jan 5, 2016, at 9:28 AM, David Hart via swift-users > wrote: > > How is it that Swift allows code like this: > > struct Sneaky: StringLiteralConvertible { > init(stringLiteral value: String) {} > init(extendedGraphemeClusterLiteral value: String) {} > init(unicodeScalarL

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 10:30 AM, Don Wills wrote: > > 1. The lack a Character type that are the constituent elements of a String > 2. Missing methods (Java names used): valueOf, charAt, trim(), length(), No offense, but it sounds like you haven’t read the justifications in the Swift book or on

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Erica Sadun via swift-users
Don, I love your playground. This highlights a few areas where I really would love to see some enhancements from the playground team. Here are a few off the top of my head. My actual list is longer: * Your students should be able to have an appropriate input and submission component that isn't

Re: [swift-users] Optionals inside Dictionary where Value = Any

2016-01-06 Thread Daniel Eggert via swift-users
> On 06 Jan 2016, at 12:20, Dmitri Gribenko wrote: > > On Wed, Jan 6, 2016 at 12:47 PM, Daniel Eggert via swift-users > wrote: >> I’m storing an Int? inside a [String:Any] but I can’t retrieve it again. Is >> this expected behaviour or a bug in Swift? >> >> /Daniel >> >> % swift >> Welcome t

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Tom Sheffler via swift-users
Thanks for sharing this playground! I hadn’t seen anything quite like it, and it’s illuminating some of the possibilities. > On Jan 5, 2016, at 10:42 PM, Donald Pinckney via swift-users > wrote: > > Hi all, > Personally, I love Swift, and I am curious to see if it will be used in > education

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Don Wills via swift-users
Points well taken. > On Jan 6, 2016, at 11:02 AM, Jens Alfke wrote: > > >> On Jan 6, 2016, at 9:34 AM, Don Wills via swift-users >> wrote: >> >> Coming from the perspective of business applications market (Java and C#), I >> see major problems in moving to Swift. > > Did you intend to hija

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Loïc Lecrenier via swift-users
Oops, I just noticed (thanks Jen) that I replied to an off-topic comment. Sorry, Donald Pinckney :( Back on topic! I love the playground. You should look into the XCPlayground framework to display graphics in the timeline instead of in-line, I think it would be nicer. I see that you used pdf fi

Re: [swift-users] "business applications market" flame

2016-01-06 Thread Jens Alfke via swift-users
> On Jan 6, 2016, at 9:34 AM, Don Wills via swift-users > wrote: > > Coming from the perspective of business applications market (Java and C#), I > see major problems in moving to Swift. Did you intend to hijack an unrelated thread instead of starting your own? If so, that’s bad netiquette.

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Loïc Lecrenier via swift-users
Hi Don, I don’t understand these complaints. The String class is complicated, but it is not a disaster, it just needs more convenience methods. See: https://www.mikeash.com/pyblog/friday-qa-2015-11-06-why-is-swifts-string-api-so-hard.html for an explanation of the String API. Optionals is an

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Don Wills via swift-users
[soapbox] Coming from the perspective of business applications market (Java and C#), I see major problems in moving to Swift. It's simple too different. The String class is a disaster. Optionals present a giant spider web of interconnectedness and syntax idiosyncrasy that does not provide an

Re: [swift-users] [swift-evolution] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-06 Thread Bruno Berisso via swift-users
Hi, Could you point to what Regex code are you using? You mention you copy some library but don't provide the original source. On Wed, Jan 6, 2016 at 9:12 AM David Hart via swift-evolution < swift-evolut...@swift.org> wrote: > I'm starting to understand. The implementation of RawRepresentable's

Re: [swift-users] Prototyping what Swift can look like in educational settings

2016-01-06 Thread Dru Satori via swift-users
There is a huge potential here. The weakness, today at least, is that with Swift 2.0, there remain some difficulties in terms of being dependent upon reaching out to Objective C to accomplish some tasks. Looking at what is coming with Swift 3.0, and the work done on the Linux port, I think there

Re: [swift-users] [swift-evolution] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-06 Thread David Hart via swift-users
I'm starting to understand. The implementation of RawRepresentable's probably looks like this: init?(rawValue: String) { switch rawValue { case "firstValue": self = .FirstCase case "secondValue": self = .SecondCase default: return nil } } In that case (no pun intended), the s

Re: [swift-users] Optionals inside Dictionary where Value = Any

2016-01-06 Thread Dmitri Gribenko via swift-users
On Wed, Jan 6, 2016 at 12:47 PM, Daniel Eggert via swift-users wrote: > I’m storing an Int? inside a [String:Any] but I can’t retrieve it again. Is > this expected behaviour or a bug in Swift? > > /Daniel > > % swift > Welcome to Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, >

[swift-users] Optionals inside Dictionary where Value = Any

2016-01-06 Thread Daniel Eggert via swift-users
I’m storing an Int? inside a [String:Any] but I can’t retrieve it again. Is this expected behaviour or a bug in Swift? /Daniel % swift Welcome to Apple Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 1f2908b4f7). Type :help for assistance. 3> let d: [String:Any] = ["foo": (nil

Re: [swift-users] ARC // Precise Lifetime Semantics

2016-01-06 Thread Daniel Eggert via swift-users
Thanks! That’s a very elegant solution. /Daniel > On 05 Jan 2016, at 20:48, Jacob Bandes-Storch wrote: > > This is what withExtendedLifetime is for: > https://developer.apple.com/library/ios/documentation/Swift/Reference/Swift_StandardLibrary_Functions/index.html#//apple_ref/swift/func/s:FSs2

Re: [swift-users] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-06 Thread David Hart via swift-users
To bring a little bit more context: I copied this Regex library in my project which had StringLiteralConvertible and implemented the pattern matching operator and all of a sudden, ALL init(rawValue: String) calls of completely unrelated enums started returning unexpected values. If I did not hav