In the Mercury standard library, every exported predicate or function
has (or at least *should* have) a comment that documents it, including
the meanings of its arguments. About 35-40% of these modules put `'s
(left and right quotes) around the names of the variable representing
those arguments. Some tried to do it consistently (though there were spots
with unquoted or half quoted names), while some did it only a few places.
This is inconsistent: we should either do it everywhere, or nowhere.
This diff makes it nowhere, because
- this is what the majority of the standard library modules do;
- this is what virtually all of the modules in the compiler, profiler,
deep_profiler etc directories do;
- typing all those quotes when adding new predicates in modules that
follow this convention is a pain in the ass; and because
- on many modern terminals, `' looks non-symmetrical and weird.
Likewise, the comment explaining a predicate often started with
% `predname(arguments)' returns ...
This diff deletes these quotes as well, since they add nothing useful.
This diff does leave in place quotes around code fragments, both terms
and goals, where this helps delineate the boundaries of that fragment.
A call to channel.untake will deadlock if a call to channel.take is
blocked on the same channel.
unGetChan was removed from GHC for the same reason:
https://gitlab.haskell.org/ghc/ghc/issues/4154
library/thread.channel.m:
Deprecate channel.untake/4.
NEWS:
Announce the change.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
NOTE: this change does not affect the io module -- I've left that for a
separate change.
library/*.m:
As per the recent change to the coding standard, avoid module
qualification in library interfaces where possible.
Reformat declarations and descriptive comments to better utilise
any space freed up by the above.
Branches: main
Add predicates from MC's versions of the concurrency modules.
library/thread.channel.m:
Add channel.try_take/4, a non-blocking version of channel.take/4.
library/thread.mvar.m:
Add mvar.try_take/4, a non-blocking version of mvar.take/4.
NEWS:
Announce the additions.
Branches: main
Move more of the concurrency related modules from extras into the standard
library.
library/Mercury.options:
library/library.m:
library/thread.m:
library/thread.channel.m:
library/thread.mvar.m:
library/thread.semaphore.m:
Move the concurrency-related modules `channel', `mvar' and
`semaphore' from extras/concurrency into the standard library.
Make thread.mvar use the standard library module mutvar instead of
providing its own implementation of the same thing.
Replace "ME_" prefixes by "ML_".
library/mutvar.m:
Add predicate `new_mutvar0' which is like `new_mutvar' but does not
require an initial value for the mutvar. This is needed for
thread.mvar.
Define `new_mutvar' in terms of `new_mutvar0' and `set_mutvar'.
runtime/mercury_thread.h:
Make the MR_WAIT macro expand to "(0)" when MR_THREAD_SAFE is not
defined, so it can be used in an expression context. Zero is the
success code for pthread_cond_wait.
extras/concurrency/channel.m:
extras/concurrency/mvar.m:
extras/concurrency/semaphore.m:
Remove these modules.
extras/concurrency/Mercury.options:
extras/concurrency/concurrency.m:
Delete lines pertaining to removed modules.
extras/concurrency/philo.m:
extras/concurrency/philo2.m:
extras/concurrency/philo3.m:
Update to use the standard library modules.
NEWS:
Announce the change.