gm2
[Top][All Lists]
Advanced

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

Re: Portable bitwise operations library (was Re: Portability Considerati


From: Gaius Mulley
Subject: Re: Portable bitwise operations library (was Re: Portability Considerations)
Date: Fri, 22 Mar 2024 13:19:10 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Benjamin Kowarsch <trijezdci@gmail.com> writes:

> Perhaps, I should say a thing or two about the use of ALL-CAPS in identifiers.
>
> Modula-2 is a descendant of Algol and inherited an Algol practice called 
> stropping. When the influential Algol-60 language report was developed, there 
> still
> was no common character set and many platforms did not even have character 
> sets with lowercase characters. In order to write the language report in a
> platform independent way, a convention was introduced by which code was 
> represented in lowercase monospaced font, reserved words in boldface and
> built-in procedures underlined.
>
> However, when actually writing Algol code, there was no boldface character 
> set and thus reserved words needed to be distinguished from identifiers in 
> some
> other way, which was implementation defined. Depending on the available 
> characters on the platform each Algol compiler defined some characters as
> delimiters to mark a reserved word. The most common practice was to use the 
> apostrophe as delimiter.
>
> printed
> if foo = bar then
> became
> 'if' foo = bar 'then'
> in the actual code.
>
> This convention came to be called stropping.
>
> When ASCII arrived on the scene and more and more platforms supported ASCII, 
> some compilers used ALL-CAPS instead to strop reserved words and this
> wasn't just the case with Algol but also adopted by implementations of 
> derivative languages.
>
> One of the compilers/languages where ALL-CAPS were used to strop reserved 
> words was Wirth's Algol-W. Wirth often restored omitted features in a later
> language, so ALL-CAPS stropping was absent in Pascal but brought back in 
> Modula-2.
>
> Thus, all those ALL-CAPS words you see in Modula-2 are actually meant to be 
> lowercase boldface if they are reserved words, or lowercase italic or 
> underlined
> if they are identifiers of built-in procedures/functions.
>
> I had written a source code renderer for Modula-2 which is part of the
> Python Pygments framework and I added an Algol rendering mode to that
> which renders Modula-2 source code in this manner.

indeed and thanks to your analysis/historical recollection of all caps
there is an alpha modula-2 for emacs implementing caps to bold/underline:

https://splendidisolation.ddns.net/Southwales/gaius/web/gm2-mode.html

if you cut n paste the code you will need to replace the all single
quotes with the ' on your keyboard.  Also editing procedure names can
only be done from right to left.  But other than that limitation it
works fine and I'm using it exclusively for all m2 editing.  Shameless
plug - keywords in bold underline look great and modern (it is also
configurable within emacs under Gm2 group customization)

regards,
Gaius



reply via email to

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