aboutsummaryrefslogtreecommitdiff
path: root/docs/repl.rst
blob: 9046781848cc165eefa2d8eca81eac402188c1ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
REPL
====

REPL, as it's name suggest, is function implementing endless loop with
following actions:

    * read

        First step is reading data from input stream.

    * evaluate

        Data that was read from input stream represent expression that
        should be evaluated by interpreter.

    * print

        Once evaluation finishes, result of evaluation is written to
        output stream. In case resulting data is ``()``, print step is
        skipped.

This loop is stopped only in case closing of input or output stream is
detected.


Source code
-----------

repl.h
''''''

.. literalinclude:: ../src_c/repl.h
    :language: c


repl.c
''''''

.. literalinclude:: ../src_c/repl.c
    :language: c