So the type system doesn’t feel so static.
object wb{
def main(args:Array[String]){
println("Happy everyday!DATA-CENTER!")
println(new java.util.Date())
}
object w{
def main(args:Array[String]){
println("Happy everyday!")
}
}
~
~
~
Scala集成了函数编程和对象编程的优点。
SEAMLESS JAVA INTEROP
Scala runs on the JVM, so Java and Scala stacks can be freely mixed for totally seamless integration.
TYPE INFERENCE
So the type system doesn’t feel so static. Don’t work for the type system. Let the type system work for you!
CONCURRENCY & DISTRIBUTION
Use data-parallel operations on collections, use actors for concurrency and distribution, or futures for asynchronous programming.
TRAITS
Combine the flexibility of Java-style interfaces with the power of classes. Think principled multiple-inheritance.
PATTERN MATCHING
Think “switch” on steroids. Match against class hierarchies, sequences, and more.
HIGHER-ORDER FUNCTIONS
Functions are first-class objects. Compose them with guaranteed type safety. Use them anywhere, pass them to anything.
So the type system doesn’t feel so static.的更多相关文章
- Beginning Scala study note(8) Scala Type System
1. Unified Type System Scala has a unified type system, enclosed by the type Any at the top of the h ...
- Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c
错误: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, V ...
- foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.Table' because 'System.Web.UI.WebControls.Table' does not contain a public definition for 'GetEnumerator'
错误:foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.Table' because ' ...
- Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, ...
- JsonException: Max allowed object depth reached while trying to export from type System.Single
在进行类转json字符串时,报错JsonException: Max allowed object depth reached while trying to export from type Sys ...
- Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'
[TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...
- The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name
可以强迫部署EntityFramework.SqlServer.dll这个文件到输出目录 找到1个老外的帖子,戳这里(本人测试无效,大家有可能试一下..) 解决方案以下: 在EF的上下文代码CS文件( ...
- 解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assemb
解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode ...
- 详解反射->Type.System
反射先了解 一:system.Type 获取基本信息: Type.Name //类名 Type.FullName //完整路径 Type.Namespace //空间名 public class ...
随机推荐
- [Codeforces 1246B] Power Products (STL+分解质因数)
[Codeforces 1246B] Power Products (STL+分解质因数) 题面 给出一个长度为\(n\)的序列\(a_i\)和常数k,求有多少个数对\((i,j)\)满足\(a_i ...
- 02-Django-views
# views 视图# 1. 视图概述- 视图即视图函数,接收web请求并返回web响应的事物处理函数.- 响应指符合http协议要求的任何内容,包括json,string, html等 # 2 其他 ...
- spark(2)
1.spark模块 -------------------------------------- (1)Spark Core //核心库 (2)Spark SQL //核心库 (3)Spark Str ...
- maven项目出现红叉
现象:maven项目出现红叉,同时项目中没出现代码错误 解决方案: 可尝试在本地maven项目pom.xml中添加如下: <build> <plugins> <plugi ...
- <img> 标签的 src 属性
src属性 加载的时候就会请求 1.servlet生成一个图片 2.你直接输入servlet的连接看一下,就是一个图片,和我们自己发布到服务器的一样. 3.页面加载时,会访问这个servelt连接,自 ...
- CentOS7 添加新用户并授权 root 权限
参考文章:CentOS 7中添加一个新用户并授权 # root 用户操作 $ 普通用户操作 创建用户 # adduser USERNAME # passwd USERNAME (输入密码) 授权 ro ...
- openGL坐标系
从我们构造模型的局部坐标系(Local/Object Space)经过一系列的处理最终渲染到屏幕坐标系(Screen Space)下,这个过程有6种坐标系. 一.世界坐标系(World Coordin ...
- js赋值后 改变现有数据会修改原来的数据
看代码: let obj1 = { name: '张三', age: , sex: '男' } let obj2 = obj1 console.log('obj2:', obj2) obj2.age ...
- font-awesome样式只显示方框
这是一个踩过的坑:使用font-awesome中的css样式库时,比如fa-user-circle-o,显示的不是一个用户图标,而是一个方框. 怎么回事呢? 进入css文件,发现: 咦,这些文件呢?我 ...
- bzoj3510 首都 LCT 维护子树信息+树的重心
题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=3510 题解 首先每一个连通块的首都根据定义,显然就是直径. 然后考虑直径的几个性质: 定义:删 ...