[m-rev.] diff: delete the unsafe module from the standard library

Julien Fischer juliensf at csse.unimelb.edu.au
Sat Mar 17 07:58:03 AEDT 2007


Estimated hours taken: 0.1
Branches: main

Delete the unsafe module from the library.

library/unsafe.m:
 	Delete this module since trace goals make it redundant.

library/library.m:
 	Delete the comment regarding the unsafe module.

boehm_gc/libatomic_ops-1.2/.cvsignore:
 	Ignore the autoconf cache in this directory.

Julien.

Index: boehm_gc/libatomic_ops-1.2/.cvsignore
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/boehm_gc/libatomic_ops-1.2/.cvsignore,v
retrieving revision 1.2
diff -u -r1.2 .cvsignore
--- boehm_gc/libatomic_ops-1.2/.cvsignore	23 Feb 2007 04:48:07 -0000	1.2
+++ boehm_gc/libatomic_ops-1.2/.cvsignore	16 Mar 2007 20:55:07 -0000
@@ -4,3 +4,4 @@
  configure
  Makefile
  Makefile.in
+autom4te.cache
Index: library/library.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/library.m,v
retrieving revision 1.102
diff -u -r1.102 library.m
--- library/library.m	1 Feb 2007 08:07:59 -0000	1.102
+++ library/library.m	16 Mar 2007 20:55:07 -0000
@@ -145,12 +145,6 @@
  :- import_module table_builtin.
  :- import_module term_size_prof_builtin.

-% If you need access to unsafe predicates, then in your own workspace,
-% temporarily uncomment this import and the line for unsafe in the definition
-% of mercury_std_library_module.
-
-% :- import_module unsafe.
-
  % library.version must be implemented using pragma foreign_proc,
  % so we can get at the MR_VERSION and MR_FULLARCH configuration
  % parameters.  We can't just generate library.m from library.m.in
Index: library/unsafe.m
===================================================================
RCS file: library/unsafe.m
diff -N library/unsafe.m
--- library/unsafe.m	18 Jan 2007 07:33:05 -0000	1.7
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,93 +0,0 @@
-%-----------------------------------------------------------------------------%
-% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
-%-----------------------------------------------------------------------------%
-% Copyright (C) 1997, 2004-2007 The University of Melbourne.
-% This file may only be copied under the terms of the GNU Library General
-% Public License - see the file COPYING.LIB in the Mercury distribution.
-%-----------------------------------------------------------------------------%
-%
-% File: unsafe.m
-% Author: fjh
-% Stability: low
-%
-% WARNING: the procedures defined in this module are non-logical.
-% They may have side effects, they may violate type safety,
-% they may interfere with certain memory management strategies,
-% and in general they may do lots of nasty things.
-% They may not work with future release of the Mercury compiler,
-% or with other Mercury implementations.
-% Use only as a last resort, and only with great care!
-%
-% You have been warned.
-% 
-%-----------------------------------------------------------------------------%
-%-----------------------------------------------------------------------------%
-
-:- module unsafe.
-:- interface.
-:- import_module io.
-
-    % unsafe_perform_io/1 performs I/O, in an unsafe manner.
-    % It can be used to call a goal that does I/O or has
-    % side effects from a context where you do not have an io.state.
-    % It can be useful for printf-style debugging.
-    % But backtracking over a call to `unsafe_perform_io'
-    % can be very dangerous indeed, because with certain
-    % memory allocation policies it can result in dangling pointers.
-    %
-:- impure pred unsafe_perform_io(pred(io.state, io.state)).
-:- mode unsafe_perform_io(pred(di, uo) is det) is det.
-:- mode unsafe_perform_io(pred(di, uo) is cc_multi) is det.
-
-    % The function unsafe_promise_ground/1 can be used to assert to the
-    % compiler that a particular value of inst `any' is in fact ground.
-    % The assertion is *not* checked.  If it is false, all hell may break out.
-    %
-:- func unsafe_promise_ground(T::in(any)) = (T::out) is det.
-
-%-----------------------------------------------------------------------------%
-%-----------------------------------------------------------------------------%
-
-:- implementation.
-
-%-----------------------------------------------------------------------------%
-
-:- pragma foreign_proc("C",
-    unsafe_promise_ground(X::in(any)) = (Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    Y = X;
-").
-
-%-----------------------------------------------------------------------------%
-
-:- pragma foreign_proc("C",
-    unsafe_perform_io(P::(pred(di, uo) is det)),
-    [may_call_mercury],
-"{
-    call_io_pred_det(P);
-}").
-:- pragma foreign_proc("C",
-    unsafe_perform_io(P::(pred(di, uo) is cc_multi)),
-    [may_call_mercury],
-"{
-    call_io_pred_cc_multi(P);
-}").
-
-:- pred call_io_pred(pred(io.state, io.state), io.state, io.state).
-:- mode call_io_pred(pred(di, uo) is det, di, uo) is det.
-:- mode call_io_pred(pred(di, uo) is cc_multi, di, uo) is cc_multi.
-
-:- pragma foreign_export("C", call_io_pred(pred(di, uo) is det, di, uo),
-    "call_io_pred_det").
-:- pragma foreign_export("IL", call_io_pred(pred(di, uo) is det, di, uo),
-    "call_io_pred_det").
-:- pragma foreign_export("C", call_io_pred(pred(di, uo) is cc_multi, di, uo),
-    "call_io_pred_cc_multi").
-:- pragma foreign_export("IL", call_io_pred(pred(di, uo) is cc_multi, di, uo),
-    "call_io_pred_cc_multi").
-
-call_io_pred(P, !IO) :-
-    P(!IO).
-
-%-----------------------------------------------------------------------------%

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list