In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article shares with you the content of sample analysis of Swift and Fedora. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Swift is a general programming language that uses modern methods to build security, performance, and software design patterns. It aims to be the best language for a variety of programming projects, from system programming to desktop applications, and to cloud services. Read on to learn about it and how to try it in Fedora.
Safe, fast and expressive
Like many modern programming languages, Swift is designed to be more secure than C-based languages. For example, variables are always initialized before they are used. Check whether arrays and integers overflow. Automatic memory management.
Swift puts the intention in the syntax. To declare a variable, use the var keyword. To declare a constant, use let.
Swift also guarantees that the object will never be nil. In fact, trying to use an object known as nil will result in a compile-time error. When using the nil value, it supports a mechanism called optional. Optional may contain nil, but use? Operator can be unpacked safely.
More features include:
Closure unified with function pointer
Tuples and multiple return values
Generics
To iterate quickly and succinctly over a range or collection
Structures that support methods, extensions, and protocols
Functional programming modes, such as map and filter
Built-in powerful error handling
Advanced control with do, guard, defer and repeat keywords
Try Swift
Swift is available in Fedora 28, and the package name is swift-lang. After the installation is complete, run swift and start the REPL console.
SwiftWelcome to Swift version 4.2 (swift-4.2-RELEASE). Type: help for assistance.1 > let greeting= "Hello world!" greeting: String = "Hello world!" 2 > print (greeting) Hello worldview 3 > greeting= "Hello universe!" error: repl.swift:3:10: error: cannot assign to value: 'greeting' is a' let' constantgreeting = "Hello universe!" ~ ^
Swift has a growing community, and in particular, a working group is working to make it an efficient and powerful server-side programming language.
Thank you for reading! This is the end of this article on "sample Analysis of Swift and Fedora". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.