Re: [m-users.] Best way to implement constants ?
Volker Wysk <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, Sean
"nano-scale" was a pun, and also the idea I had of nano. I thought it was
called like that because nano is minimalistic.
Your description is interesting. But I will stick with Emacs.
I'd like to add your Mercury mode and your custom formatter hook for nano to
the Mercury Resources List. I'd also like to add other useful projects of
yours. I'm a little lost in the 50 projects you have on Github. Could you
tell me the names of the projects you own, which you think are suitable for
adding to the list? I'll do the rest.
Cheers,
Volker
Am Freitag, dem 18.08.2023 um 15:44 +0100 schrieb Sean Charles
(emacstheviking):
> If by nano-scale you mean 'nano', then yes, that editor. I took a snapshot
> and put it here, I have no ida how long it remains alive:
>
>
> 37SlORCNzgln.pngnano with mercury syntax highlighting - Image on
> Pasteboard
> pasteboard.co
>
>
> I modified the Prolog mode to work a little better with Mercury, it's by
> no means perfect, there are some odd colouring issues when I have a string
> containing certain escape sequences, but bearing in mind nano uses simple
> regex filters to figure out what to colour, I am still very happy with the
> way it works.
>
> I wrote a tool to use the 'formatter hook' in nano, so that, after a
> compile, if there are errors, I just do 'Meta-F' and it inserts the errors
> messages into the source file, as a comment, and the hook I wrote (in
> Mercury) adjusts the errors to work with my syntax highlighting, another
> small image:
>
> Uu5jsXV8YqEX.pngMercury with nano - Image on Pasteboard
> pasteboard.co
>
>
>
> The custom formatter hook is here on
> github: https://github.com/emacstheviking/mercury-pberr
> I have some other stuff that's mercury related there, I think I've
> troubled this list with it before?! :D
>
> Cheers!
>
> --- mercury nano configuration file, ~/.nano/mercury.nanorc ---
> --- BEGIN ---
>
> ## Mercury, ported and adjusted from Prolog mode.
>
> syntax "mercury" "\.m$"
> comment "%"
>
> ## Written in Mercury for Nano+Mercury, this will interleave
> ## a FOO.err file when called from FOO.m via Meta-F (formatter)
> formatter pberr nanoformatter
>
> # Integers and floats
> color yellow "(^| |=)[0-9]+\.?[0-9]*"
>
> # Variables
> color magenta "(^|[[:blank:]]|\(|,)[A-Z_!][a-zA-Z0-
> 9_\.\:]*($|[[:blank:]]|,|\))"
>
> # Anonymous variable '_'
> color yellow "(^|[[:blank:]]|\(|,)_($|[[:blank:]]|,|\))"
>
> # Functions
> color cyan "(^|[[:blank:]])\w+\("
> color cyan "\(|\)|\[|\]|,|=|\\="
>
> # Comments
> color green "(^|[[:blank:]])%.*$"
>
> # Strings
> color yellow "\".*\""
>
> # compiler :-
> color cyan "^:- .*$"
>
> # custom errors for pberr
> color red "^%E.*$"
>
> # Reminders
> color yellow
> "(BUG|DEBUG|FIXME|IDEA|NOTE|REVIEW|TEMP|TODO|WARNING|XXX|TOFU)"
>
> # Spaces in front of tabs
> color ,red " + +"
>
> --- END ---
>
>
>
>
> > On 18 Aug 2023, at 14:35, Volker Wysk <[email protected]> wrote:
> >
> > Am Freitag, dem 18.08.2023 um 14:25 +0100 schrieb Sean Charles
> > (emacstheviking):
> > > LOL! I am a lapsed emacs user of 30 years... vscode stole my
> > > affections,
> > > saying that, I use nano exclusivly for Mercury, I've written a few
> > > tools
> > > to help me out, and all in all, nano is just fine!
> >
> > You mean that nano-scale editor? For real? Does it even have a Mercury
> > (or
> > Prolog) mode with syntax highlighting, like Emacs does?
> >
> > >
> > > > On 18 Aug 2023, at 14:24, Mark Brown <[email protected]> wrote:
> > > >
> > > > On Fri, Aug 18, 2023 at 6:26 PM Sean Charles (emacstheviking)
> > > > <[email protected]> wrote:
> > > > > My question is simple this: is what I have done 'ok' or is it a
> > > > > diabolical insult to all that as beautiful and holy in the Mercury
> > > > > world?
> > > >
> > > > You mean the planet? :-P
> > > >
> > > > To answer your question in general, the measure of what you write
> > > > depends on your intended audience. It's the same for programming as
> > > > it
> > > > is for other kinds of writing. Having said that, I hate it when I
> > > > can't use tags in vim.
> > > >
> > > > Mark
> > >
> > > _______________________________________________
> > > users mailing list
> > > [email protected]
> > > https://lists.mercurylang.org/listinfo/users
> >
> > _______________________________________________
> > users mailing list
> > [email protected]
> > https://lists.mercurylang.org/listinfo/users
>
_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
37SlORCNzgln.png
(image/png, 329.7 KB) - not displayed
Uu5jsXV8YqEX.png
(image/png, 126.6 KB) - not displayed
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmTfiUMACgkQ+K4ydFOs HoWlpxAA1EkPtUd71uUCfGyXsLoDoJXTZFVHiVwPN/XCdhTSFVUlOoTYSdPDAGlK nWk9zBfuBz7x1ll0BEniZi761dmeTtaygT5nVUCOy1L0W5EL+twm4MAgZN9HcD16 G5F41ELrkJIJQCTJ9y9RYgZpAn79d0IchO13VeqBRUwWPTtMvUECswcLvlfRhXjn apLYkUPzSbO0XDuQqg7B8NwIzbjegaHSOEXSsvQlQ/fPa71BOdwZ1sXUMPrlQQtk D1iUziWLwhPaOKN09uiZu2u/R46ax8zRZn7+NHnNu5GXYCuYgb+3B/CWsk8nDmmD Q8EFVv81daKvgVUstcsocz+nsp0d524jHQlxcLQ1z6ZxLJs36qhRcxrhjwlfxxQ4 +1xgMCM5LTX3HNo2zD5/fjkEaoX2mPhZVUa1tZEndQfpSGnE+aXgM0Ft8jBEo+9s L3ihL/SGsax0XIGdnFut8rwRUlc31/aUl13RiRAzr8HElRAzSuPvJItoFcnDXiiS 8Kc3nOOYm8wdb90gSexPLSdb7MDiassdp6vvxdq7b/NC2ufPAR14R9rF6HvC9CrD HvlThLAUsfZzPQwdCR7ADKwdQWinaDosVamHAJ5xuIddhSSTLDRTpBiUYjmXKQoK g3fxwDMQqgB4puXyxq2AUSyzv50ML/V4/gxLprnvNiyXwRvHbnk= =KQeL -----END PGP SIGNATURE-----