Commit Graph

11 Commits

Author SHA1 Message Date
Julien Fischer
e7d28ff90f Update copyright notices in stdlib.
library/*.m:
    As above.
2022-06-07 21:51:03 +10:00
Zoltan Somogyi
8ff61f8a4b Delete quotes from `VarNames' in stdlib comments.
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.
2022-03-07 11:49:00 +11:00
Zoltan Somogyi
06f81f1cf0 Add end_module declarations ...
.. to modules which did not yet have them.
2022-01-09 10:36:15 +11:00
Zoltan Somogyi
0d7c8a7654 Specify pred or func for all pragmas.
*/*.m:
    As above.

configure.ac:
    Require the installed compiler to support this capability.
2021-06-16 15:23:58 +10:00
Peter Wang
5a825d0363 Deprecate thread.channel.untake/4
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.
2020-02-17 11:27:57 +11:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
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.
2018-06-09 17:43:12 +10:00
Zoltan Somogyi
f0ffbbc13c Convert (C->T;E) to (if C then T else E). 2015-12-01 05:35:29 +11:00
Zoltan Somogyi
7f9791aa26 Standardize divider line lengths in the library.
library/*.m:
    As above.

tool/stdlines:
    A new shell script to do the job.
2014-11-23 22:05:34 +11:00
Julien Fischer
bed96b93ff Avoid module qualification in library interfaces where possible.
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.
2014-10-10 15:08:24 +11:00
Peter Wang
f2c8b26695 Add predicates from MC's versions of the concurrency modules.
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.
2007-04-12 04:31:09 +00:00
Peter Wang
f4d5126c1d Move more of the concurrency related modules from extras into the standard
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.
2007-02-01 08:08:00 +00:00