User Tools

Site Tools


geda:gschem_repl

This is an old revision of the document!


Russian

Using REPL in gschem

Embedded graphical REPL functions in gschem

The entry field for guile procedures is opened with hitting the key : (colon). After doing this the user may enter commands in the appeared field and watch the results of their work in the gschem log window.

REPL in the background terminal

In the current version of the geda-gaf repository (as of 09.02.2016) there is an additional menu entry for working with REPL in the background terminal, which is invoked with hitting key sequence FShift+R.

Please note, that for the moment you can run it several times, which may confuse your terminal. Moreover, there is a risk of closing working instance of gschem by using some shortkeys.

For more convenient work in the terminal you may want to turn on the functions of the readline library. For that, type in the terminal:

(use-modules (ice-9 readline))
(activate-readline)

External graphical REPL

For invoking external graphical REPL window you have to have a REPL functions library from the guile-gnome. In Debian, for instance, you have to install the package guile-gnome2-gtk to may use it. To open the window, type in the field of the embedded REPL in gschem as follows:

(use-modules (gnome-2) (gnome gtk) (gnome gtk graphical-repl))
(guile-gtk-repl)

REPL in any terminal

In order to invoke REPL in a terminal you have to open a REPL socket in gschem. To do so, load the system REPL module and call the function of server spawning:

(use-modules (system repl server))
(spawn-server)

When called without arguments, the spawn-server function uses the default guile port 37146. You can define another port:

(spawn-server 1234)

When you're opening a port, please note the security risks described here.

Дальше необходимо просто подключиться к нему любой программой, которая может работать с сокетом, например, используя telnet, netcat или другую программу. Примеры использования telnet:

$ telnet localhost 37146

Пример использования netcat:

$ nc localhost 37146

В этом случае интерфейс readline работать не будет.

Пользователи Emacs для работы с REPL могут использовать чудесное окружение Geiser. Для этого нужно установить данный пакет, запустить сервер REPL в gschem и подключиться к нему в Emacs с помощью M+X connect-to-guile.

geda/gschem_repl.1455025773.txt.gz · Last modified: 2016/02/09 08:49 by vzh