Arch Linux

How does it work?

Every time you press Enter it adds a new instruction, generates a new crystal program, and executes it.

The output is split into 2 parts: regular program output (e.g. output from puts 10) and the value returned by the last command.

The regular output is saved, and when you type a new instruction, a new program is generated. The saved output is subtracted from the new output, and the difference is printed out. It creates an illusion that only new instructions are executed :)

Commands and special locals

paste - enables paste mode

debug - toggles debug mode off and on. In debug mode icr will print the code before executing it

quit or exit - exits current interactive console

reset - clears out all of the accumulated commands

__ - holds the result of the last expression. Example:

icr > "5" + "2"
=> "52"
icr > __.to_i - 10
=> 42

Update check

ICR periodically checks for the new releases on Github. If your current version is out of date, it will simply show you a notice at start.