- Professional Scala
- Mads Hartmann Ruslan Shevchenko
- 119字
- 2021-07-23 17:24:22
REPL
Another tool that we will frequently use is REPL (Read Eval Print Loop). It is often used for quickly evaluating Scala expressions.
From sbt
, we can enter REPL mode with the help of the sbt console
command. Let's try some simple expressions.
Now, we'll look at how to evaluate expressions. Follow these steps to do so:
- Open the
sbt
tool. - Open
REPL
by typing the following command:sbt console
- Type the following expressions and press Enter:
2 + 2
"2" + 2
2 + "2"
(1 to 8).sum
java.time.LocalTime.now()
Please note that we can have an interactive Scala playboard
inside IDE by creating a special file type: a Scala Worksheet. It's useful, but is mainly for demonstration purposes.
推薦閱讀
- GPS/GNSS原理與應用(第3版)
- 農產品物聯網研究與應用
- Drush User’s Guide
- Getting Started with WebRTC
- 數字通信同步技術的MATLAB與FPGA實現:Altera/Verilog版(第2版)
- 城市治理一網統管
- 基于性能的保障理論與方法
- 搶占下一個智能風口:移動物聯網
- VMware NSX網絡虛擬化入門
- 大型企業微服務架構實踐與運營
- 人際網絡
- Python Web Scraping Cookbook
- 通信系統實戰筆記:無處不在的信號處理
- Hands-On Cloud:Native Microservices with Jakarta EE
- Hands-On Microservices:Monitoring and Testing