emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ELPA submission: drepl (REPL protocol)


From: João Távora
Subject: Re: ELPA submission: drepl (REPL protocol)
Date: Thu, 2 Nov 2023 14:26:56 +0000

On Wed, Nov 1, 2023 at 6:38 PM Philip Kaludercic <philipk@posteo.net> wrote:
>
> Augusto Stoffel <arstoffel@gmail.com> writes:
>
> > On Tue, 31 Oct 2023 at 09:08, Philip Kaludercic wrote:
> >
> >> The idea seems interesting, I'll have to try it out at some point
> >> (though I don't really use Python or Lua much, so I hope you plan to add
> >> more languages in the future).
>
> > Sure, let me know if you have any ideas.  A good candidate, as I
> > mention in the readme, would be a language that has a good embeddable
> > REPL library that you hack into (as opposed to a program where the
> > REP-loop is more or less hardcoded).
>
> What does a REPL library need, that most languages couldn't implement
> themselves if they have an eval function?
>
> >>  (cl-defgeneric drepl--command (repl)
> >>    "The command to start the REPL interpreter as a list of strings."
> >>    (ignore repl)
> >> -  (error "This needs an implementation"))
> >> +  (error "This needs an implementation")) ;Mention what "this" is
> >
> > _This_ is the method.  This is one of the two things that cannot have a
> > default implementation and should be implemented by every subclass :-).
> > Is the message confusing?
>
> I am just imagining an error message appearing in the mini buffer saying
> "This needs an implementation", without an indication where the error is
> coming from.

Two notes here:

* If this generic is something that anyone else besides drepl.el
  is meant to add methods to, then it shouldn't be a '--' symbol.

* Normally, instead of "error", CL programmers just leave out such
  a default implementation.  The standard "No applicable method" error
  already signals that some generic function was invoked with arguments
  for which  there wasn't an applicable method, and the error message
  contains   information about those arguments.

João



reply via email to

[Prev in Thread] Current Thread [Next in Thread]