- 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.
推薦閱讀
- RCNP實驗指南:構建高級的路由互聯網絡(BARI)
- 6G潛在關鍵技術(下冊)
- 物聯網短距離無線通信技術應用與開發
- Twilio Cookbook
- 物聯網識別技術
- 物聯網信息安全
- 局域網組建、管理與維護項目教程(Windows Server 2003)
- Windows Server 2003 Active Directory Design and Implementation: Creating, Migrating, and Merging Networks
- 面向物聯網的嵌入式系統開發:基于CC2530和STM32微處理器
- 企業網絡安全管理
- Kong網關:入門、實戰與進階
- Scala Design Patterns.
- Android UI Design
- 沖擊:5G如何改變世界
- 計算機網絡技術