Ammonite REPL Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[info] Running ammonite.repl.Repl | |
@ Range(0, 5).ma | |
max map maxBy | |
@ while(true) () | |
Interrupted! | |
@ val x = 1 | |
x: Int = 1 | |
@ val y = 2 | |
y: Int = 2 | |
@ x * y | |
res3: Int = 2 | |
@ x + y | |
res4: Int = 3 | |
@ x = " X " | |
Compilation Failed | |
Main.scala:9: reassignment to val | |
val res5 = x = " X " | |
^ | |
@ val x = " X " | |
x: java.lang.String = " X " | |
@ x * y | |
res6: String = " X X " | |
@ x + y | |
res7: java.lang.String = " X 2" | |
@ import ammonite.shell._ | |
import ammonite.shell._ | |
@ history | |
res9: scala.Seq[String] = Vector( | |
"while(true) ()", | |
"val x = 1", | |
"val y = 2", | |
"x * y", | |
"x + y", | |
"x = \" X \"", | |
"val x = \" X \"", | |
"x * y", | |
"x + y", | |
"import ammonite.shell._" | |
) | |
@ history |? grep! "val" | |
res10: Seq[String] = Vector("val x = 1", "val y = 2", "val x = \" X \"") | |
@ x | |
res11: java.lang.String = " X " | |
@ y | |
res12: Int = 2 | |
@ history.slice(1, 3) |> load.lines | |
x: Int = 1 | |
y: Int = 2 | |
res13: Unit = () | |
@ x | |
res16: Int = 1 | |
@ y | |
res17: Int = 2 | |
@ Seq(1, 2, 3).map(x => x. | |
getClass ## asInstanceOf isInstanceOf toString | |
hashCode equals != == % | |
/ * - + ^ | |
& | >= > <= | |
< >> >>> << unary_- | |
unary_+ unary_~ toDouble toFloat toLong | |
toInt toChar toShort toByte compareTo | |
doubleValue floatValue longValue intValue shortValue | |
byteValue synchronized ne eq wait | |
notifyAll notify toDegrees toRadians floor | |
ceil round signum min max | |
abs isNegInfinity isPosInfinity isInfinity isNaN | |
isValidInt isValidChar isValidShort isValidByte isWhole | |
self to until ResultWithoutStep underlying | |
compare isInfinite toOctalString toHexString toBinaryString | |
isValidLong formatted ensuring → -> | |
|> | |
@ Seq(1, 2, 3).map(x => x. | |
@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment