Definition not found error when defining new function with TTY editor
Discussed in https://github.com/orgs/Interlisp/discussions/2244
Originally posted by pamoroso August 8, 2025
When I call the TTY editor with EDITF to define a new function I get the error Could not find fns definition for NIL:
4_ (EDITMODE 'TELETYPE)
SEDIT:SEDIT
5_ (EDITF NOT-YET-DEFINED)
Could not find fns definition for NIL.Could not find fns definition for
NIL
I'm using Maiko nhb-string-handling-cleanup/c9e2759 and Medley rmk103--Font-and-related-code-updates/fa62d05 on Linux Mint 22.1 Cinnamon.
I can reproduce the issue with Medley Online 30-Jul-2025 02:26:56.
This problem is present in the Venue sysouts from 2000 as well, so not a result of anything we've changed. We should still look for the cause and fix it.
I don't think it was an old behavior to prompt with a menu when you've called the editor with an invalid function or other name. I dislike the menu of asking for what kind of thing do you want to create. It would be better to treat this as a DWIM situation, and possibly spell-check the target if it was typein.
Note that the Medley 2.0 release notes try to deprecate other ways of calling the editor of whatever style by using the (Common Lisp and also Interlisp 'ed'... i think it would be better to encourage newcomers to use 'ed' to invoke the editor rather than encouraging the proliferation of two letter functions that handle a subset of the situations that 'ed' seems to generalize.
This is not a bug. The idea that you start a session editing a template might possibly be one of several resolutions of attempting to ED something that wasn't defined.
I suggest we extend ED to cover other cases, e.g., (ED 'functioname :TELETYPE) ... allow other keywords for managing what you want to EDit in whatever way you can invoke.
I have code off to the side that replaces the ED menu with a menu of possible names and types, particularly symbols with the same name but in different packages. Before actually trying to correct the spelling. The menu that's there now would be at the bottom of the list.
E.g. (ED 'RESET) would offer SEDIT:RESET as one of the candidates if RESET doesn't exist in the current package.
On Aug 9, 2025, at 2:32 PM, Larry Masinter @.***> wrote:
masinter left a comment (Interlisp/medley#2246) https://github.com/Interlisp/medley/issues/2246#issuecomment-3172110133 I don't think it was an old behavior to prompt with a menu when you've called the editor with an invalid function or other name. I dislike the menu of asking for what kind of thing do you want to create. It would be better to treat this as a DWIM situation, and possibly spell-check the target if it was typein.
Note that the Medley 2.0 release notes try to deprecate other ways of calling the editor of whatever style by using the (Common Lisp and also Interlisp 'ed'... i think it would be better to encourage newcomers to use 'ed' to invoke the editor rather than encouraging the proliferation of two letter functions that handle a subset of the situations that 'ed' seems to generalize.
This is not a bug. The idea that you start a session editing a template might possibly be one of several resolutions of attempting to ED something that wasn't defined.
I suggest we extend ED to cover other cases, e.g., (ED 'functioname :TELETYPE) ... allow other keywords for managing what you want to EDit in whatever way you can invoke.
— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/2246#issuecomment-3172110133, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJORTI6O7H4Y3LSDI233MZSFDAVCNFSM6AAAAACDPQ5MUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZSGEYTAMJTGM. You are receiving this because you are subscribed to this thread.
Let's not confuse ED with EDITF - EDITF has worked the way it currently does since at least 1990, but the documentation says it works differently, prompting with the body template that is the value of DUMMY-EDIT-FUNCTION-BODY (currently (LAMBDA (ARGS |...|) BODY)), if there is no function definition.
ED, ""Standard Common Lisp editor entry" does things differently (with the menu of types for the dummy definition), though it might use the value of DUMMY-EDIT-FUNCTION-BODY for a new FNS definition.
HASDEF is supposed to do spelling correction if the SPELLFLG argument is non-NIL(?)
In fact, EDITF hasn't changed except for the addition of checking for a 'FUNCTIONS definition as well as 'FNS since 1985:
(EDITF
[NLAMBDA EDITFX (* lmm " 2-Sep-85 18:45")
(SETQ EDITFX (NLAMBDA.ARGS EDITFX))
(EDITDEF (if EDITFX
then (PROGN (HASDEF (CAR EDITFX)
(QUOTE FNS)
(QUOTE ?)
EDITFX)
(CAR EDITFX))
else (PROGN (PRIN1 "Editing " T)
(PRINT LASTWORD T)))
(QUOTE FNS)
NIL
(CDR EDITFX])
So I don't understand what function was intended to be responsible for the documented behavior.
I also don't understand why the newer EDITF does separate calls to HASDEF for FNS and FUNCTIONS when HASDEF can take a list of types in priority order for getting a definition - I would expect it to just pass (QUOTE (FNS FUNCTIONS)) where it used to pass (QUOTE FNS). There's a lot going on in HASDEF !
Here is some context on how I stumbled upon the bug and why I think keeping around the old TTY API (EDITF, EDITV, and so on) is helpful.
I'm learning the TTY editor for a number of reasons. It's one of the facilities I hadn't tried yet and it's useful in itself such as for batch editing and in conjunction with Masterscope. Plus it's one of the earliest Interlisp facilities it's possible to check out on Medley without setting up a TENEX environment with INTERLISP-10.
In the absence of complete, up to date documentation of modern Medley the historical documentation, such as the IRM and the book Interlisp: The Language and Its Usage, is a valuable learning resource for the old API. The availability of the API makes this documentation still accurate and useful, and preserves the historical roots of Interlisp.
As a newcomer I found the ED menu helpful as it constrains and enumerates what is possible to define and provides direct ties to File Manager concepts.