标签:bbr hotspot get oss setting play summary line shel
日期: 2020-01-22
Scala是“可扩展语言”的缩写(SCAlable Language),于2003创建,为JVM平台上的函数式编程以及面向对象编程提供一个高性能开发环境。所以,Scala要求使用java运行时库。并且scala是编译型静态类型语言。
在mac环境使用HomeBrew来安装scala比较方便(需要前置安装Java),直接输入命令:
$ java -version
$ brew install scala
直接输入scala就可以启动scala REPL来交互编程。
1 $ scala 2 Welcome to Scala 2.13.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_172). 3 Type in expressions for evaluation. Or try :help. 4 5 scala> 6 7 scala> println("Hello World!") 8 Hello World! 9 10 scala> 5*7 11 res2: Int = 35 12 13 scala> 2*res2 14 res3: Int = 70 15 16 scala> :help 17 All commands can be abbreviated, e.g., :he instead of :help. 18 :completions <string> output completions for the given string 19 :edit <id>|<line> edit history 20 :help [command] print this summary or command-specific help 21 :history [num] show the history (optional num is commands to show) 22 :h? <string> search the history 23 :imports [name name ...] show import history, identifying sources of names 24 :implicits [-v] show the implicits in scope 25 :javap <path|class> disassemble a file or class name 26 :line <id>|<line> place line(s) at the end of history 27 :load <path> interpret lines in a file 28 :paste [-raw] [path] enter paste mode or paste a file 29 :power enable power user mode 30 :quit exit the interpreter 31 :replay [options] reset the repl and replay all previous commands 32 :require <path> add a jar to the classpath 33 :reset [options] reset the repl to its initial state, forgetting all session entries 34 :save <path> save replayable session to a file 35 :sh <command line> run a shell command (result is implicitly => List[String]) 36 :settings <options> update compiler options, if possible; see reset 37 :silent disable/enable automatic printing of results 38 :type [-v] <expr> display the type of an expression without evaluating it 39 :kind [-v] <type> display the kind of a type. see also :help kind 40 :warnings show the suppressed warnings from the most recent line which had any 41 42 scala> "Hello World!" 43 res4: String = Hello World! 44 45 scala> (22.5 * 9/5) + 32 46 res5: Double = 72.5 47 48 scala> res5/2 49 res6: Double = 36.25 50 51 scala> :load /Users/natty/Develop/Learning/scala/LearningScala/Hello.scala 52 args: Array[String] = Array() 53 Loading /Users/natty/Develop/Learning/scala/LearningScala/Hello.scala... 54 Hello file world! 55 56 scala> :paste -raw 57 // Entering paste mode (ctrl-D to finish) 58 59 println("Hello file world!")
标签:bbr hotspot get oss setting play summary line shel
原文地址:https://www.cnblogs.com/natty-sky/p/12228007.html