ioHook

5 views
Skip to first unread message

Ralf Hemmecke

unread,
Jun 2, 2026, 10:52:26 AM (3 days ago) Jun 2
to fricas-devel
Quick question...

Is there a real need for ioHook("symbol", args), i.e. for more arguments
than just "symbol"?

Code like

https://github.com/fricas/fricas/blob/r1.3.13/src/interp/setvars.boot#L98

set l ==
ioHook("startSysCmd", "set")
UNWIND_-PROTECT(set1(l, $setOptions), ioHook("endSysCmd", "set"))

we can easily rewrite to

ioHook("startSysCmd!set")

In fact, I doubt that we need to distinguish between "set", "abbrev",
"display" etc. Wouldn't it be enough to just have

ioHook("startSysCmd")

?

In case we switch to a one-argument-ioHook, the only external client I
know of that would be in trouble is frimacs.

https://github.com/pdo/frimacs/blob/master/frimacs-process-mode.el#L54

Opinions?

Ralf

Martin R

unread,
Jun 2, 2026, 11:38:58 AM (3 days ago) Jun 2
to FriCAS - computer algebra system
would the following still work?

    ")lisp (setf |$ioHook|"
    "            (lambda (x &optional args)"
    "              (when (member x '(|startAlgebraOutput| |endOfAlgebraOutput|"
    "                                |startKeyedMsg|      |endOfKeyedMsg|))"
    "               (prin1 x)"
    "               (princ #\\Newline))))")

Waldek Hebisch

unread,
Jun 2, 2026, 1:04:28 PM (3 days ago) Jun 2
to 'Ralf Hemmecke' via FriCAS - computer algebra system
I am not sure what we are supposed to gain from this. It is pretty
clear that we will loose flexibility. IMO separtate arguments
are superior to trying to cram all info into a single symbol
like "startSysCmd!set". And if just _one_ call needs two arguments,
then it is simpler to allow two arguments in all calls.

Note that first argument is supposed to be a symbol, so if we need
to pass something different it should be in the second argument.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages