Re: [swift-users] Pass Value of Variable to a Function

2016-09-07 Thread Rugen Heidbuchel via swift-users
Can't mirrors solve this problem for Locale itself, instead of using NSLocale? I do think that will affect performance though. Rugen > On 7 Sep 2016, at 09:03, Zhao Xin via swift-users > wrote: > > Now I understand your point. But as Jens said, Swift is a static language, it > won't interpre

Re: [swift-users] Pass Value of Variable to a Function

2016-09-07 Thread Zhao Xin via swift-users
Now I understand your point. But as Jens said, Swift is a static language, it won't interpret `property` as a variable after `.`(dot). So for Swift compiler, you just refer to a none-exist property. Zhaoxin On Wed, Sep 7, 2016 at 12:39 PM, Michael Sheaver wrote: > Hi Zhao, > > Many thanks for y

Re: [swift-users] Pass Value of Variable to a Function

2016-09-06 Thread Jens Alfke via swift-users
> On Sep 6, 2016, at 9:39 PM, Michael Sheaver via swift-users > wrote: > > I know that in some languages, if you prepend the passed parameter with a > '$', as in $propertyName, the receiving function knows to use the contents of > the variable named propertyName (in this case "calendar") inst

Re: [swift-users] Pass Value of Variable to a Function

2016-09-06 Thread Michael Sheaver via swift-users
Hi Zhao, Many thanks for your response, and I will give this a try. However, I think that I might have used a bad example for the bigger question I was trying to ask, and for that I am sorry. The question that I am really trying to address here is: Is there a more Swift-y way to, when passing

Re: [swift-users] Pass Value of Variable to a Function

2016-09-06 Thread Shawn Erickson via swift-users
I am trying to understand why you are trying to do this. Can you provide a better example for why you need to do this? -Shawn ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] Pass Value of Variable to a Function

2016-09-06 Thread Zhao Xin via swift-users
I think you messed up with `Locale` and `NSLocale`. `Locale` is a struct in Swift 3 to replace the legacy `NSLocale`. The latter is a class, it has an inner `structure` called `NSLocale.Key`. For `Locale`, there is no `NSLocale.Key`. All there keys are instance properties in `Locale`. So in your s