Hi! My name is Eduardo Ochs,
I'm the author of an Emacs package called eev,
and this video is about some very technical things
about Emacs Lisp, Common lisp...
Sly and Slime, that are related to Common Lisp...
and Maxima is built on top of Common Lisp.
And... here is a very short summary...
when we are in a Lisp buffer -
in a _Common Lisp_ buffer...
and we insert a test block there...
There are several ways...
several variants of ways
to insert test blocks there...
and one of the ways inserts this big thing here.
And this video is going to be about this detail here.
This `-b' means...
that we are handling something that is `b'adly `b'ehaved,
something that is a `b'lack `b'ox...
that we will have to use special tricks to handle it...
and it also means `b'eware.
And... so: the video is about that `-b.'
Imagine that we are...
writing some code in Common Lisp,
and we want to debug
each of the functions that we write
on-the-fly, as we write it.
I started with these two functions here...
note that my major mode is "Lisp"...
and if I insert a test block here,
with `M-x eeit', for `i'nsert `t'est block...
the default is this.
But we are interested in some variants here...
and if we run `M-x eeit'
with some invalid numeric prefix
it shows us several options.
The options are these ones here [in the echo area]...
let me copy them from the "*Messages*" buffer
to a comment... here...
and... I'm going to discuss some of these variants.
But I'm going to need a smaller font for that.
The most obvious variant is using `M-x eeit'
with no prefixes at all...
We get this, and it calls SBCL...
and I can test it in the obvious way.
For example, if we run this, it opens
a target buffer running SBCL here...
it loads this file, "o.lisp"...
everything went well,
and now I can test my function.
Now... the first interesting variant is
how to run this Lisp function in Maxima.
So... let me try. `M-3 M-x eeit'...
it inserts a different test block.
This thing here looks redundant...
we have two `load's...
we have to decide which one to use...
or we can leave both...
The thing is that....
sometimes we prefer this one because we
don't want to enter... to go from Maxima
to the Lisp interpreter inside Maxima...
and sometime we want to use this one
because we want better error messages.
But let me try. If I run this thing here
Maxima loads this file here, and everything is ok...
and this function here, that starts with a `$',
can be called from Maxima.
So if I run "bar(2,3);" the result is 23.
Uh, so... until now everything is quite simple.
But what happens if I run this prefix here, `4'?
`M-4 M-x eeit' gives me this big thing.
Let me show how this this thing works....
No, no. Sorry, sorry. I don't want
that one. I want the the other one, with `5'.
Uh, sorry, sorry, sorry... this one.
I'm going to uncomment these things here,
`3ee' and `4eee', because they're going to be useful
in this demo here...
These first three expressions here, they...
they create a Common Lisp expression... sorry,
a target buffer running Sly in Common Lisp...
Let's try. We have to wait a bit. Here: Sly...
These other three expressions create a target
buffer running Maxima, and it loads
a file that I have, that defines the way...
of connecting to a Sly server.
And this one is the mysterious part.
It has this `-b' here, that means that this
thing is a `b'lack `b'ox, and that I didn't know
a good way to handle that black box...
so I'm going to handle it in a special way,
in which a part of the work is delegated
to the user... so it also means `b'eware.
It means: user, please beware, you're going...
to have to do some special things here.
So... if I run this line here
it takes a few seconds
and it creates a target buffer
that is in the wrong place.
It's here, in that window,
and not at the window at the right.
Now I'm at the target buffer,
and I have to type `f9' to signal to eev
that this is the target buffer.
And it does this. The `eepitch-b' has saved
that the source buffer is here,
when I type `f9', it shows the target buffer here,
at the window at the right
and now everything is ok.
Now I have to do some
something very technical, that creates...
another buffer...
if I run this, `find-4eee-maxima-sly',
eev shows all the targets that I have now...
I can switch between all these targets.
So this is Maxima, that has loaded Slynk,
that is the thing that connects to Sly...
this is the target that was created by Sly
before it connected to Maxima,
and this is the part of Sly
that is connected to Maxima.
This function here, `find-4eee-maxima-sly',
that shows all these targets, is just
just for debugging and for explaining things...
it is not very useful.
And if I run this one, `find-3ee-maxima-sly',
it shows only these two targets,
the top one and the bottom one.
These ones are the ones that are useful.
The middle one is not - it is just a curiosity.
So these are the targets that I'm interested in...
And if I delete the other windows, and I...
use these functions here...
I can select between the other targets and show
only one target at the window at the right.
And typically I'm going to run this
to load this file here into Maxima from Lisp,
or I'm going to run this and load the... thing...
from Maxima.
I gave a presentation at the Emacscon 2025
nine days ago, and one of the main themes
of my presentation was different notions
of simplicity, and how eev is based
on a certain notion of simplicity
that makes all sense to me, and apparently
it makes sense to very few other people.
One of the slides was this one,
in which I compared how lambdas
were represented until some time ago
with what changed, and how lambdas were...
were changed to be represented internally
by some opaque objects that look like arrays, like this.
And another slide that I used was this one,
in which I tried to explain some ideas behind
my notion of simplicity.
And I said that "my working memory is small"...
So I need something that is is compatible
with not being able to memorize many things...
and I need examples...
and I make lots of mistakes when I type.
And I added to this page several links to
messages from the emacs-devel mailing... to...
by Alan Mackenzie...
I have the impression that Alan Mackenzie
has a notion of simplicity that is very similar
to mine... and in this message here, 559,
he says that... he says something very similar
to what I say in my presentation... and I want to
discuss a part of one of these messages.
One of the sections of my page
about my presentation
at the EmacsConf is this one -
section 4 at the moment...
And note that it starts with this.
My tendency when I think that I have to explain
my notions of "simple", "elegant", "fun",
"easy", "hard" and "overwhelming"
is to think that I have to explain all of them,
all these notions, in a few lines...
and that is too hard. One alternative
is to quote other people, and use links.
And in this section, I collected several links
to messages that Alan McKenzie
sent to the mailing list...
and I'm going to discuss one part
of one of his messages... this one, 349...
that is here...
this is the part that is interesting to me now.
With simple straightforward macros...
I have no trouble...
this lack of memory [of mine] makes
working with these macros and function in Emacs
arduous and unrewarding.
But if ... had been documented
to the the customary Emacs standard
I would have finished the task.
Let me go back to my .lisp file.
Remember that these are the variants
of test blocks for Lisp files.
And remember that I'm using Sly here...
that is a fork of Slime that is much less popular
than Slime. Why am I using Sly here?
I started trying to use Slime,
but I had some problems... and these problems
are explained in the source code of this function.
So let's go there... `M-h M-f' goes to some links
for this function here... and this link
will take us to the source code of that function.
Let me go up to the comments... here...
Some targets for eepitch... like `eepitch-sly',
and this other thing, that doesn't matter to us now...
are hard to write because things like this one...
doesn't work.
This part of the expression, `(sly)',
returns too soon, but Sly keeps running
and keeps doing things in the background,
including things that change the window configuration
and these things are done
outside the `(save-window-excursion ...)'...
so I don't have a way to control
what's happening here, and make sure that everything
is happening in a single window.
I sent these issues to the Sly developers
but they didn't answer in a very... useful way,
and in 2022, in 2022-dec-30, I finally found a way
to create a "shell-like function"...
that is something that eepitch expects...
that opens a REPL for Sly in the current window,
reusing a current Sly if possible.
The main idea was to
replace this expression here, the `(sly)'
inside the `(save-window-excursion ...)',
by something that only returns when...
wow, there's a typo here...
when a certain hook - this one...
when this hook here is run,
or when a timeout occurs.
It was a pain in the ass to write this,
it was several days of work...
but it works.
And I was never able to do something similar
for Slime because the code for Slime is not as
clean, it doesn't have that hook...
and I didn't have help enough for doing that...
and I gave up...
which is similar to what Alan Mackenzie says here...
he says: but if... (blah blah blah blah)
...I would have finished the task.
That was my problem with Slime.
I discussed a bit the idea of "black boxes"
in my presentation at the EmacsConf,
and Slime was a black box in the sense that
I could open it, I could see the pieces,
I could see how they worked,
but it was very complex for me...
I couldn't understand that,
and I couldn't change it, or hack it...
in the ways that I needed.
So for some people that would not be a black box,
but for me that was _equivalent_ to a black box
in the sense that I couldn't hack it...
so I _declare_ that it is black...
that that black box is black in a certain sense.
_For me_ that box is black.
Remember that here in this test block
for Maxima and Sly, we had one `-b' like this...
That means "black box", "beware"...
"the user has to type `f9' to indicate
that this is the target buffer"... and so on.
So the `-b' means many things, but essentially
it means `b'eware, and it's a place in which we
have to forget the problem that we are thinking of
and pay attention on certain things,
to type `f9' at the right time,
just to start Maxima, Slime, etc.
So, I was discussing this thing here,
"5.maxima+sly", and if we try
this variant here, "4.maxima+slime",
with `M-4 M-x eeit'...
we see that it has another '-b' here.
Let me delete the rest...
This test block is much worse than the other one,
because to start Maxima and Slime,
I need to type a series of `f8's
and there are two places
in which I have to pause, pay attention,
type `f9' at the right time, maybe answer
some other prompts, like a yes-or-no
prompt, or something like that...
So it is very distracting.
If you want to play with that,
maybe because you've stumbled on some things
that you would like to control with eepitch
but that look like badly-behaved targets,
my suggestion is: forget Maxima for the moment,
so: delete this,
and focus on this thing here:
eepitch blocks for Slime.
Remember that if we run `M-x eeit'
with no numeric arguments,
we get the default test block...
and if we run it with an invalid prefix argument,
we get this help message here...
And if we run it with this prefix argument, `1',
`M-1 M-x eeit', we get this... eepitch block here,
that calls Slime...
it has to do some tricks
for deleting all the buffers
of a previous instance of Slime...
then it has to... it starts Slime
with this `-b' here meaning `b'eware,
and then it selects the... Slime as a target buffer...
and so on.
So my suggestion is: try to understand this,
and... if it works, very nice...
if you would like to chat with me
then very, very, very nice, please do...
and at some point there will be
many other variants of that
for other things that I couldn't control
with eepitch until some months ago
because I didn't have this trick.
I think that I'm going to stop the video
at this moment because the other things
that I want to explain
will be better explained
by using just text, code, and screenshots.
So... that's it. Thanks! =)