Re: New EEP draft: Pinning operator ^ in patterns

Richard Carlsson <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CANKG3z==pBCEbRTJJb7sV-328oj-otU0KJYbTW625oRR1UDMNw@mail.gmail.com>
Den fre 15 jan. 2021 kl 17:01 skrev Loïc Hoguin <[email protected]>:

> Perhaps this belongs more to the realm of
> editors and syntax highlighting than it does the realm of languages and
> operators. There's no reason this can't be achieved on the editor's side
> of things, at least in the land of IDEs.
>

It can be done, but only in fairly heavyweight tooling. The only way to
know that a variable is already bound at a point is to parse the function
(up to that point at least), and perform the same fairly complicated
analysis of how bindings "flow" in and out of subexpressions as the Erlang
compiler does (and erl_lint). Something like the Erlang Language Server
with Emacs or VSCode could do it. Anything more lightweight, no. You won't
get any help noting the already bound variables when running "git diff" or
looking at a PR on github, or just scrolling through some code in your
terminal.

        /Richard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.