Re: [m-users.] Best way to implement constants ?
Volker Wysk <[email protected]>
| Newsgroups | gmane.comp.lang.mercury.general |
|---|---|
| Message-ID | <[email protected]> |
Am Freitag, dem 18.08.2023 um 17:03 +0100 schrieb Sean Charles (emacstheviking): > At last, fame and fortune! :D > > Thanks Volker, that's a goodly sized page you have put together there. This isn't the first effort at something like this. There's the "Packages" website, which is dead now. (https://mercury-in.space/packages/). I've incorporated it all, on a web page on its own, which is linked from the Mercury Ressources page: http://volker-wysk.de/mercury/mmc-get-libs.html Cheers, V.W. > > > > > On 18 Aug 2023, at 17:02, Volker Wysk <[email protected]> wrote: > > > > Cool, thanks. I've updated the list. Your stuff can be found here: > > > > https://volker-wysk.de/mercury/resources.html#sean-charless-mercury-code > > > > Cheers, > > Volker > > > > > > Am Freitag, dem 18.08.2023 um 16:46 +0100 schrieb Sean Charles > > (emacstheviking): > > > There wasn't a repo for the nano thing so I quickly created one, here > > > it is: > > > > > > <mercury-nano-mode.png>emacstheviking/mercury-nano-mode: A simple > > > syntax highlighting scheme > > > for the nano editor to woork with the Mercury programming language. > > > github.com > > > > > > > > > > > > > > > > > > > > > > On 18 Aug 2023, at 16:40, Volker Wysk <[email protected]> wrote: > > > > > > > > Hi! > > > > > > > > Am Freitag, dem 18.08.2023 um 16:24 +0100 schrieb Sean Charles > > > > (emacstheviking): > > > > > I've tried the emacs mode many times but it just doesn't seem to > > > > > work for me, the layout always feels broken and somehow not quite > > > > > right. And that's running a clean emacs with ONLY the mercury mode > > > > > as distributed... is that the one you are using ? > > > > > > > > > > > > Yes, that's the one. The automatic layout only works well, when you > > > > have the same idea about how it should look, as the author of this > > > > mode. I've made a shortcut for inserting a newline, while > > > > circumventing the re-layout that the return key triggers: > > > > > > > > (global-set-key [C-return] (lambda () (interactive) (insert "\n"))) > > > > > > > > > > > > > > As for my Mercury projects, here they, feel free to post them > > > > > wherever you like! > > > > > > > > > > > > Got it, thanks. What about your Mercury mode for nano? > > > > > > > > Cheers, > > > > Volker > > > > > > > > > > > > > > > > > > > > > > > > <mercury-library-samples.png>emacstheviking/mercury-library- > > > > > samples: Some simple working > > > > > samples of the various system suppled Mercury libraries. > > > > > github.com > > > > > > > > > > > > > > > https://github.com/emacstheviking/mercury-rinse-repeat > > > > > > > > > > > > > > > <mercury-pberr.png>emacstheviking/mercury-pberr: A Mercury+Nano > > > > > editor formatter > > > > > plug-in. > > > > > github.com > > > > > > > > > > > > > > > https://github.com/emacstheviking/mcnew > > > > > > > > > > The mcnew one was the first real thing I wrote for myself, I still > > > > > use it. I've tried to use mmc --make etc but not really spent > > > > > enough time to make the switch fully as a lot of my code uses > > > > > external C libraries and I never managed to figure out the lines > > > > > to go in the Mmakefile etc... I have a system that works fone for > > > > > me, > > > > > > > > > > > > > > > > > > > > > On 18 Aug 2023, at 16:07, Volker Wysk <[email protected]> > > > > > > wrote: > > > > > > > > > > > > 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.png>nano 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.png>Mercury 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
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmTfmTYACgkQ+K4ydFOs HoW+iA//Vfvusl1uKhEylOWR3uwIDeQe6OQEujHDiOkfzm+Bh5jV46ye+3HXcdVb oHtV3IbYEK36GXODB1SpWfkLXXCoDsfVWQ0jKY6QnC283VS0PwkF28112fM8wdiT PLQIFUeGA8AV5qWEVrzcIuuPpY5w23xABjRygmUBUqhMN+EXJbeC3w/+09T4iv4C AiJjbP0K9GHaIkQyE6IY+3M1klIcI2Sz3l6FbJUYNAM26HbeE/crBJqfaWslQjo3 Ge9bcDnOvd7GvxU944AT9dmbru8sUMEyIBNsA4ZALCpGLR5kuN/AIf1oOVNKhrSd Sk//m45uXgr1nuFnm+6ROa2GouTXgIqTd+wv6NiwVvO4M9yyxAD8SEAJd+7S5h86 5jdWfUV3LmzFnI9Rag+I31EqiKn0EEV35mb1ut74BzrspAL6eCQwph0MExDgy+QF SYq1B+ZgSXSMesXZcfdNhCEVnl95VNuFMF1AKKbNuH10Wbv5U6V016WCB7mbtl0R 5JqI9Slvbfbt9vBKa2c4J8dIr2e6errXBl8QMypliujO7l1imrIyXciYow+5COmw IlWHXU3MpWw2KMvK3xv6YU6ieAIbISz1uBbhrkDAW+D70WRBsO9RXMAj6YFp1AQw /JfyvZOAuNwxuwD0a9zGokDjMXuy7hCIszAWyA14UZZk8QxSuOE= =IAg8 -----END PGP SIGNATURE-----