Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

let names = ["Anna", "Alex", "Brian", "Jack"] let count = names.count for i in 0..<count { print("Person \(i + 1) is called \(names[i])") } // Person 1 is called Anna // Person 2 is called Alex // Person 3 is called Brian // Person 4 is called Jack
先に結論 Swiftのstaticメソッド制約はちょっとしたシンプルな機能に見えるけど便利で深い Kotlin, TypeScript, Java で同じことをすると冗長で間接的なコードになってしまう TypeScriptのstaticメソッド注入は独特のテクニックで面白い 提示するJavaの実装は「T を new する」方法でもあるので参考にして Scala は間接的ではあるもののKotlinより良い形でかける SwiftはScalaの形をさらにより良くした形とみなすことができる C++はSwiftと同じ事ができるがわかりにくい書き方になってしまう 導入 Swiftはprotocolという機能で、Javaのinterfaceのように型がインスタンスメソッドをもつ事を強制する事ができます。そしてSwiftではそのメソッド制約として、インスタンスメソッドだけではなくスタティックメソッドをもつ
This document compares control flow, expressions, declarations, patterns, and types between Swift and Scala programming languages. Key differences include Swift using 'for-in' while Scala us… Document Informationclick to expand document informationThis document compares control flow, expressions, declarations, patterns, and types between Swift and Scala programming languages. Key differences inclu
2020 Copyright. All Rights Reserved. The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois). Privacy Policy
At Littlelines, we are very excited by Apple’s announcment last week of their brand new programming language for building iOS and Mac apps called Swift. As developers, we get very curious when new languages are announced and this was no exception. For the past week, I’ve been buried in books, articles, and screencasts on all things Swift. Along the way, I’ve recognized a few things about Swift tha
はじめに AppleがSwiftという言語を発表した。 新しい言語をつくるのであれば既存の言語から良いアイディアは取り入れ悪いアイディアは取り入れないのが良い。 TwitterのTLを見ていると「Swiftは○○に似ている」という発言があったので、 どこら辺が似ているのかを自分の中で振り返ってみた。 (最初は「Swiftは○○のパクり」というタイトルにしたかったのだが、文全体を挑発的に書けなかったのでやめた) 間違っていることもあるはずなので、コメントは大歓迎である。 Swift 全部紹介するのは無理なので、とりあえず A Swift Tour から引用したい。 基本文法 基本文法はC言語系だ。現在の手続き型言語はC++やJava等これが主流である。 (主流でない文法はFORTRAN、BASIC、Pascalなどなど。関数型だとまた全く違う) Simple Values
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く