< Back to IRCAM Forum

Modalys on the command line?

Hi, I’m just getting started with Modalys and have a quick question about setting up my environment:

Is there any way to run an interactive interpreter on the command line as an alternative to using the ModaLisp application?

The Modalys package (MacOS) installs /usr/bin/modalys, which gives me a mlys> prompt, but which does not seem to be a working Lisp interpreter. For example:

mlys> (new)
[t     0.00, step            0]
***
*** ERROR: undefined variable 'new' in line: 'new) '
***
mlys> (+ 2 2)
[t     0.00, step            0]
***
*** ERROR: unknown function 'modalys_'
***

By contrast, in the “Listener” tab of the ModaLisp application:

MODALYS 1 > (new)
Warning: (DEFUN VGET) being redefined in LISTENER (previously in /Applications/Modalys/Components/init/lisp/init.lisp).
Warning: (DEFUN VSET) being redefined in LISTENER (previously in /Applications/Modalys/Components/init/lisp/init.lisp).
T
MODALYS 2 > (+ 2 2)
4

I haven’t been able to find any documentation that mentions the command line application or its relationship to the ModaLisp gui application. Please let me know if I’m missing anything.

Ideally I’d like to be able to work with Modalys/Lisp in the same way that I do with other interpreted languages (using Vim/vim-slime). Thanks!

1 Like

I am not an expert in this field But if you find the solution, I am interested

1 Like

Thank you catniptwinz for attempts and inspiration!
That is a very interesting question which confused me until today, but now after your inspiration, I guess I got some idea.

The mlys in terminal works with MatLab syntax instead of Lisp. To convert the syntax from Lisp to MatLab, you could try to use the “Export as mlys…” function (in ModaLisp: menu bar => File).

Normally, the result could be put into the terminal directly. At least it will be a nice starting point.

Best,
Jialin

Thank you, this is exactly what I needed. I hadn’t thought to try “Export as mlys.”

It works well with vim-slime and the mapping between the Lisp and MatLab functions seems straightforward, so I’m already off to a good start!

1 Like