[Converge]
About - Documentation - Download - Links

Interactive Converge

Converge can be run in an interactive loop via the convergei program. This is automatically invoked if the VM is started with no arguments. The ... characters denote the prompt, and other lines output from the interactive session.
$ converge
Converge current
>>> 2 + 3    
5
>>>
convergei can be exited either by typing Ctrl-D, or by importing the Sys module and calling Sys::exit(code) where code is a number such as 0.

After each expression, Converge prints out the return value of the expression if it succeeded, or prints nothing if it failed.

>>> 18 > 7
7
>>> 7 > 18
>>>

convergei is aware of Converge's syntax and can be used to define functions and other compound statements. When it detects a ":" or "\" at the end of a line, it goes into continuation mode (marked by the ... characters), which is terminated by a blank line:

>>> func f(x):
...     y := x * 2
...     return y
... 
<Object@0x4c3a5c10>
>>> f(3)
6
>>>