[m-users.] How to determine function provenance?

Jeffrey Brown jeffbrown.the at gmail.com
Wed Dec 19 11:46:11 AEDT 2018


Ooh that looks nice.

Is anybody on this list using Emacs and doing that? Emacs appears to offer
three ways to (build? read?) ctags, and also at least two mercury modes. (I
settled on Mercury Metal Mode a while ago after the default somehow didn't
do what I wanted, can't remember now).

On Tue, Dec 18, 2018 at 7:30 PM Zoltan Somogyi <zoltan.somogyi at runbox.com>
wrote:

>
>
> On Tue, 18 Dec 2018 19:01:20 -0500, Jeffrey Brown <jeffbrown.the at gmail.com>
> wrote:
> > Hi! I'm reading through the Mercury libraries. When I do that in Haskell,
> > if I come across a function I don't recognize, there are a few ways to
> > determine where it came from. (For instance you can import everything the
> > library imports into the REPL and then run "?i foo" to find foo's
> > provenance.)
> >
> > In Mmercury, if I could be sure that a line of code defines the function
> > foo if and only if that line starts with the word foo followed by no
> blank
> > space, then I'll just grep the libraries for "^foo". Does that
> > if-and-only-if condition actually hold?
>
> It holds *if* you follow the standard Mercury programming style.
>
> > Is this what y'all do?
>
> No. The Mercury developers use tags files:
>
> https://en.wikipedia.org/wiki/Ctags
>
> The Mercury distribution contains mtags, a tool for building tags files
> for Mercury programs. Once you have run e.g. "mtags *.m", then
> you can jump to the definition of a type, predicate or function
> with a simple command in most editors. For example, when the cursor
> is on the start of a name in vim, the command control-] will jump
> to the definition of whatever entity it names.
>
> Zoltan.
>


-- 
Jeff Brown | Jeffrey Benjamin Brown
Website <https://msu.edu/~brown202/>   |   Facebook
<https://www.facebook.com/mejeff.younotjeff>   |   LinkedIn
<https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often miss
messages here)   |   Github <https://github.com/jeffreybenjaminbrown>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20181218/39634e9e/attachment.html>


More information about the users mailing list