emacs-devel
[Top][All Lists]
Advanced

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

Re: Standardized access to a REPL


From: Philip Kaludercic
Subject: Re: Standardized access to a REPL
Date: Sat, 19 Nov 2022 15:03:05 +0000

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> `compiled-prog-mode' that has generic commands for building program,
>>>> `interpreted-prog-mode' that has generic commands for REPL
> [...]
>>    (define-prog-mode foo
>>     :type 'compiled
>
> <soapbox>
> Let me point out that the idea that some languages are compiled and
> others are interpreted is bogus.  This is a property of a language's
> *implementation* and not of the language per se.
> And of course, here we don't even really care about this facet of the
> implementation: you're using those terms as a proxy for whether we use
> a REPL or a batch-compiler.
> </soapbox>
>
> Many languages have both REPLs and batch compilers (like, say ELisp), so
> a major mode needs to be able to offer access to both functionalities at
> the same time.

Good point, that also indicates that that using `derive-major-mode' is
not the right approach, because (AFAIK) major modes span a tree, not a
DAG.

Perhaps it would be better to extend prog-mode and bind keys in the
default map that call methods with the current major mode.  These can
then either implement the methods or indicate that the feature
(evaluating in a REPL when using C) is not supported.

> Regarding the original suggestion to provide a uniform access to a REPL,
> I started on this a long time ago, but never got it "finished" :-(
> I attached what I still have of that effort.

Sounds interesting, I'll take a look at it.



reply via email to

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