I don’t know how interesting that would be. We need to make sure that all functionality in Xojo can also work on Windows, Linux…
Since Swift is Mac only, I think the importance is limited to mac only shops (unless you like releasing software that has different functionality on different platforms, which I don’t)
Swift is just a programming language, not a framework, so there is no change for us, since we already can work with Cocoa, the Objective C Runtime, etc through declares. Swift does the same thing as Objective C, just with a cleaner syntax.
but I really hate objectiveC and I believe the future for Apple itself is Swift. The other point is, that more of us Xojo developers are beeing able to write plugins, especially those for Mac and iOs. When Xojo for iOS will come out I expect it to be very good but limited. With an interface to Swift, more of us are able to found own solutions in handling not supported tasks.
Xojo Pairs needs deprecation in favor of Tuples (http://msdn.microsoft.com/en-us/library/dd233200.aspx). About the rest I believe I saw Joe saying something like “I know, maybe someday in the future” for things like Clojures, Lambdas, Generics, the current inline if(,), shorter optimized syntax (a+=1), etc, etc. Xojo needs another reboot, rather soon, maybe a redesign to bring it closer to the state of the art after the iOS compiler release.
[quote=94899:@Kem Tekinay]Two features I would want Xojo to adopt, or at least look into:
Implicit typecasting, so I could write dim x = 1 // Integer, dim y = 1.0 // Double, or dim z = s // String, because s is a string.
The Playground feature. Utter coolness.[/quote]
You confused me by calling it implicit typecasting because the book refers to this as type inference. Xojo has this for constants already. Implicit typecasting sounds like a terrible thing, such as [code]Dim WorldNumber As Integer = 1
Dim S As String = “Hello " + WorldNumber + " World”
I would like the string substitution though. I think their syntax is awkward “Hello \(WorldNumber) World” but it would make building dynamic strings much nicer.
Rick already brought up Tuples. While not new to Swift by any means, they too would be handy.
I’d really like type inference. I’m currently doing some Go programming (love, love, LOVE Go) and in Go you don’t have to declare the type of a variable if the compiler can easily figure it out. You can just type
age := 23
name := "Mr. Wonderful"
and Go figures out that age is obviously an int and name is obviously a string.
The magic is in the := instead of a plain = or ==.
It doesn’t just work with primitives, it works with any kind of type, e.g., in Xojo you could type
f := New FolderItem
or
f := GetOpenFolderItem(foo)
without having to first dim f as folderitem.
The language is still strongly typed, but type inference makes it feel more like a scripting language, and it’s surprising how such a little thing makes coding flow better.
The way I read the manual "Hello " + WorldNumber + " World" would be valid. I’m hoping it is, I think that’s more readable. I don’t have means of testing since I wasn’t going to become part of the mac program until my app was ready to release.
It may be, I don’t recall. Frankly, I hope that + is not used as both an addition and concatenation operator. But as long as there is no implicit typecasting, it can work out.
What I mean is in a language where implicit typecasting exists, String + Integer is ambiguous. Should String be converted to an nnteger and add the two, or should Integer be converted to a string and appended to String? With implicit typecasting, two operators are pretty much required, so String + Integer means addition whereas String . Integer means concatenation.
In languages with no (or little) implicit typecasting, the problem goes away because the developer must inform the compiler what action should be taken. In Xojo, this would be either Val(String) + Integer or String + Str(Integer). I’m more partial to no implicit typecasting, which I believe Swift is very strict about. It won’t even convert a UInt8 into a UInt16 without explicit typecasting.
dim a , b, c as integer, d as double, e as folderitem
and even
dim a , b, c as integer
dim d as double
dim e as folderitem
I try to
never declare a variable far away from where its to be used.
never declare more than one variable on one line (far to easy to overlook or get a declaration messed up if you have to change the type)
never declare a variable more globally than necessary
always be explicit even when type inference is available. I like to be explicit so I don’t have to go read the code just to figure out that “a is an integer” in a method that has maybe 100 lines (and maybe I interpret the typing differently than the compiler - which can happen and I’m wrong)
[quote=94912:@Thom McGrath]Implicit typecasting sounds like a terrible thing, such as [code]Dim WorldNumber As Integer = 1
Dim S As String = “Hello " + WorldNumber + " World”[/quote]
That would be a wonderful thing, not a terrible thing. Overall I like Xojo better then VB.NET, but one of the things I appreciate about VB.NET is that it will make obvious typecasts for you. (Though with strings you need to use & for concatenation. If you use + sometimes the compiler will try to cast the wrong way.)
Note: I posted this and then saw your later message clarifying your problem with implicit typecasting. You’re right, the + symbol is ambiguous. But rather then lean towards no implicit typecasting at all, I wish we had a concatenation symbol that would trigger implicit typecasting.