# Ride REPL: Interactive Ride Console
Ride REPL (read-eval-print loop) is the easiest way to try out the Ride language and its execution semantic.
Ride REPL is built into the following developer tools:
In Ride REPL, you can define variables and functions and use the results of previous computations:
RIDE > let x = 42
defined let x: Int
RIDE > func inc(i:Int) = { i + 1 }
defined func inc(i: Int): Int
RIDE > inc(x)
res1: Int = 43
RIDE > inc(res1)
res2: Int = 44
The :reset
command clears REPL state, removing all the existing definitions.
# Standard Library
REPL features all the built-in functions, operators, variables, and structures of the Ride language:
RIDE > max([2,12,85,6])
res3: Int = 85
RIDE > sha256(base58'')
res4: ByteVector = base58'GKot5hBsd81kMupNCXHaqbhv3huEbxAFMLnpcX2hniwn')
You can query the function signature, structure definition or variable type by using the ?
command.
RIDE > ? getInteger
func getInteger(addressOrAlias: Address|Alias, key: String): Int|Unit
func getInteger(data: List[BinaryEntry|BooleanEntry|DeleteEntry|IntegerEntry|StringEntry], key: String): Int|Unit
func getInteger(data: List[BinaryEntry|BooleanEntry|DeleteEntry|IntegerEntry|StringEntry], index: Int): Int|Unit
func getInteger(key: String): Int|Unit
The ??
command dumps all the existing definitions.
# Blockchain Data
The results of blockchain-based functions and variables depend on the account and blockchain network (Mainnet, Testnet, or other) configured in tool settings. For example:
RIDE > this
res5: Address = Address(
bytes = base58'3N3ErpmUdJWy6DW4ruAr14YDis9UaiTwHd6'
)
RIDE > wavesBalance(this)
res6: BalanceDetails = BalanceDetails(
available = 8978000000
regular = 8978000000
generating = 8978000000
effective = 8978000000
)