[m-rev.] diff: update lambda syntax

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Nov 5 14:17:11 AEDT 2003


This diff contains no changes in algorithms whatsoever.

browser/*.m:
compiler/*.m:
library/*.m:
	Replace old-style lambdas with new-style lambdas or with named
	procedures.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
Index: browser/frame.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/browser/frame.m,v
retrieving revision 1.5
diff -u -b -r1.5 frame.m
--- browser/frame.m	26 May 2003 08:59:43 -0000	1.5
+++ browser/frame.m	2 Nov 2003 15:11:14 -0000
@@ -59,7 +59,6 @@
 :- import_module string, list, int, io, require.
 :- import_module mdb__util.
 
-
 frame__from_string(Str, [Str]).
 
 	% glue frames vertically (stack). align to left.
@@ -86,12 +85,10 @@
 	% XXX: mmc doesn't yet handle this. Use more verbose version instead.
 	% zip_with(string__append, PaddedLeftFrameNew, RightFrameNew,
 	%	GluedFrame).
-	util__zip_with(
-		lambda([S1::in, S2::in, S3::out] is det,
+	util__zip_with((pred(S1::in, S2::in, S3::out) is det :-
 			string__append(S1,S2,S3)),
 		PaddedLeftFrameNew, RightFrameNew, GluedFrame).
 
-	
 	% Add right padding. That is, add whitespace on right so that
 	% lines are all equal length.
 :- pred frame_right_pad(frame, frame).
@@ -117,7 +114,6 @@
 		error("add_right_padding: list arguments are of unequal length")
 	).
 
-
 	% We need this since Mercury has no Haskell-ese operation sections.
 :- pred subtract(int, int, int).
 :- mode subtract(in, in, out) is det.
@@ -130,7 +126,6 @@
 frame_lower_pad(Frame, PadLines, PaddedFrame) :-
 	list__duplicate(PadLines, "", Padding),
 	list__append(Frame, Padding, PaddedFrame).
-
 
 	% Horizontal size (width) of a frame
 frame__hsize(Frame, HSize) :-
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.50
diff -u -b -r1.50 check_typeclass.m
--- compiler/check_typeclass.m	31 Oct 2003 03:27:20 -0000	1.50
+++ compiler/check_typeclass.m	2 Nov 2003 10:30:37 -0000
@@ -85,33 +85,30 @@
 :- type error_messages == list(error_message).
 
 check_typeclass__check_instance_decls(ModuleInfo0, QualInfo0,
-		ModuleInfo, QualInfo, FoundError, IO0, IO) :-
+		ModuleInfo, QualInfo, FoundError, !IO) :-
 	module_info_classes(ModuleInfo0, ClassTable),
 	module_info_instances(ModuleInfo0, InstanceTable0),
 	map__to_assoc_list(InstanceTable0, InstanceList0),
 	list_map_foldl2(check_one_class(ClassTable), InstanceList0,
 		InstanceList, check_tc_info([], ModuleInfo0, QualInfo0),
-		check_tc_info(Errors, ModuleInfo1, QualInfo),
-		IO0, IO1),
+		check_tc_info(Errors, ModuleInfo1, QualInfo), !IO),
 	(
 		Errors = []
 	->
 		map__from_assoc_list(InstanceList, InstanceTable),
 		module_info_set_instances(InstanceTable,
 			ModuleInfo1, ModuleInfo),
-		IO = IO1,
 		FoundError = no
 	;
 		ModuleInfo = ModuleInfo1,
 		list__reverse(Errors, ErrorList),
-		WriteError = lambda([E::in, TheIO0::di, TheIO::uo] is det,
-			(
+		WriteError = (pred(E::in, IO0::di, IO::uo) is det :-
 				E = ErrorContext - ErrorPieces,
-				write_error_pieces(ErrorContext, 0, 
-					ErrorPieces, TheIO0, TheIO)
-			)),
-		list__foldl(WriteError, ErrorList, IO1, IO2),
-		io__set_exit_status(1, IO2, IO),
+			write_error_pieces(ErrorContext, 0, ErrorPieces,
+				IO0, IO)
+		),
+		list__foldl(WriteError, ErrorList, !IO),
+		io__set_exit_status(1, !IO),
 		FoundError = yes
 	).  
 
@@ -412,13 +409,10 @@
 	InstanceCheckInfo0 = instance_check_info(InstanceDefn0,
 				OrderedMethods0, Errors0, ModuleInfo0,
 				QualInfo0),
-	solutions(
-		lambda([ProcId::out] is nondet, 
-			(
+	solutions((pred(ProcId::out) is nondet :-
 				list__member(ClassProc, ClassInterface),
 				ClassProc = hlds_class_proc(PredId, ProcId)
-			)),
-		ProcIds),
+		), ProcIds),
 	module_info_pred_info(ModuleInfo0, PredId, PredInfo),
 	pred_info_arg_types(PredInfo, ArgTypeVars, ExistQVars, ArgTypes),
 	pred_info_get_class_context(PredInfo, ClassContext0),
@@ -445,9 +439,7 @@
 	PredOrFunc = pred_info_is_pred_or_func(PredInfo),
 	adjust_func_arity(PredOrFunc, Arity, PredArity),
 	pred_info_procedures(PredInfo, ProcTable),
-	list__map(
-		lambda([TheProcId::in, ModesAndDetism::out] is det, 
-			(
+	list__map((pred(TheProcId::in, ModesAndDetism::out) is det :-
 				map__lookup(ProcTable, TheProcId, ProcInfo), 
 				proc_info_argmodes(ProcInfo, Modes),
 				% if the determinism declaration on the method
@@ -459,9 +451,7 @@
 				proc_info_inst_varset(ProcInfo, InstVarSet),
 				ModesAndDetism = modes_and_detism(Modes,
 						InstVarSet, MaybeDetism)
-			)),
-		ProcIds, 
-		ArgModes),
+		), ProcIds, ArgModes),
 	
 	InstanceDefn0 = hlds_instance_defn(_, Status, _, _, InstanceTypes, 
 		_, _, _, _),
@@ -499,7 +489,7 @@
 
 check_instance_pred_procs(ClassId, ClassVars, MethodName, Markers,
 		InstanceDefn0, InstanceDefn, OrderedInstanceMethods0,
-		OrderedInstanceMethods, Info0, Info, IO0, IO) :-
+		OrderedInstanceMethods, Info0, Info, !IO) :-
 	InstanceDefn0 = hlds_instance_defn(InstanceModuleName, B,
 		InstanceContext, InstanceConstraints, InstanceTypes,
 		InstanceBody, MaybeInstancePredProcs, InstanceVarSet, I),
@@ -519,15 +509,12 @@
 			InstanceTypes, InstanceConstraints, 
 			InstanceVarSet, InstanceModuleName,
 			InstancePredDefn, Context,
-			InstancePredId, InstanceProcIds, Info0, Info,
-			IO0, IO),
+			InstancePredId, InstanceProcIds, Info0, Info, !IO),
 
-		MakeClassProc = 
-			lambda([TheProcId::in, PredProcId::out] is det,
-			(
+		MakeClassProc = (pred(TheProcId::in, PredProcId::out) is det :-
 				PredProcId = hlds_class_proc(InstancePredId,
 					TheProcId)
-			)),
+			),
 		list__map(MakeClassProc, InstanceProcIds, InstancePredProcs1),
 		(
 			MaybeInstancePredProcs = yes(InstancePredProcs0),
@@ -566,20 +553,18 @@
 		Heading = 
 			[I1Context - [words("First definition appears here.")],
 			InstanceContext - [words(ErrorHeader)]],
-		list__map(lambda([Definition::in, ContextAndError::out] is det,
-		(
+		list__map((pred(Definition::in, ContextAndError::out) is det :-
 			Definition = instance_method(_, _, _, _, TheContext),
 			Error = [words("Subsequent definition appears here.")],
 			ContextAndError = TheContext - Error
-		)), [I2|Is], SubsequentErrors),
+		), [I2 | Is], SubsequentErrors),
 			
 			% errors are built up in reverse.
 		list__append(SubsequentErrors, Heading, NewErrors),
 		list__append(NewErrors, Errors0, Errors),
 		Info = instance_method_info(ModuleInfo, QualInfo, PredName,
 			Arity, ExistQVars, ArgTypes, ClassContext,
-			ArgModes, Errors, ArgTypeVars, Status, PredOrFunc),
-		IO = IO0
+			ArgModes, Errors, ArgTypeVars, Status, PredOrFunc)
 	;
 		%
 		% undefined method error
@@ -604,8 +589,7 @@
 		Info = instance_method_info(ModuleInfo, QualInfo, PredName,
 			Arity, ExistQVars, ArgTypes, ClassContext,
 			ArgModes, Errors,
-			ArgTypeVars, Status, PredOrFunc),
-		IO = IO0
+			ArgTypeVars, Status, PredOrFunc)
 	).
 
 	%
@@ -677,7 +661,7 @@
 produce_auxiliary_procs(ClassId, ClassVars, Markers0,
 		InstanceTypes0, InstanceConstraints0, InstanceVarSet,
 		InstanceModuleName, InstancePredDefn, Context, PredId,
-		InstanceProcIds, Info0, Info, IO0, IO) :-
+		InstanceProcIds, Info0, Info, !IO) :-
 
 	Info0 = instance_method_info(ModuleInfo0, QualInfo0, PredName,
 		Arity, ExistQVars0, ArgTypes0, ClassMethodClassContext0,
@@ -748,7 +732,7 @@
 	adjust_func_arity(PredOrFunc, Arity, PredArity),
 	produce_instance_method_clauses(InstancePredDefn, PredOrFunc,
 		PredArity, ArgTypes, Markers, Context, Status, ClausesInfo,
-		ModuleInfo0, ModuleInfo1, QualInfo0, QualInfo, IO0, IO),
+		ModuleInfo0, ModuleInfo1, QualInfo0, QualInfo, !IO),
 
 	pred_info_init(InstanceModuleName, PredName, PredArity, ArgTypeVars, 
 		ExistQVars, ArgTypes, Cond, Context, ClausesInfo, Status,
@@ -766,14 +750,13 @@
 		yes(MethodConstraints), PredInfo1, PredInfo2),
 
 		% Add procs with the expected modes and determinisms
-	AddProc = lambda([ModeAndDet::in, NewProcId::out,
-			OldPredInfo::in, NewPredInfo::out] is det,
-	(
+	AddProc = (pred(ModeAndDet::in, NewProcId::out,
+			OldPredInfo::in, NewPredInfo::out) is det :-
 		ModeAndDet = modes_and_detism(Modes, InstVarSet, MaybeDet),
 		add_new_proc(OldPredInfo, InstVarSet, PredArity, Modes,
 			yes(Modes), no, MaybeDet, Context, address_is_taken,
 			NewPredInfo, NewProcId)
-	)),
+	),
 	list__map_foldl(AddProc, ArgModes, InstanceProcIds, 
 		PredInfo2, PredInfo),
 
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.280
diff -u -b -r1.280 code_info.m
--- compiler/code_info.m	27 Oct 2003 05:42:35 -0000	1.280
+++ compiler/code_info.m	2 Nov 2003 10:30:58 -0000
@@ -3598,11 +3598,11 @@
 
 code_info__acquire_temp_slot(Item, StackVar, !CI) :-
 	code_info__get_temps_in_use(!.CI, TempsInUse0),
-	IsTempUsable = lambda([TempContent::in, Lval::out] is semidet, (
+	IsTempUsable = (pred(TempContent::in, Lval::out) is semidet :-
 		TempContent = Lval - ContentType,
 		ContentType = Item,
 		\+ set__member(Lval, TempsInUse0)
-	)),
+	),
 	code_info__get_temp_content_map(!.CI, TempContentMap0),
 	map__to_assoc_list(TempContentMap0, TempContentList),
 	list__filter_map(IsTempUsable, TempContentList, UsableLvals),
Index: compiler/const_prop.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/const_prop.m,v
retrieving revision 1.18
diff -u -b -r1.18 const_prop.m
--- compiler/const_prop.m	26 May 2003 08:59:52 -0000	1.18
+++ compiler/const_prop.m	2 Nov 2003 10:31:18 -0000
@@ -61,10 +61,10 @@
 	predicate_module(ModuleInfo0, PredId, ModuleName),
 	predicate_name(ModuleInfo0, PredId, PredName),
 	proc_id_to_int(ProcId, ProcInt),
-	LookupVarInsts = lambda([V::in, J::out] is det, (
+	LookupVarInsts = (pred(V::in, J::out) is det :-
 		instmap__lookup_var(InstMap, V, VInst),
 		J = V - VInst
-	)),
+	),
 	list__map(LookupVarInsts, Args, ArgInsts),
 	evaluate_builtin_2(ModuleName, PredName, ProcInt, ArgInsts, GoalInfo0,
 		Goal, GoalInfo, ModuleInfo0, ModuleInfo).
Index: compiler/constraint.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/constraint.m,v
retrieving revision 1.51
diff -u -b -r1.51 constraint.m
--- compiler/constraint.m	15 Mar 2003 03:08:43 -0000	1.51
+++ compiler/constraint.m	2 Nov 2003 10:31:58 -0000
@@ -201,10 +201,10 @@
 		list(hlds_goal)::out) is det.
 
 constraint__flatten_constraints(Constraints0, Goals) :-
-	list__map(lambda([Constraint::in, Lists::out] is det, (
+	list__map((pred(Constraint::in, Lists::out) is det :-
 			Constraint = constraint(Goal, _, _, Constructs),
 			Lists = [Constructs, [Goal]]
-	)), Constraints0, GoalLists0),
+		), Constraints0, GoalLists0),
 	list__condense(GoalLists0, GoalLists),
 	list__condense(GoalLists, Goals).
 
@@ -383,9 +383,9 @@
 
 constraint__annotate_conj_constraints(_, [], Constraints0, Goals0, Goals) -->
 	{ constraint__flatten_constraints(Constraints0, Constraints1) },
-	{ list__map(lambda([Goal::in, CnstrGoal::out] is det, (
+	{ list__map((pred(Goal::in, CnstrGoal::out) is det :-
 			CnstrGoal = Goal - []
-		)), Constraints1, Constraints) },
+		), Constraints1, Constraints) },
 	{ list__append(Constraints, Goals0, Goals) }.
 constraint__annotate_conj_constraints(ModuleInfo, 
 		[Conjunct | RevConjuncts0],
Index: compiler/continuation_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/continuation_info.m,v
retrieving revision 1.49
diff -u -b -r1.49 continuation_info.m
--- compiler/continuation_info.m	9 May 2003 05:51:50 -0000	1.49
+++ compiler/continuation_info.m	2 Nov 2003 10:34:36 -0000
@@ -400,12 +400,12 @@
 		% Get all the continuation info from the call instructions.
 	global_data_get_proc_layout(!.GlobalData, PredProcId, ProcLayoutInfo0),
 	Internals0 = ProcLayoutInfo0^internal_map,
-	GetCallInfo = lambda([Instr::in, Call::out] is semidet, (
+	GetCallInfo = (pred(Instr::in, Call::out) is semidet :-
 		Instr = call(Target, label(ReturnLabel), LiveInfo, Context,
 			GoalPath, _) - _Comment,
 		Call = call_info(ReturnLabel, Target, LiveInfo, Context,
 			GoalPath)
-	)),
+	),
 	list__filter_map(GetCallInfo, Instructions, Calls),
 
 		% Process the continuation label info.
@@ -475,19 +475,19 @@
 	set(var_info)::out, map(tvar, set(layout_locn))::out) is det.
 
 continuation_info__convert_return_data(LiveInfos, VarInfoSet, TypeInfoMap) :-
-	GetVarInfo = lambda([LiveLval::in, VarInfo::out] is det, (
+	GetVarInfo = (pred(LiveLval::in, VarInfo::out) is det :-
 		LiveLval = live_lvalue(Lval, LiveValueType, _),
 		VarInfo = var_info(Lval, LiveValueType)
-	)),
+	),
 	list__map(GetVarInfo, LiveInfos, VarInfoList),
-	GetTypeInfo = lambda([LiveLval::in, LiveTypeInfoMap::out] is det, (
+	GetTypeInfo = (pred(LiveLval::in, LiveTypeInfoMap::out) is det :-
 		LiveLval = live_lvalue(_, _, LiveTypeInfoMap)
-	)),
+	),
 	list__map(GetTypeInfo, LiveInfos, TypeInfoMapList),
 	map__init(Empty),
-	list__foldl(lambda([TIM1::in, TIM2::in, TIM::out] is det,
-		map__union(set__intersect, TIM1, TIM2, TIM)),
-		TypeInfoMapList, Empty, TypeInfoMap),
+	list__foldl((pred(TIM1::in, TIM2::in, TIM::out) is det :-
+			map__union(set__intersect, TIM1, TIM2, TIM)
+		), TypeInfoMapList, Empty, TypeInfoMap),
 	set__list_to_set(VarInfoList, VarInfoSet).
 
 :- pred continuation_info__filter_named_vars(list(liveinfo)::in,
@@ -744,12 +744,12 @@
 	proc_info_varset(ProcInfo, VarSet),
 	proc_info_typeinfo_varmap(ProcInfo, TypeInfoMap),
 	map__apply_to_list(TypeVars, TypeInfoMap, TypeInfoLocns),
-	FindLocn = lambda([TypeInfoLocn::in, Locns::out] is det, (
+	FindLocn = (pred(TypeInfoLocn::in, Locns::out) is det :-
 		type_info_locn_var(TypeInfoLocn, TypeInfoVar),
 		(
 			map__search(VarLocs, TypeInfoVar, TypeInfoLvalSet)
 		->
-			ConvertLval = lambda([Locn::out] is nondet, (
+			ConvertLval = (pred(Locn::out) is nondet :-
 				set__member(Lval, TypeInfoLvalSet),
 				(
 					TypeInfoLocn = typeclass_info(_,
@@ -759,7 +759,7 @@
 					TypeInfoLocn = type_info(_),
 					Locn = direct(Lval)
 				)
-			)),
+			),
 			solutions_set(ConvertLval, Locns)
 		;
 			varset__lookup_name(VarSet, TypeInfoVar,
@@ -770,7 +770,7 @@
 				s(VarString)], ErrStr),
 			error(ErrStr)
 		)
-	)),
+	),
 	list__map(FindLocn, TypeInfoLocns, TypeInfoVarLocns),
 	map__from_corresponding_lists(TypeVars, TypeInfoVarLocns,
 		TypeInfoDataMap).
@@ -814,7 +814,7 @@
 	proc_info_varset(ProcInfo, VarSet),
 	proc_info_typeinfo_varmap(ProcInfo, TypeInfoMap),
 	map__apply_to_list(TypeVars, TypeInfoMap, TypeInfoLocns),
-	FindLocn = lambda([TypeInfoLocn::in, Locn::out] is det, (
+	FindLocn = (pred(TypeInfoLocn::in, Locn::out) is det :-
 		(
 			(
 				TypeInfoLocn = typeclass_info(TypeInfoVar,
@@ -839,7 +839,7 @@
 				s(VarString)], ErrStr),
 			error(ErrStr)
 		)
-	)),
+	),
 	list__map(FindLocn, TypeInfoLocns, TypeInfoVarLocns),
 	map__from_corresponding_lists(TypeVars, TypeInfoVarLocns,
 		TypeInfoDataMap).
Index: compiler/dead_proc_elim.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dead_proc_elim.m,v
retrieving revision 1.84
diff -u -b -r1.84 dead_proc_elim.m
--- compiler/dead_proc_elim.m	31 Oct 2003 03:27:21 -0000	1.84
+++ compiler/dead_proc_elim.m	2 Nov 2003 14:18:08 -0000
@@ -259,8 +259,8 @@
 		Needed = Needed0
 	;
 		PredProcIds = yes(Ids),
-		get_class_interface_pred_procs(Ids, Queue0, Queue,
-			Needed0, Needed)
+		list__foldl2(get_class_interface_pred_proc, Ids,
+			Queue0, Queue, Needed0, Needed)
 	).
 
 :- pred get_class_pred_procs(hlds_class_defn, entity_queue, entity_queue,
@@ -269,23 +269,17 @@
 
 get_class_pred_procs(Class, Queue0, Queue, Needed0, Needed) :-
 	Class = hlds_class_defn(_, _, _, _, Methods, _, _),
-	get_class_interface_pred_procs(Methods,
+	list__foldl2(get_class_interface_pred_proc, Methods,
 		Queue0, Queue, Needed0, Needed).
 
-:- pred get_class_interface_pred_procs(list(hlds_class_proc),
-	entity_queue, entity_queue, needed_map, needed_map).
-:- mode get_class_interface_pred_procs(in, in, out, in, out) is det.
+:- pred get_class_interface_pred_proc(hlds_class_proc::in,
+	entity_queue::in, entity_queue::out, needed_map::in, needed_map::out)
+	is det.
 
-get_class_interface_pred_procs(Ids, Queue0, Queue, Needed0, Needed) :-
-	AddHldsClassProc = lambda(
-		[PredProc::in, Q0::in, Q::out, N0::in, N::out] is det,
-		(
-			PredProc = hlds_class_proc(PredId, ProcId),
-			queue__put(Q0, proc(PredId, ProcId), Q),
-			map__set(N0, proc(PredId, ProcId), no, N)
-		)),
-	list__foldl2(AddHldsClassProc, Ids, Queue0, Queue,
-		Needed0, Needed).
+get_class_interface_pred_proc(ClassProc, Queue0, Queue, Needed0, Needed) :-
+	ClassProc = hlds_class_proc(PredId, ProcId),
+	queue__put(Queue0, proc(PredId, ProcId), Queue),
+	map__set(Needed0, proc(PredId, ProcId), no, Needed).
 
 %-----------------------------------------------------------------------------%
 
@@ -642,13 +636,13 @@
 			% conj([]).
 			% XXX this looks fishy to me - zs
 		DestroyGoal =
-			lambda([Id::in, PTable0::in, PTable::out] is det, (
+			(pred(Id::in, PTable0::in, PTable::out) is det :-
 				map__lookup(ProcTable0, Id, ProcInfo0),
 				goal_info_init(GoalInfo),
 				Goal = conj([]) - GoalInfo,
 				proc_info_set_goal(Goal, ProcInfo0, ProcInfo),
 				map__det_update(PTable0, Id, ProcInfo, PTable)
-			)),
+			),
 		list__foldl(DestroyGoal, ProcIds, ProcTable0, ProcTable),
 		pred_info_set_procedures(ProcTable, PredInfo0, PredInfo1),
 		pred_info_set_import_status(imported(interface),
@@ -801,14 +795,14 @@
 		type_spec_info(TypeSpecProcs0, TypeSpecForcePreds0,
 			SpecMap0, PragmaMap0)),
 	set__to_sorted_list(NeededPreds2, NeededPredList2),
-	list__foldl(
-	    lambda([NeededPred::in, AllPreds0::in, AllPreds::out] is det, (
+	list__foldl((pred(NeededPred::in, AllPreds0::in, AllPreds::out)
+		    	is det :-
 		( map__search(SpecMap0, NeededPred, NewNeededPreds) ->
 			set__insert_list(AllPreds0, NewNeededPreds, AllPreds)
 		;
 			AllPreds = AllPreds0
 		)
-	)), NeededPredList2, NeededPreds2, NeededPreds),
+	), NeededPredList2, NeededPreds2, NeededPreds),
 	set__intersect(TypeSpecForcePreds0, NeededPreds, TypeSpecForcePreds),
 
 	module_info_set_type_spec_info(
@@ -928,10 +922,10 @@
 pre_modecheck_examine_goal(if_then_else(_, If, Then, Else) - _) -->
 	list__foldl(pre_modecheck_examine_goal, [If, Then, Else]).
 pre_modecheck_examine_goal(switch(_, _, Cases) - _) -->
-	{ ExamineCase = lambda([Case::in, Info0::in, Info::out] is det, (
+	{ ExamineCase = (pred(Case::in, Info0::in, Info::out) is det :-
 		Case = case(_, Goal),
 		pre_modecheck_examine_goal(Goal, Info0, Info)
-	)) },
+	) },
 	list__foldl(ExamineCase, Cases).
 pre_modecheck_examine_goal(generic_call(_,_,_,_) - _) --> [].
 pre_modecheck_examine_goal(not(Goal) - _) -->
Index: compiler/deforest.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deforest.m,v
retrieving revision 1.32
diff -u -b -r1.32 deforest.m
--- compiler/deforest.m	31 Oct 2003 03:27:21 -0000	1.32
+++ compiler/deforest.m	2 Nov 2003 10:41:30 -0000
@@ -441,10 +441,10 @@
 		{ Goal0 = call(PredId, _ProcId, _Args, _, _, SymName) - _ }, 
 		{ module_info_pred_info(ModuleInfo, PredId, PredInfo) },
 		{ \+ pred_info_is_imported(PredInfo) },
-		{ list__takewhile(lambda([CnstrGoal::in] is semidet, (
+		{ list__takewhile((pred(CnstrGoal::in) is semidet :-
 			CnstrGoal = _ - CnstrGoalInfo,
 			goal_info_has_feature(CnstrGoalInfo, constraint)
-		)), Goals0, Constraints, Goals1) },
+		), Goals0, Constraints, Goals1) },
 		{ Constraints \= [] }
 	->
 		{ prog_out__sym_name_to_string(SymName, SymNameString) },
@@ -580,10 +580,10 @@
 		% Work out which branches of the first goal should
 		% contain unfolded versions of the second goal.
 	GetBranches = 
-	    lambda([VarInfo::in, Branches0::in, Branches::out] is det, (
+		(pred(VarInfo::in, Branches0::in, Branches::out) is det :-
 		VarInfo = _ - Branches1,
 		set__union(Branches0, Branches1, Branches)
-	    )),
+	),
 	set__init(DeforestBranches0),
 	list__foldl(GetBranches, VarAssoc, 
 		DeforestBranches0, DeforestBranches).
@@ -1523,12 +1523,11 @@
 deforest__get_sub_conj_nonlocals(NonLocals0, RevBeforeGoals, BeforeIrrelevant,
 		EarlierGoal, BetweenGoals, MaybeLaterGoal,
 		AfterIrrelevant, AfterGoals, SubConjNonLocals) :-
-	AddGoalNonLocals =
-	    lambda([Goal::in, Vars0::in, Vars::out] is det, (
+	AddGoalNonLocals = (pred(Goal::in, Vars0::in, Vars::out) is det :-
 		Goal = _ - GoalInfo,
 		goal_info_get_nonlocals(GoalInfo, GoalNonLocals),
 		set__union(Vars0, GoalNonLocals, Vars)
-	    )),
+	),
 	list__foldl(AddGoalNonLocals, RevBeforeGoals, NonLocals0, NonLocals1),
 	list__foldl(AddGoalNonLocals, BeforeIrrelevant,
 		NonLocals1, NonLocals2),
Index: compiler/dependency_graph.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dependency_graph.m,v
retrieving revision 1.65
diff -u -b -r1.65 dependency_graph.m
--- compiler/dependency_graph.m	31 Oct 2003 03:27:21 -0000	1.65
+++ compiler/dependency_graph.m	2 Nov 2003 10:42:21 -0000
@@ -847,9 +847,9 @@
 		eqvclass__init(EqvSCCs0),
 		set__init(MergedSCCs),
 		% Make all the SCCs known to the equivalence class.
-		AddElement = lambda([Elem::in, Eqv0::in, Eqv::out] is det, (
+		AddElement = (pred(Elem::in, Eqv0::in, Eqv::out) is det :-
 				eqvclass__new_element(Eqv0, Elem, Eqv)
-			)),
+			),
 		list__foldl(AddElement, SCCTsort, EqvSCCs0, EqvSCCs),
 		dependency_graph__merge_aditi_sccs_2(SCCTsort, ModuleInfo,
 			EqvSCCs, MergedSCCs, NoMerge, SCCRel,
@@ -1042,9 +1042,9 @@
 	dependency_graph__get_scc_entry_points(SCC, HigherSCCs,
 		ModuleInfo, EntryPoints),
 	map__det_insert(SCCPred0, SCCid, SCC - EntryPoints, SCCPred),
-	AddToMap = lambda([PredProcId::in, PS0::in, PS::out] is det, (
+	AddToMap = (pred(PredProcId::in, PS0::in, PS::out) is det :-
 		map__det_insert(PS0, PredProcId, SCCid, PS)
-	)),
+	),
 	list__foldl(AddToMap, SCC, PredSCC0, PredSCC),
 	relation__add_element(SCCRel0, SCCid, _, SCCRel),
 	set__insert_list(AditiPreds0, SCC, AditiPreds),
Index: compiler/dupelim.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dupelim.m,v
retrieving revision 1.57
diff -u -b -r1.57 dupelim.m
--- compiler/dupelim.m	20 Oct 2003 07:29:04 -0000	1.57
+++ compiler/dupelim.m	2 Nov 2003 10:43:00 -0000
@@ -119,8 +119,8 @@
 	;
 		Fixed1 = Fixed0
 	),
-	AddPragmaReferredLabels = lambda(
-		[Instr::in, FoldFixed0::in, FoldFixed::out] is det, (
+	AddPragmaReferredLabels =
+		(pred(Instr::in, FoldFixed0::in, FoldFixed::out) is det :-
 		(
 			Instr = pragma_c(_, _, _,
 				MaybeFixedLabel, MaybeLayoutLabel,
@@ -146,7 +146,7 @@
 		;
 			FoldFixed = FoldFixed0
 		)
-	)),
+	),
 	list__foldl(AddPragmaReferredLabels, Instrs,
 		Fixed1, Fixed2),
 	dupelim__build_maps(Labels, BlockMap, StdMap1, StdMap,
@@ -175,9 +175,9 @@
 			% The rest of the condition is relatively expensive,
 			% so don't do it if there aren't at least two labels
 			% whose blocks have the same standardized form.
-		IsFallenInto = lambda([Label::in] is semidet, (
+		IsFallenInto = (pred(Label::in) is semidet :-
 			set__member(Label, Fixed)
-		)),
+		),
 		list__filter(IsFallenInto, Labels,
 			FixedLabels, NonFixedLabels),
 		NonFixedLabels = [FirstNonFixed | OtherNonFixed]
Index: compiler/fact_table.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/fact_table.m,v
retrieving revision 1.49
diff -u -b -r1.49 fact_table.m
--- compiler/fact_table.m	24 Oct 2003 06:17:37 -0000	1.49
+++ compiler/fact_table.m	2 Nov 2003 10:44:21 -0000
@@ -417,8 +417,10 @@
 		    % being sorted on the first input mode.
 		    (
 			{ MaybeOutput = yes(OutputStream - StructName) },
-			{ TermToArg = lambda([Term::in,FactArg::out] is semidet,
-				Term = term__functor(FactArg, _, _)) },
+			{ TermToArg =
+				(pred(Term::in,FactArg::out) is semidet :-
+					Term = term__functor(FactArg, _, _)
+			) },
 			{ list__map(TermToArg, Terms, FactArgs) }
 		    ->
 			write_fact_data(FactNum, FactArgs, StructName,
@@ -1645,9 +1647,9 @@
 	},
 	(
 		{ MaybeDataStream = yes(DataStream) },
-		{ list__map(lambda([X::in, Y::out] is det, 
-			X = sort_file_line(_, _, Y)), MatchingFacts,
-			OutputData) },
+		{ list__map((pred(X::in, Y::out) is det :-
+			X = sort_file_line(_, _, Y)
+		), MatchingFacts, OutputData) },
 		write_fact_table_data(FactNum, OutputData, StructName,
 			DataStream)
 	;
@@ -2190,7 +2192,7 @@
 		% if cross-compiling between systems that have different
 		% character representations.
 		string__to_char_list(String, Cs),
-		list__map(lambda([C::in, I::out] is det, char__to_int(C, I)),
+		list__map((pred(C::in, I::out) is det :- char__to_int(C, I)),
 			Cs, Ns)
 	;
 		Key = term__integer(Int)
@@ -3208,7 +3210,7 @@
 
 generate_argument_vars_code(PragmaVars, Types, ModuleInfo, DeclCode, InputCode,
 		OutputCode, SaveRegsCode, GetRegsCode, NumInputArgs) :-
-	list__map(lambda([X::in, Y::out] is det, X = pragma_var(_,_,Y)),
+	list__map((pred(X::in, Y::out) is det :- X = pragma_var(_,_,Y)),
 		PragmaVars, Modes),
 	make_arg_infos(Types, Modes, model_non, ModuleInfo, ArgInfos),
 	generate_argument_vars_code_2(PragmaVars, ArgInfos, Types, ModuleInfo,
Index: compiler/goal_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.89
diff -u -b -r1.89 goal_util.m
--- compiler/goal_util.m	31 Oct 2003 03:27:22 -0000	1.89
+++ compiler/goal_util.m	2 Nov 2003 10:44:39 -0000
@@ -1027,10 +1027,9 @@
 	;
 		error("goal_util__case_to_disjunct - get_arg_insts failed")
 	),
-	InstToUniMode =
-		lambda([ArgInst::in, ArgUniMode::out] is det, (
+	InstToUniMode = (pred(ArgInst::in, ArgUniMode::out) is det :-
 			ArgUniMode = ((ArgInst - free) -> (ArgInst - ArgInst))
-		)),
+		),
 	list__map(InstToUniMode, ArgInsts, UniModes),
 	UniMode = (Inst0 -> Inst0) - (Inst0 -> Inst0),
 	UnifyContext = unify_context(explicit, []),
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.189
diff -u -b -r1.189 handle_options.m
--- compiler/handle_options.m	26 Oct 2003 18:08:23 -0000	1.189
+++ compiler/handle_options.m	2 Nov 2003 10:46:06 -0000
@@ -1485,8 +1485,8 @@
 	reset_grade_options(Options0, Options1),
 	split_grade_string(GradeString, Components),
 	set__init(NoComps),
-	list__foldl2(lambda([CompStr::in, Opts0::in, Opts::out,
-			CompSet0::in, CompSet::out] is semidet, (
+	list__foldl2((pred(CompStr::in, Opts0::in, Opts::out,
+			CompSet0::in, CompSet::out) is semidet :-
 		grade_component_table(CompStr, Comp, CompOpts, MaybeTargets),
 			% Check that the component isn't mentioned
 			% more than once.
@@ -1502,17 +1502,17 @@
 		;
 			Opts = Opts1
 		)
-	)), Components, Options1, Options, NoComps, _FinalComps).
+	), Components, Options1, Options, NoComps, _FinalComps).
 
 :- pred add_option_list(list(pair(option, option_data)), option_table,
 		option_table).
 :- mode add_option_list(in, in, out) is det.
 
 add_option_list(CompOpts, Opts0, Opts) :-
-	list__foldl(lambda([Opt::in, Opts1::in, Opts2::out] is det, (
+	list__foldl((pred(Opt::in, Opts1::in, Opts2::out) is det :-
 		Opt = Option - Data,
 		map__set(Opts1, Option, Data, Opts2)
-	)), CompOpts, Opts0, Opts).
+	), CompOpts, Opts0, Opts).
 
 grade_directory_component(Globals, Grade) :-
 	compute_grade(Globals, Grade0),
@@ -1563,7 +1563,7 @@
 :- mode compute_grade_components(in, out) is det.
 
 compute_grade_components(Options, GradeComponents) :-
-	solutions(lambda([CompData::out] is nondet, (
+	solutions((pred(CompData::out) is nondet :-
 		grade_component_table(Name, Comp, CompOpts, MaybeTargets),
 			% For possible component of the grade string
 			% include it in the actual grade string if all
@@ -1589,7 +1589,7 @@
 			true
 		),
 		CompData = Comp - Name
-	)), GradeComponents).
+	), GradeComponents).
 
 :- pred grade_component_table(string, grade_component,
 		list(pair(option, option_data)), maybe(list(option_data))).
@@ -1771,11 +1771,11 @@
 :- mode reset_grade_options(in, out) is det.
 
 reset_grade_options(Options0, Options) :-
-	aggregate(grade_start_values, lambda([Pair::in, Opts0::in, Opts::out]
-			is det, (
+	aggregate(grade_start_values,
+		(pred(Pair::in, Opts0::in, Opts::out) is det :-
 		Pair = Option - Value,
 		map__set(Opts0, Option, Value, Opts)
-	)), Options0, Options).
+		), Options0, Options).
 
 :- pred grade_start_values(pair(option, option_data)).
 :- mode grade_start_values(out) is multi.
Index: compiler/hlds_goal.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_goal.m,v
retrieving revision 1.109
diff -u -b -r1.109 hlds_goal.m
--- compiler/hlds_goal.m	24 Oct 2003 06:17:38 -0000	1.109
+++ compiler/hlds_goal.m	2 Nov 2003 10:46:48 -0000
@@ -1658,33 +1658,30 @@
 %-----------------------------------------------------------------------------%
 
 goal_list_nonlocals(Goals, NonLocals) :-
-       UnionNonLocals =
-               lambda([Goal::in, Vars0::in, Vars::out] is det, (
+       UnionNonLocals = (pred(Goal::in, Vars0::in, Vars::out) is det :-
                        Goal = _ - GoalInfo,
                        goal_info_get_nonlocals(GoalInfo, Vars1),
                        set__union(Vars0, Vars1, Vars)
-               )),
+               ),
        set__init(NonLocals0),
        list__foldl(UnionNonLocals, Goals, NonLocals0, NonLocals).
 
 goal_list_instmap_delta(Goals, InstMapDelta) :-
-       ApplyDelta =
-               lambda([Goal::in, Delta0::in, Delta::out] is det, (
+       ApplyDelta = (pred(Goal::in, Delta0::in, Delta::out) is det :-
                        Goal = _ - GoalInfo,
                        goal_info_get_instmap_delta(GoalInfo, Delta1),
                        instmap_delta_apply_instmap_delta(Delta0,
                                Delta1, Delta)
-               )),
+               ),
        instmap_delta_init_reachable(InstMapDelta0),
        list__foldl(ApplyDelta, Goals, InstMapDelta0, InstMapDelta).
 
 goal_list_determinism(Goals, Determinism) :-
-       ComputeDeterminism =
-               lambda([Goal::in, Det0::in, Det::out] is det, (
+       ComputeDeterminism = (pred(Goal::in, Det0::in, Det::out) is det :-
                        Goal = _ - GoalInfo,
                        goal_info_get_determinism(GoalInfo, Det1),
                        det_conjunction_detism(Det0, Det1, Det)
-               )),
+               ),
        list__foldl(ComputeDeterminism, Goals, det, Determinism).
 
 goal_list_purity(Goals, Purity) :-
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.93
diff -u -b -r1.93 hlds_module.m
--- compiler/hlds_module.m	31 Oct 2003 03:27:22 -0000	1.93
+++ compiler/hlds_module.m	2 Nov 2003 10:47:58 -0000
@@ -1885,11 +1885,11 @@
 			% insert partially module-qualified versions
 			% of the name into the module:name/arity index
 		get_partial_qualifiers(Module, QualInfo, PartialQuals),
-		list__map_foldl(lambda([AncModule::in, AncModule::out,
-				MNAs0::in, MNAs::out] is det,
-			insert_into_mna_index(AncModule, Name, Arity, PredId,
-					MNAs0, MNAs)),
-			PartialQuals, _, MNA_Index0, MNA_Index1),
+		list__map_foldl((pred(AncModule::in, AncModule::out,
+					MNAs0::in, MNAs::out) is det :-
+				insert_into_mna_index(AncModule, Name, Arity,
+					PredId, MNAs0, MNAs)
+			), PartialQuals, _, MNA_Index0, MNA_Index1),
 
 		AccessibleByPartiallyQualifiedNames = yes
 	;
@@ -1901,7 +1901,6 @@
 		% module:name/arity index
 	insert_into_mna_index(Module, Name, Arity, PredId,
 			MNA_Index1, MNA_Index),
-
 
 	Access = access(AccessibleByUnqualifiedName,
 			AccessibleByPartiallyQualifiedNames),
Index: compiler/hlds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_out.m,v
retrieving revision 1.318
diff -u -b -r1.318 hlds_out.m
--- compiler/hlds_out.m	24 Oct 2003 11:29:40 -0000	1.318
+++ compiler/hlds_out.m	2 Nov 2003 10:49:30 -0000
@@ -305,14 +305,14 @@
 	prog_out__sym_name_to_string(SymName, SymNameString0),
 	( string__contains_char(SymNameString0, '*') ->
 		% We need to protect against the * appearing next to a /
-		Stuff = lambda([Char::in, Str0::in, Str::out] is det, (
+		Stuff = (pred(Char::in, Str0::in, Str::out) is det :-
 			( Char = ('*') ->
 				string__append(Str0, "star", Str)
 			;
 				string__char_to_string(Char, CharStr),
 				string__append(Str0, CharStr, Str)
 			)
-		)),
+		),
 		string__foldl(Stuff, SymNameString0, "", SymNameString)
 	;
 		SymNameString = SymNameString0
@@ -1038,7 +1038,7 @@
 		AppendVarnums, HeadVars, _PredOrFunc, Clause, TypeQual) -->
 
 		% curry the varset for term_io__write_variable/4
-	{ PrintVar = lambda([VarName::in, IO0::di, IO::uo] is det,
+	{ PrintVar = (pred(VarName::in, IO0::di, IO::uo) is det :-
 			term_io__write_variable(VarName, VarSet, IO0, IO)
 		) },
 
@@ -1096,8 +1096,9 @@
 	( { string__contains_char(Verbose, 'm') } ->
 		hlds_out__write_indent(Indent),
 		io__write_string("% Modes for which this clause applies: "),
-		{ list__map(lambda([Mode :: in, ModeInt :: out] is det,
-			proc_id_to_int(Mode, ModeInt)), Modes, ModeInts) },
+		{ list__map((pred(Mode :: in, ModeInt :: out) is det :-
+				proc_id_to_int(Mode, ModeInt)
+			), Modes, ModeInts) },
 		hlds_out__write_intlist(ModeInts),
 		io__write_string("\n")
 	;
@@ -3216,7 +3217,7 @@
 		SubClassVars, VarSet) },
 
 		% curry the varset for term_io__write_variable/4
-	{ PrintVar = lambda([VarName::in, IO0::di, IO::uo] is det,
+	{ PrintVar = (pred(VarName::in, IO0::di, IO::uo) is det :-
 			term_io__write_variable(VarName, VarSet, IO0, IO)
 		) },
 	hlds_out__write_indent(Indent),
@@ -3289,7 +3290,7 @@
 	),
 
 		% curry the varset for term_io__write_variable/4
-	{ PrintTerm = lambda([TypeName::in, IO0::di, IO::uo] is det,
+	{ PrintTerm = (pred(TypeName::in, IO0::di, IO::uo) is det :-
 			mercury_output_term(TypeName, VarSet,
 				AppendVarnums, IO0, IO)
 		) },
@@ -3305,9 +3306,11 @@
 	io__nl,
 
 	hlds_out__write_indent(Indent),
-	(	{ Body = abstract },
+	(
+		{ Body = abstract },
 		io__write_string("% abstract")
-	;	{ Body = concrete(Methods) },
+	;
+		{ Body = concrete(Methods) },
 		io__write_string("% Instance Methods: "),
 		mercury_output_instance_methods(Methods)
 	),
Index: compiler/hlds_pred.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_pred.m,v
retrieving revision 1.134
diff -u -b -r1.134 hlds_pred.m
--- compiler/hlds_pred.m	31 Oct 2003 03:27:23 -0000	1.134
+++ compiler/hlds_pred.m	2 Nov 2003 10:50:02 -0000
@@ -2253,11 +2253,10 @@
 				% or in a typeclass_info. Either get the
 				% type_info variable or the typeclass_info
 				% variable
-			LookupVar = lambda([TVar::in, TVarVar::out] is det,
-				(
+			LookupVar = (pred(TVar::in, TVarVar::out) is det :-
 					map__lookup(TVarMap, TVar, Locn),
 					type_info_locn_var(Locn, TVarVar)
-				)),
+				),
 			list__map(LookupVar, TypeVars, TypeInfoVars0),
 
 			proc_info_get_typeinfo_vars_2(Vars, VarTypes, TVarMap,
@@ -2311,12 +2310,12 @@
 	proc_info_argmodes(ProcInfo, ArgModes),
 	proc_info_vartypes(ProcInfo, VarTypes),
 	assoc_list__from_corresponding_lists(HeadVars, ArgModes, HeadVarModes),
-	IsInstChanged = lambda([VarMode::in, Var::out] is semidet, (
+	IsInstChanged = (pred(VarMode::in, Var::out) is semidet :-
 		VarMode = Var - Mode,
 		map__lookup(VarTypes, Var, Type),
 		mode_get_insts(ModuleInfo, Mode, Inst1, Inst2),
 		\+ inst_matches_binding(Inst1, Inst2, Type, ModuleInfo)
-	)),
+	),
 	list__filter_map(IsInstChanged, HeadVarModes, ChangedInstHeadVars).
 
 proc_info_uninstantiated_head_vars(ModuleInfo, ProcInfo,
@@ -2325,12 +2324,12 @@
 	proc_info_argmodes(ProcInfo, ArgModes),
 	proc_info_vartypes(ProcInfo, VarTypes),
 	assoc_list__from_corresponding_lists(HeadVars, ArgModes, HeadVarModes),
-	IsInstUnchanged = lambda([VarMode::in, Var::out] is semidet, (
+	IsInstUnchanged = (pred(VarMode::in, Var::out) is semidet :-
 		VarMode = Var - Mode,
 		map__lookup(VarTypes, Var, Type),
 		mode_get_insts(ModuleInfo, Mode, Inst1, Inst2),
 		inst_matches_binding(Inst1, Inst2, Type, ModuleInfo)
-	)),
+	),
 	list__filter_map(IsInstUnchanged, HeadVarModes, UnchangedInstHeadVars).
 
 proc_interface_should_use_typeinfo_liveness(PredInfo, ProcId, Globals,
Index: compiler/intermod.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.150
diff -u -b -r1.150 intermod.m
--- compiler/intermod.m	31 Oct 2003 03:27:24 -0000	1.150
+++ compiler/intermod.m	2 Nov 2003 10:51:03 -0000
@@ -1537,11 +1537,11 @@
 		% order they came in, so that the all the modes get the
 		% same proc_id in the importing modules.
 	{ CompareProcId =
-		 lambda([ProcId1::in, ProcId2::in, Result::out] is det, (
+		(pred(ProcId1::in, ProcId2::in, Result::out) is det :-
 			proc_id_to_int(ProcId1, ProcInt1),
 			proc_id_to_int(ProcId2, ProcInt2),
 			compare(Result, ProcInt1, ProcInt2)
-		)) },
+		) },
 	{ list__sort(CompareProcId, ProcIds, SortedProcIds) },
 	intermod__write_pred_modes(Procs, qualified(Module, Name),
 					PredOrFunc, SortedProcIds),
@@ -1644,11 +1644,9 @@
 		(
 			% Pull the foreign code out of the goal.
 			{ Goal = conj(Goals) - _ },
-			{ list__filter(
-				lambda([X::in] is semidet, (
+			{ list__filter((pred(X::in) is semidet :-
 				    X = foreign_proc(_,_,_,_,_,_,_) - _
-				)),
-				Goals, [ForeignCodeGoal]) },
+				), Goals, [ForeignCodeGoal]) },
 			{ ForeignCodeGoal = foreign_proc(Attributes,
 				_, _, Vars, Names, _, PragmaCode) - _ }
 		;
@@ -2249,10 +2247,10 @@
 	( { UnusedArgs = yes } ->
 		read_optimization_interfaces(no, ModuleName, [ModuleName],
 				set__init, [], LocalItems, no, UAError),
-		{ IsPragmaUnusedArgs = lambda([Item::in] is semidet, (
+		{ IsPragmaUnusedArgs = (pred(Item::in) is semidet :-
 					Item = pragma(PragmaType) - _,
 					PragmaType = unused_args(_,_,_,_,_)
-				)) },
+			) },
 		{ list__filter(IsPragmaUnusedArgs, LocalItems, PragmaItems) },
 
 		{ module_imports_get_items(Module1, Items2) },
Index: compiler/liveness.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/liveness.m,v
retrieving revision 1.125
diff -u -b -r1.125 liveness.m
--- compiler/liveness.m	24 Oct 2003 06:17:40 -0000	1.125
+++ compiler/liveness.m	2 Nov 2003 11:29:24 -0000
@@ -1568,7 +1568,7 @@
 			FirstVarsList, FirstVarNames),
 		list__map(varset__lookup_name(VarSet),
 			RestVarsList, RestVarNames),
-		Pad = lambda([S0::in, S::out] is det,
+		Pad = (pred(S0::in, S::out) is det :-
 			string__append(S0, " ", S)),
 		list__map(Pad, FirstVarNames, PaddedFirstNames),
 		list__map(Pad, RestVarNames, PaddedRestNames),
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.218
diff -u -b -r1.218 llds_out.m
--- compiler/llds_out.m	24 Oct 2003 06:17:40 -0000	1.218
+++ compiler/llds_out.m	2 Nov 2003 11:29:40 -0000
@@ -453,9 +453,9 @@
 
 output_c_module_init_list(ModuleName, Modules, Datas, StackLayoutLabels,
 		DeclSet0, DeclSet) -->
-	{ MustInit = lambda([Module::in] is semidet, (
+	{ MustInit = (pred(Module::in) is semidet :-
 		module_defines_label_with_layout(Module, StackLayoutLabels)
-	)) },
+	) },
 	{ list__filter(MustInit, Modules,
 		AlwaysInitModules, MaybeInitModules) },
 	{ list__chunk(AlwaysInitModules, 40, AlwaysInitModuleBunches) },
Index: compiler/magic.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/magic.m,v
retrieving revision 1.39
diff -u -b -r1.39 magic.m
--- compiler/magic.m	31 Oct 2003 03:27:24 -0000	1.39
+++ compiler/magic.m	2 Nov 2003 11:30:29 -0000
@@ -345,8 +345,7 @@
 	;
 		% Add errors for context procedures which are mutually
 		% recursive with other procedures.
-		solutions(
-			lambda([ProcAndContext::out] is nondet, (
+		solutions((pred(ProcAndContext::out) is nondet :-
 				list__member(ContextProc, SCC),
 				ContextProc = proc(ContextPredId, _),
 				module_info_pred_info(ModuleInfo,
@@ -357,13 +356,12 @@
 				pred_info_context(ContextPredInfo,
 					Context),
 				ProcAndContext = ContextProc - Context
-			)), ContextProcs),
-		list__map(
-			lambda([BadContextProc::in, Error::out] is det, (
+			), ContextProcs),
+		list__map((pred(BadContextProc::in, Error::out) is det :-
 				BadContextProc = TheContextProc - TheContext,
 				Error = mutually_recursive_context(
 					TheContextProc, SCC) - TheContext
-			)), ContextProcs, ContextErrors),
+			), ContextProcs, ContextErrors),
 		set__insert_list(Errors0, ContextErrors, Errors1)
 	},
 	{
@@ -585,10 +583,10 @@
 	{ partition_args(ModuleInfo, ArgModes, ArgTypes, InputTypes, _) },
 	{ construct_higher_order_type((pure), predicate, (aditi_bottom_up),
 		InputTypes, Type) },
-	{ GetOutputMode = lambda([ArgMode::in, OutputMode::out] is det, (
+	{ GetOutputMode = (pred(ArgMode::in, OutputMode::out) is det :-
 			mode_get_insts(ModuleInfo, ArgMode, _, OutputInst),
 			OutputMode = (free -> OutputInst)
-		)) },
+		) },
 	{ list__map(GetOutputMode, InputModes, InputRelModes) },
  	{ Inst = ground(unique, higher_order(pred_inst_info(predicate, 
 				InputRelModes, nondet))) },
@@ -1595,10 +1593,10 @@
 		{ set__to_sorted_list(GoalVars0, GoalVars) },
 		magic_info_get_proc_info(ProcInfo),
 		{ proc_info_vartypes(ProcInfo, VarTypes) },
-		{ IsAditiVar = lambda([Var::in] is semidet, (
+		{ IsAditiVar = (pred(Var::in) is semidet :-
 					map__lookup(VarTypes, Var, Type),
 					type_is_aditi_state(Type)
-				)) },
+			) },
 		{ list__filter(IsAditiVar, GoalVars, IllegalNonLocals) },
 		( { IllegalNonLocals = [] } ->
 			[]
Index: compiler/magic_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/magic_util.m,v
retrieving revision 1.33
diff -u -b -r1.33 magic_util.m
--- compiler/magic_util.m	31 Oct 2003 03:27:24 -0000	1.33
+++ compiler/magic_util.m	2 Nov 2003 11:31:28 -0000
@@ -293,14 +293,15 @@
 	construct_type(qualified(unqualified("aditi"), "state") - 0,
 		[], StateType),
 	( list__nth_member_search(ArgTypes, StateType, StateIndex) ->
-		AdjustAttr = lambda([Attr0::in, Attr::out] is det, (
+		AdjustAttr = (pred(Attr0::in, Attr::out) is det :-
 			( Attr0 < StateIndex ->
 				Attr = Attr0
 			; Attr0 > StateIndex ->
 				Attr = Attr0 - 1
 			;
-	 			error("base relation indexed on aditi__state attribute")
-			))),
+	 			error("base relation indexed on " ++
+					"aditi__state attribute")
+			)),
 		list__map(AdjustAttr, Attrs0, Attrs)	
 	;
 		error("magic_util__adjust_index: no aditi__state in base relation argument types")
@@ -1062,8 +1063,7 @@
 	{ proc_info_vartypes(ProcInfo, VarTypes) },
 	{ map__apply_to_list(SuppOutputArgs, VarTypes, SuppOutputTypes) },  
 
-	{ GetSuppMode = 
-	    lambda([Var::in, Mode::out] is det, (
+	{ GetSuppMode = (pred(Var::in, Mode::out) is det :-
 		( instmap_delta_search_var(Delta, Var, NewInst) ->
 			Mode = (free -> NewInst)
 		;
@@ -1074,7 +1074,7 @@
 			% procedure will be reported there.
 			Mode = (ground(shared, none) -> ground(shared, none))
 		)
-	    )) },
+	) },
 	{ list__map(GetSuppMode, SuppOutputArgs, SuppOutputModes) },
 	magic_util__check_args(SuppOutputArgs, SuppOutputModes,
 		SuppOutputTypes, Context, var_name),
@@ -1212,10 +1212,10 @@
 		),
 
 		{ ConvertError = 
-			lambda([ErrorType::in, MagicError::out] is det, (
+			(pred(ErrorType::in, MagicError::out) is det :-
 				MagicError = argument_error(ErrorType,
 						ArgId, PredProcId) - Context
-			)) },
+			) },
 		{ list__map(ConvertError, ErrorTypeList, TypeErrors) },
 
 		( { TypeErrors = [] } ->
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.449
diff -u -b -r1.449 make_hlds.m
--- compiler/make_hlds.m	31 Oct 2003 03:27:24 -0000	1.449
+++ compiler/make_hlds.m	2 Nov 2003 15:31:14 -0000
@@ -1273,9 +1273,9 @@
 			module_info_type_spec_info(ModuleInfo3, TypeSpecInfo0),
 			TypeSpecInfo0 = type_spec_info(ProcsToSpec0,
 				ForceVersions0, SpecMap0, PragmaMap0),
-			list__map(lambda([ProcId::in, PredProcId::out] is det, (
+			list__map((pred(ProcId::in, PredProcId::out) is det :-
 					PredProcId = proc(PredId, ProcId)
-				)), ProcIds, PredProcIds),
+				), ProcIds, PredProcIds),
 			set__insert_list(ProcsToSpec0, PredProcIds,
 				ProcsToSpec),
 			set__insert(ForceVersions0, NewPredId, ForceVersions),
@@ -3243,7 +3243,7 @@
 :- mode check_for_overlapping_instances(in, in, in, di, uo) is det.
 
 check_for_overlapping_instances(NewInstanceDefn, InstanceDefns, ClassId) -->
-	{ IsOverlapping = lambda([(Context - OtherContext)::out] is nondet, (
+	{ IsOverlapping = (pred((Context - OtherContext)::out) is nondet :-
 		NewInstanceDefn = hlds_instance_defn(_, _Status, Context,
 				_, Types, Body, _, VarSet, _),
 		Body \= abstract, % XXX
@@ -3255,7 +3255,7 @@
 		varset__merge(VarSet, OtherVarSet, OtherTypes,
 				_NewVarSet, NewOtherTypes),
 		type_list_subsumes(Types, NewOtherTypes, _)
-	)) },
+	) },
 	aggregate(IsOverlapping,
 		report_overlapping_instance_declaration(ClassId)).
 
@@ -4182,9 +4182,8 @@
 		->
 			term__term_list_to_var_list(Args, HeadVars),
 			preds_add_implicit_for_assertion(HeadVars,
-					!.ModuleInfo, PredicateTable0,
-					ModuleName, PredName, Arity, Status,
-					Context, PredOrFunc,
+				!.ModuleInfo, PredicateTable0, ModuleName,
+				PredName, Arity, Status, Context, PredOrFunc,
 					PredId, PredicateTable1),
 			module_info_set_predicate_table(PredicateTable1,
 				!ModuleInfo)
@@ -5497,11 +5496,11 @@
 	(
 		{ PragmaImpl = ordinary(C_Code, _) },
 		{ c_code_to_name_list(C_Code, C_CodeList) },
-		{ solutions(lambda([Name::out] is nondet, (
+		{ solutions((pred(Name::out) is nondet :-
 				list__member(yes(Name - _), ArgInfo),
 				\+ string__prefix(Name, "_"),
 				\+ list__member(Name, C_CodeList)
-			)), UnmentionedVars) },
+			), UnmentionedVars) },
 		( { UnmentionedVars = [] } ->
 			[]
 		;
@@ -5520,12 +5519,12 @@
 		{ c_code_to_name_list(FirstCode, FirstCodeList) },
 		{ c_code_to_name_list(LaterCode, LaterCodeList) },
 		{ c_code_to_name_list(SharedCode, SharedCodeList) },
-		{ solutions(lambda([Name::out] is nondet, (
+		{ solutions((pred(Name::out) is nondet :-
 				list__member(yes(Name - Mode), ArgInfo),
 				mode_is_input(ModuleInfo, Mode),
 				\+ string__prefix(Name, "_"),
 				\+ list__member(Name, FirstCodeList)
-			)), UnmentionedInputVars) },
+			), UnmentionedInputVars) },
 		( { UnmentionedInputVars = [] } ->
 			[]
 		;
@@ -5538,13 +5537,13 @@
 			io__write_string("not occur in the first " ++
 				LangStr ++ " code.\n ")
 		),
-		{ solutions(lambda([Name::out] is nondet, (
+		{ solutions((pred(Name::out) is nondet :-
 				list__member(yes(Name - Mode), ArgInfo),
 				mode_is_output(ModuleInfo, Mode),
 				\+ string__prefix(Name, "_"),
 				\+ list__member(Name, FirstCodeList),
 				\+ list__member(Name, SharedCodeList)
-			)), UnmentionedFirstOutputVars) },
+			), UnmentionedFirstOutputVars) },
 		( { UnmentionedFirstOutputVars = [] } ->
 			[]
 		;
@@ -5559,13 +5558,13 @@
 				LangStr ++ " code or the shared " ++ LangStr ++
 				" code.\n ")
 		),
-		{ solutions(lambda([Name::out] is nondet, (
+		{ solutions((pred(Name::out) is nondet :-
 				list__member(yes(Name - Mode), ArgInfo),
 				mode_is_output(ModuleInfo, Mode),
 				\+ string__prefix(Name, "_"),
 				\+ list__member(Name, LaterCodeList),
 				\+ list__member(Name, SharedCodeList)
-			)), UnmentionedLaterOutputVars) },
+			), UnmentionedLaterOutputVars) },
 		( { UnmentionedLaterOutputVars = [] } ->
 			[]
 		;
@@ -5694,7 +5693,7 @@
 	% start with "_" or "DCG_", and don't have the same name as any
 	% variable in QuantVars (i.e. weren't explicitly quantified).
 
-	{ solutions(lambda([Var::out] is nondet, (
+	{ solutions((pred(Var::out) is nondet :-
 		  	list__member(Var, GoalVars),
 			\+ set__member(Var, NonLocals),
 			varset__search_name(VarSet, Var, Name),
@@ -5704,7 +5703,7 @@
 				set__member(QuantVar, QuantVars),
 				varset__search_name(VarSet, QuantVar, Name)
 			)
-		)), SingletonVars) },
+		), SingletonVars) },
 
 	% if there were any such variables, issue a warning
 
@@ -5731,12 +5730,12 @@
 	% goal (i.e. are not singleton) and have a variable name that starts
 	% with "_".
 
-	{ solutions(lambda([Var2::out] is nondet, (
+	{ solutions((pred(Var2::out) is nondet :-
 		  	list__member(Var2, GoalVars),
 			set__member(Var2, NonLocals),
 			varset__search_name(VarSet, Var2, Name2),
 			string__prefix(Name2, "_")
-		)), MultiVars) },
+		), MultiVars) },
 
 	% if there were any such variables, issue a warning
 
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.293
diff -u -b -r1.293 mercury_compile.m
--- compiler/mercury_compile.m	31 Oct 2003 03:27:25 -0000	1.293
+++ compiler/mercury_compile.m	2 Nov 2003 11:34:53 -0000
@@ -3139,10 +3139,9 @@
 	module_info_pred_info(HLDS0, PredId, PredInfo),
 	( hlds_pred__pred_info_is_aditi_relation(PredInfo) ->
 		ProcIds = pred_info_procids(PredInfo),
-		AddProc = 
-		    lambda([ProcId::in, Preds0::in, Preds::out] is det, (
+		AddProc = (pred(ProcId::in, Preds0::in, Preds::out) is det :-
 			set__insert(Preds0, proc(PredId, ProcId), Preds)
-		    )),
+		),
 		list__foldl(AddProc, ProcIds, AditiPreds0, AditiPreds)
 	;
 		AditiPreds = AditiPreds0
Index: compiler/mode_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mode_util.m,v
retrieving revision 1.155
diff -u -b -r1.155 mode_util.m
--- compiler/mode_util.m	24 Oct 2003 06:17:44 -0000	1.155
+++ compiler/mode_util.m	2 Nov 2003 11:41:08 -0000
@@ -955,16 +955,16 @@
 	),
 	(
 		ConsId = cons(ConsName, Arity),
-		GetCons = lambda([Ctor::in] is semidet, (
+		GetCons = (pred(Ctor::in) is semidet :-
 				Ctor = ctor(_, _, ConsName, CtorArgs),
 				list__length(CtorArgs, Arity)
-			)),
+			),
 		list__filter(GetCons, Constructors, [Constructor])
 	->
 		Constructor = ctor(_ExistQVars, _Constraints, _Name, Args),
-		GetArgTypes = lambda([CtorArg::in, ArgType::out] is det, (
+		GetArgTypes = (pred(CtorArg::in, ArgType::out) is det :-
 				CtorArg = _ArgName - ArgType
-			)),
+			),
 		list__map(GetArgTypes, Args, ArgTypes),
 		propagate_types_into_inst_list(ArgTypes, Subst,
 			ModuleInfo, ArgInsts0, ArgInsts),
@@ -1673,11 +1673,10 @@
 			% change.
 			FinalInst = InitialInst
 		),
-		UniModeToRhsMode =
-			 lambda([UMode::in, Mode::out] is det, (
+		UniModeToRhsMode = (pred(UMode::in, Mode::out) is det :-
 				UMode = ((_ - Inst0) -> (_ - Inst)),
 				Mode = (Inst0 -> Inst)
-			)),
+			),
 		list__map(UniModeToRhsMode, UniModes, Modes),
 		instmap_delta_from_mode_list([Var | Vars],
 			[(InitialInst -> FinalInst) |  Modes],
Index: compiler/modecheck_unify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modecheck_unify.m,v
retrieving revision 1.64
diff -u -b -r1.64 modecheck_unify.m
--- compiler/modecheck_unify.m	24 Oct 2003 06:17:44 -0000	1.64
+++ compiler/modecheck_unify.m	2 Nov 2003 11:42:12 -0000
@@ -349,11 +349,10 @@
 				Det, RHS0, Unification0, Mode,
 				RHS, Unification, ModeInfo12, ModeInfo)
 	;
-		list__filter(lambda([Var :: in] is semidet,
-			( instmap__lookup_var(InstMap1, Var, Inst),
+		list__filter((pred(Var :: in) is semidet :-
+				instmap__lookup_var(InstMap1, Var, Inst),
 			  \+ inst_is_ground(ModuleInfo2, Inst)
-			)),
-			NonLocalsList, NonGroundNonLocals),
+			), NonLocalsList, NonGroundNonLocals),
 		( NonGroundNonLocals = [BadVar | _] ->
 			instmap__lookup_var(InstMap1, BadVar, BadInst),
 			set__singleton_set(WaitingVars, BadVar),
Index: compiler/module_qual.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/module_qual.m,v
retrieving revision 1.87
diff -u -b -r1.87 module_qual.m
--- compiler/module_qual.m	25 Jul 2003 02:27:22 -0000	1.87
+++ compiler/module_qual.m	2 Nov 2003 14:52:29 -0000
@@ -899,11 +899,10 @@
 qualify_pragma(X at foreign_code(_, _), X, Info, Info) --> [].
 qualify_pragma(X at foreign_type(_, _, _, _, _), X, Info, Info) --> [].
 qualify_pragma(X at foreign_import_module(_, _), X, Info, Info) --> [].
-qualify_pragma(
-	    foreign_proc(Rec, SymName, PredOrFunc, PragmaVars0, Varset, Code),
-	    foreign_proc(Rec, SymName, PredOrFunc, PragmaVars, Varset, Code), 
-		Info0, Info) -->
-	qualify_pragma_vars(PragmaVars0, PragmaVars, Info0, Info).
+qualify_pragma(X, Y, Info0, Info) -->
+	{ PragmaVars0 = X ^ proc_vars },
+	qualify_pragma_vars(PragmaVars0, PragmaVars, Info0, Info),
+	{ Y = X ^ proc_vars := PragmaVars }.
 qualify_pragma(tabled(A, B, C, D, MModes0), tabled(A, B, C, D, MModes), 
 	Info0, Info) --> 
 	(
@@ -1064,11 +1063,11 @@
 		Ms = M0s
 	;
 		sym_name_get_module_name(ClassName, unqualified(""), Module),
-		Qualify = lambda([M0::in, M::out] is det, (
+		Qualify = (pred(M0::in, M::out) is det :-
 			M0 = instance_method(A, Method0, C, D, E),
 			add_module_qualifier(Module, Method0, Method),
 			M = instance_method(A, Method, C, D, E)
-		)),
+		),
 		list__map(Qualify, M0s, Ms)
 	).
 
@@ -1659,12 +1658,11 @@
 			% third, take the intersection of the sets computed
 			% in the first two steps
 			%
-			FindMatch =
-				lambda([MatchModule::out] is nondet, (
+			FindMatch = (pred(MatchModule::out) is nondet :-
 				    list__member(MatchModule,
 				    	AllMatchingModules),
 				    set__member(MatchModule, DefiningModules)
-				)),
+			),
 			solutions(FindMatch, MatchingModules)
 		)
 	;
Index: compiler/modules.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.279
diff -u -b -r1.279 modules.m
--- compiler/modules.m	20 Oct 2003 07:29:09 -0000	1.279
+++ compiler/modules.m	2 Nov 2003 11:47:23 -0000
@@ -2180,11 +2180,12 @@
 		;
 			[]
 		),
-		{ IsImportedAncestor = lambda([Import::out] is nondet, (
+		{ IsImportedAncestor = (pred(Import::out) is nondet :-
 			list__member(Import, AncestorModules),
 			( list__member(Import, ImportedModules)
 			; list__member(Import, UsedModules)
-			))) },
+			)
+		) },
 		aggregate(IsImportedAncestor,
 			warn_imported_ancestor(ModuleName))
 	;
@@ -3165,9 +3166,9 @@
 		% then take all characters until another whitespace occurs.
 		{ list__takewhile(char__is_whitespace, CharList0, _, 
 			CharList1) },
-		{ NotIsWhitespace = lambda([Char::in] is semidet, (
+		{ NotIsWhitespace = (pred(Char::in) is semidet :-
 			\+ char__is_whitespace(Char)
-		)) },
+		) },
 		{ list__takewhile(NotIsWhitespace, CharList1, CharList, _) },
 		{ string__from_char_list(CharList, FileName0) },
 		{ string__remove_suffix(FileName0, ".trans_opt", FileName) }
@@ -3544,8 +3545,9 @@
 	% only allowed to depend on modules that occur later
 	% than it in the TransOptOrder.
 	%
-	{ FindModule = lambda([OtherModule::in] is semidet, (
-		ModuleName \= OtherModule )) },
+	{ FindModule = (pred(OtherModule::in) is semidet :-
+		ModuleName \= OtherModule
+	) },
 	{ list__takewhile(FindModule, TransOptOrder, _, TransOptDeps0) },
 	( { TransOptDeps0 = [ _ | TransOptDeps1 ] } ->
 		% The module was found in the list
@@ -5767,13 +5769,13 @@
 			% context of the `import_module' or `use_module'
 			% declaration(s), so we need to search the item
 			% list again to find them.
-			{ FindImports = lambda([Item::in] is semidet, (
+			{ FindImports = (pred(Item::in) is semidet :-
 				Item = module_defn(_, ModuleDefn) - _,
 				( ModuleDefn = import(module(Mods))
 				; ModuleDefn = use(module(Mods))
 				),
 				list__member(ImportedModule, Mods)
-			  )) },
+			) },
 			{ list__filter(FindImports, Items, ImportItems) },
 			{ ImportItems = [] ->
 				error("check_parent_module")
Index: compiler/passes_aux.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/passes_aux.m,v
retrieving revision 1.58
diff -u -b -r1.58 passes_aux.m
--- compiler/passes_aux.m	31 Oct 2003 03:27:26 -0000	1.58
+++ compiler/passes_aux.m	2 Nov 2003 13:34:20 -0000
@@ -262,27 +262,27 @@
 :- import_module int, string, map, require, varset.
 
 process_all_nonimported_procs(Task, ModuleInfo0, ModuleInfo) -->
-	{ True = lambda([_PredInfo::in] is semidet, true) },
+	{ True = (pred(_PredInfo::in) is semidet :- true) },
 	process_matching_nonimported_procs(Task, True, 
 		ModuleInfo0, ModuleInfo).
 
 process_all_nonimported_nonaditi_procs(Task, ModuleInfo0, ModuleInfo) -->
-	{ NotAditi = lambda([PredInfo::in] is semidet, (
+	{ NotAditi = (pred(PredInfo::in) is semidet :-
 			\+ hlds_pred__pred_info_is_aditi_relation(PredInfo)
-		)) }, 
+	) }, 
 	process_matching_nonimported_procs(Task, NotAditi, 
 		ModuleInfo0, ModuleInfo).
 
 process_all_nonimported_nonaditi_procs(Task0, Task,
 		ModuleInfo0, ModuleInfo) -->
-	{ NotAditi = lambda([PredInfo::in] is semidet, (
+	{ NotAditi = (pred(PredInfo::in) is semidet :-
 			\+ hlds_pred__pred_info_is_aditi_relation(PredInfo)
-		)) }, 
+	) }, 
 	process_matching_nonimported_procs(Task0, Task, NotAditi, 
 		ModuleInfo0, ModuleInfo).
 
 process_all_nonimported_procs(Task0, Task, ModuleInfo0, ModuleInfo) -->
-	{ True = lambda([_PredInfo::in] is semidet, true) },
+	{ True = (pred(_PredInfo::in) is semidet :- true) },
 	process_matching_nonimported_procs(Task0, Task, True, 
 		ModuleInfo0, ModuleInfo).
 
Index: compiler/pd_cost.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_cost.m,v
retrieving revision 1.16
diff -u -b -r1.16 pd_cost.m
--- compiler/pd_cost.m	26 May 2003 09:00:04 -0000	1.16
+++ compiler/pd_cost.m	2 Nov 2003 11:48:50 -0000
@@ -136,8 +136,7 @@
 	;
 		Cost0 = 0
 	),
-	list__filter(
-		lambda([X::in] is semidet,
+	list__filter((pred(X::in) is semidet :-
 			set__member(X, NonLocals)
 		), Args, NonLocalArgs),
 	list__length(NonLocalArgs, NumAssigns),
Index: compiler/pd_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_debug.m,v
retrieving revision 1.7
diff -u -b -r1.7 pd_debug.m
--- compiler/pd_debug.m	15 Mar 2003 03:09:04 -0000	1.7
+++ compiler/pd_debug.m	2 Nov 2003 11:49:39 -0000
@@ -101,11 +101,11 @@
 
 pd_debug__register_version(PredProcId, Version) -->
 	pd_info_get_module_info(ModuleInfo),
-	{ Register = lambda([IO0::di, IO::uo] is det, (
+	{ Register = (pred(IO0::di, IO::uo) is det :-
 		io__write_string("Registering version:\n", IO0, IO1),
 		pd_debug__output_version(ModuleInfo, PredProcId, Version,
 			no, IO1, IO)
-		)) },
+	) },
 	pd_debug__do_io(Register).
 
 %-----------------------------------------------------------------------------%
Index: compiler/pd_term.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_term.m,v
retrieving revision 1.6
diff -u -b -r1.6 pd_term.m
--- compiler/pd_term.m	26 May 2003 09:00:05 -0000	1.6
+++ compiler/pd_term.m	2 Nov 2003 11:49:54 -0000
@@ -140,8 +140,9 @@
 	Info0 = global_term_info(SingleGoalCover0, MultipleGoalCover0),
 	(
 		EarlierGoal = call(PredId1, ProcId1, _, _, _, _) - _,
-		Hd = lambda([List::in, Head::out] is semidet, 
-			List = [Head | _]),
+		Hd = (pred(List::in, Head::out) is semidet :-
+			List = [Head | _]
+		),
 		expand_calls(Hd, Versions, proc(PredId1, ProcId1), 
 			FirstPredProcId),
 		(
Index: compiler/pd_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pd_util.m,v
retrieving revision 1.28
diff -u -b -r1.28 pd_util.m
--- compiler/pd_util.m	31 Oct 2003 03:27:26 -0000	1.28
+++ compiler/pd_util.m	2 Nov 2003 11:51:22 -0000
@@ -171,10 +171,10 @@
 
 pd_util__goal_get_calls(Goal0, CalledPreds) :-
 	goal_to_conj_list(Goal0, GoalList),
-	GetCalls = lambda([Goal::in, CalledPred::out] is semidet, (
+	GetCalls = (pred(Goal::in, CalledPred::out) is semidet :-
 			Goal = call(PredId, ProcId, _, _, _, _) - _,
 			CalledPred = proc(PredId, ProcId)
-		)),
+		),
 	list__filter_map(GetCalls, GoalList, CalledPreds).
 
 %-----------------------------------------------------------------------------%
@@ -594,17 +594,17 @@
 pd_util__get_branch_instmap_deltas(switch(_, _, Cases) - _,
 		InstMapDeltas) :-
 	GetCaseInstMapDelta =
-		lambda([Case::in, InstMapDelta::out] is det, (
+		(pred(Case::in, InstMapDelta::out) is det :-
 			Case = case(_, _ - CaseInfo),
 			goal_info_get_instmap_delta(CaseInfo, InstMapDelta)
-		)),
+		),
 	list__map(GetCaseInstMapDelta, Cases, InstMapDeltas).
 pd_util__get_branch_instmap_deltas(disj(Disjuncts) - _, InstMapDeltas) :-
 	GetDisjunctInstMapDelta =
-		lambda([Disjunct::in, InstMapDelta::out] is det, (
+		(pred(Disjunct::in, InstMapDelta::out) is det :-
 			Disjunct = _ - DisjInfo,
 			goal_info_get_instmap_delta(DisjInfo, InstMapDelta)
-		)),
+		),
 	list__map(GetDisjunctInstMapDelta, Disjuncts, InstMapDeltas).
 
 
@@ -629,9 +629,10 @@
 pd_util__get_branch_vars(ModuleInfo, Goal, [InstMapDelta | InstMapDeltas], 
 		InstMap, BranchNo, ExtraVars0, ExtraVars) :-
 	AddExtraInfoVars = 
-	    lambda([ChangedVar::in, Vars0::in, Vars::out] is det, (
+		(pred(ChangedVar::in, Vars0::in, Vars::out) is det :-
 		(
-			instmap__lookup_var(InstMap, ChangedVar, VarInst),
+				instmap__lookup_var(InstMap, ChangedVar,
+					VarInst),
 			instmap_delta_search_var(InstMapDelta, 
 				ChangedVar, DeltaVarInst),
 		    	inst_is_bound_to_functors(ModuleInfo, 
@@ -648,7 +649,7 @@
 		;
 			Vars = Vars0
 		)
-	    )),
+		),
 	instmap_delta_changed_vars(InstMapDelta, ChangedVars),
 	set__to_sorted_list(ChangedVars, ChangedVarsList),
 	list__foldl(AddExtraInfoVars, ChangedVarsList, ExtraVars0, ExtraVars1),
@@ -1002,8 +1003,9 @@
 	% Check that the goal produces a superset of the outputs of the
 	% version we are searching for. 
 	%
-	Search = lambda([K1::in, V1::out] is semidet,
-			map__search(OldNewRenaming, K1, V1)),
+	Search = (pred(K1::in, V1::out) is semidet :-
+			map__search(OldNewRenaming, K1, V1)
+	),
 	list__map(Search, OldArgs, NewArgs),
 	NewGoal = _ - NewGoalInfo,
 	goal_info_get_nonlocals(NewGoalInfo, NewNonLocals),
@@ -1100,7 +1102,7 @@
 		assoc_list__from_corresponding_lists(OldArgs, 
 			NewArgs, ONArgsList),
 		MapInsert =
-			lambda([KeyValue::in, Map0::in, Map::out] is semidet, (
+			(pred(KeyValue::in, Map0::in, Map::out) is semidet :-
 				KeyValue = Key - Value,
 				( map__search(Map0, Key, Value0) ->
 					Value = Value0,
@@ -1108,7 +1110,7 @@
 				;
 					map__det_insert(Map0, Key, Value, Map)
 				)
-			)),
+			),
 		list__foldl(MapInsert, ONArgsList, ONRenaming0, ONRenaming1)
 	;
 		(
Index: compiler/pragma_c_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/pragma_c_gen.m,v
retrieving revision 1.63
diff -u -b -r1.63 pragma_c_gen.m
--- compiler/pragma_c_gen.m	31 Oct 2003 03:27:27 -0000	1.63
+++ compiler/pragma_c_gen.m	2 Nov 2003 11:51:47 -0000
@@ -823,8 +823,8 @@
 		;
 			Treat = automatic,
 			\+ pred_info_requested_no_inlining(PredInfo),
-			CountSemis = lambda([Char::in, Count0::in, Count::out]
-				is det,
+			CountSemis = (pred(Char::in, Count0::in, Count::out)
+					is det :-
 				( Char = (;) ->
 					Count = Count0 + 1
 				;
Index: compiler/prog_io_pragma.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_io_pragma.m,v
retrieving revision 1.60
diff -u -b -r1.60 prog_io_pragma.m
--- compiler/prog_io_pragma.m	31 Oct 2003 03:27:28 -0000	1.60
+++ compiler/prog_io_pragma.m	2 Nov 2003 14:18:57 -0000
@@ -763,14 +763,14 @@
 parse_pragma_type(ModuleName, "inline", PragmaTerms, ErrorTerm,
 		_VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "inline",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = inline(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "no_inline", PragmaTerms, ErrorTerm,
 		_VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "no_inline",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = no_inline(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -790,7 +790,7 @@
 parse_pragma_type(ModuleName, "obsolete", PragmaTerms, ErrorTerm,
 		_VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "obsolete",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = obsolete(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -889,7 +889,7 @@
 parse_pragma_type(ModuleName, "reserve_tag", PragmaTerms, ErrorTerm,
 		_VarSet, Result) :-
 	parse_simple_type_pragma(ModuleName, "reserve_tag",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = reserve_tag(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -923,14 +923,14 @@
 
 parse_pragma_type(ModuleName, "aditi", PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "aditi",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = aditi(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "base_relation", PragmaTerms, 
 		ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "base_relation",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = base_relation(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -980,41 +980,41 @@
 
 parse_pragma_type(ModuleName, "naive", PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "naive",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = naive(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "psn", PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "psn",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = psn(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "aditi_memo",
 		PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "aditi_memo",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = aditi_memo(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "aditi_no_memo",
 		PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "aditi_no_memo",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = aditi_no_memo(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "supp_magic", 
 		PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "supp_magic",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = supp_magic(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "context",
 		PragmaTerms, ErrorTerm, _, Result) :-
 	parse_simple_pragma(ModuleName, "context",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = context(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -1023,7 +1023,7 @@
 	( PragmaTerms = [SymNameAndArityTerm, OwnerTerm] ->
 	    ( OwnerTerm = term__functor(term__atom(Owner), [], _) ->
 		parse_simple_pragma(ModuleName, "owner",
-			lambda([Name::in, Arity::in, Pragma::out] is det,
+			(pred(Name::in, Arity::in, Pragma::out) is det :-
 				Pragma = owner(Name, Arity, Owner)),
 			[SymNameAndArityTerm], ErrorTerm, Result)
 	    ;
@@ -1038,14 +1038,14 @@
 parse_pragma_type(ModuleName, "promise_pure", PragmaTerms, ErrorTerm,
 		_VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "promise_pure",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = promise_pure(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "promise_semipure", PragmaTerms, ErrorTerm,
 		_VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "promise_semipure",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = promise_semipure(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -1098,21 +1098,21 @@
 parse_pragma_type(ModuleName, "terminates", PragmaTerms,
 				ErrorTerm, _VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "terminates",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = terminates(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "does_not_terminate", PragmaTerms,
 				ErrorTerm, _VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "does_not_terminate",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = does_not_terminate(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
 parse_pragma_type(ModuleName, "check_termination", PragmaTerms,
 				ErrorTerm, _VarSet, Result) :-
 	parse_simple_pragma(ModuleName, "check_termination",
-		lambda([Name::in, Arity::in, Pragma::out] is det,
+		(pred(Name::in, Arity::in, Pragma::out) is det :-
 			Pragma = check_termination(Name, Arity)),
 		PragmaTerms, ErrorTerm, Result).
 
@@ -1631,9 +1631,9 @@
 
 convert_int_list(ListTerm, Result) :-
 	convert_list(ListTerm,
-		lambda([Term::in, Int::out] is semidet, (
+		(pred(Term::in, Int::out) is semidet :-
 			Term = term__functor(term__integer(Int), [], _)
-		)), Result).
+		), Result).
 
 	%
 	% convert_list(T, P, M) will convert a term T into a list of
Index: compiler/prog_io_typeclass.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_io_typeclass.m,v
retrieving revision 1.28
diff -u -b -r1.28 prog_io_typeclass.m
--- compiler/prog_io_typeclass.m	15 Mar 2003 03:09:07 -0000	1.28
+++ compiler/prog_io_typeclass.m	2 Nov 2003 12:44:21 -0000
@@ -201,15 +201,13 @@
 			% Convert the list of terms into a list of 
 			% maybe1(class_method)s.
 	->
-		list__map(lambda([MethodTerm::in, Method::out] is det, 
-			(
+		list__map((pred(MethodTerm::in, Method::out) is det :-
 				% Turn the term into an item
-			parse_decl(ModuleName, VarSet, MethodTerm, Item),
+				parse_decl(ModuleName, VarSet, MethodTerm,
+					Item),
 				% Turn the item into a class_method
 			item_to_class_method(Item, MethodTerm, Method)
-			)),
-			MethodList,
-			Interface),
+			), MethodList, Interface),
 		find_errors(Interface, Result)
 	;
 		Result = error("expected list of class methods", Methods)
@@ -487,8 +485,7 @@
 			% check that the type in the name of the instance 
 			% decl is a functor with vars as args
 		list__map(convert_type, TermTypes0, TermTypes),
-		IsFunctorAndVarArgs = lambda([Type::in] is semidet,
-			(
+		IsFunctorAndVarArgs = (pred(Type::in) is semidet :-
 					% Is the top level functor an atom?
 				Type = term__functor(term__atom(Functor),
 						Args, _),
@@ -500,21 +497,20 @@
 					Args = [_Module, Type1],
 						% Is the top level functor an
 						% atom?
-					Type1 = term__functor(term__atom(_), 
-							Args1, _),
+				Type1 = term__functor(term__atom(_), Args1, _),
 						% Are all the args of the
 						% functor variables?
-					list__map(lambda([A::in, B::out] 
-							is semidet, 
-						type_util__var(A,B)), Args1, _)
+				list__map((pred(A::in, B::out) is semidet :-
+					type_util__var(A, B)
+				), Args1, _)
 				;
 						% Are all the args of the
 						% functor variables?
-					list__map(lambda([A::in, B::out] 
-							is semidet, 
-						type_util__var(A,B)), Args, _)
+				list__map((pred(A::in, B::out) is semidet :-
+					type_util__var(A, B)
+				), Args, _)
 				)
-			)),
+		),
 		list__filter(IsFunctorAndVarArgs, TermTypes, _,
 			ErroneousTypes),
 		(
Index: compiler/prog_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/prog_util.m,v
retrieving revision 1.64
diff -u -b -r1.64 prog_util.m
--- compiler/prog_util.m	20 Oct 2003 07:29:10 -0000	1.64
+++ compiler/prog_util.m	2 Nov 2003 12:44:34 -0000
@@ -503,13 +503,13 @@
 		string__format("%d__%d", [i(Line), i(Counter)], PredIdStr)
 	;
 		NewPredId = type_subst(VarSet, TypeSubst),
-		SubstToString = lambda([SubstElem::in, SubstStr::out] is det, (
+		SubstToString = (pred(SubstElem::in, SubstStr::out) is det :-
 			SubstElem = Var - Type,
 			varset__lookup_name(VarSet, Var, VarName),
 			TypeString = mercury_type_to_string(VarSet, Type),
 			string__append_list([VarName, " = ", TypeString],
 				SubstStr)
-		)),
+		),
 		list_to_string(SubstToString, TypeSubst, PredIdStr)
 	;
 		NewPredId = unused_args(Args),
Index: compiler/rl.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl.m,v
retrieving revision 1.25
diff -u -b -r1.25 rl.m
--- compiler/rl.m	24 Oct 2003 06:17:47 -0000	1.25
+++ compiler/rl.m	2 Nov 2003 12:44:49 -0000
@@ -774,11 +774,10 @@
 %-----------------------------------------------------------------------------%
 
 rl__ascending_sort_spec(Schema, Attrs) :-
-	GetAttr =
-		lambda([_::in, Attr::out, Index0::in, Index::out] is det, (
+	GetAttr = (pred(_::in, Attr::out, Index0::in, Index::out) is det :-
 			Attr = Index0 - ascending,
 			Index = Index0 + 1
-		)),
+		),
 	list__map_foldl(GetAttr, Schema, Attrs, 1, _).
 
 rl__attr_list(Schema, Attrs) :-
Index: compiler/rl_analyse.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_analyse.m,v
retrieving revision 1.4
diff -u -b -r1.4 rl_analyse.m
--- compiler/rl_analyse.m	15 Mar 2003 03:09:08 -0000	1.4
+++ compiler/rl_analyse.m	2 Nov 2003 12:45:08 -0000
@@ -175,11 +175,10 @@
 		Predecessors) },
 	{ map__lookup(BlockDataMap0, BlockId, BlockData0) },
 	
-	{ GetOutValues =
-	    lambda([Node::in, NodeAndOValue::out] is det, (
+	{ GetOutValues = (pred(Node::in, NodeAndOValue::out) is det :-
 		map__lookup(BlockDataMap0, Node, block_data(_, OutValue, _)),
 		NodeAndOValue = Node - OutValue
-	    )) },
+	) },
 	{ list__map(GetOutValues, Predecessors, OutPredecessors) },
 
 	%
Index: compiler/rl_block.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_block.m,v
retrieving revision 1.5
diff -u -b -r1.5 rl_block.m
--- compiler/rl_block.m	26 May 2003 09:00:07 -0000	1.5
+++ compiler/rl_block.m	2 Nov 2003 12:46:59 -0000
@@ -179,18 +179,17 @@
 
 		% Initially, all non-initial nodes dominate all other
 		% non-initial nodes.
-	{ Initialise = 
-	    lambda([Node::in, Dom0::in, Dom::out] is det, (
+	{ Initialise = (pred(Node::in, Dom0::in, Dom::out) is det :-
 		 set_dominating_nodes(Dom0, Node, NonInitialNodes, Dom)
-	    )) },
+	) },
 	{ list__foldl(Initialise, NonInitialNodeList,
 		Dominators1, Dominators2) },
 
-	{ SinglePass =
-	    lambda([Dom0::in, Dom::out, Changed::out] is det, (
-		list__foldl(rl_block__get_dominator_info_single_pass(FlowGraph),
+	{ SinglePass = (pred(Dom0::in, Dom::out, Changed::out) is det :-
+		list__foldl(
+			rl_block__get_dominator_info_single_pass(FlowGraph),
 			NonInitialNodeList, Dom0 - no, Dom - Changed)
-	    )) },	
+	) },	
 	{ compute_to_fixpoint(SinglePass, Dominators2, Dominators) },
 	rl_opt_info_set_dominator_info(Dominators).
 
@@ -209,15 +208,14 @@
 		relation__lookup_key(FlowGraph, PredKey, Pred),
 		lookup_dominating_nodes(Dominators0, Pred,
 			DomByPredecessors0),
-		IntersectPredecessors = 
-		    lambda([PredecessorKey::in, Inter0::in,
-				Inter::out] is det, (
+		IntersectPredecessors = (pred(PredecessorKey::in, Inter0::in,
+				Inter::out) is det :-
 			relation__lookup_key(FlowGraph, PredecessorKey,
 				Predecessor),
 			lookup_dominating_nodes(Dominators0, Predecessor, 
 				PredecessorDom),
 			set__intersect(Inter0, PredecessorDom, Inter)
-		    )),
+		),
 		list__foldl(IntersectPredecessors, PredKeys,
 			DomByPredecessors0, DomByPredecessors),
 		set__insert(DomByPredecessors, Node, NewValue)
@@ -245,8 +243,7 @@
 	{ relation__to_key_assoc_list(FlowGraph, FlowAssocList) },
 		% If the edge is a back edge, find the loop that it closes,
 		% otherwise fail.
-	{ BackEdgeToLoop =
-	    lambda([GraphEdge::in, Loop::out] is semidet, (
+	{ BackEdgeToLoop = (pred(GraphEdge::in, Loop::out) is semidet :-
 		GraphEdge = CallingKey - CalledKey,
 		relation__lookup_key(FlowGraph, CallingKey, CallingNode),
 		relation__lookup_key(FlowGraph, CalledKey, CalledNode),
@@ -265,7 +262,7 @@
 				NodesToProcess1, LoopNodes0, LoopNodes)
 		),
 		Loop = loop(CalledNode, LoopNodes)
-	   )) },
+	) },
 	{ list__filter_map(BackEdgeToLoop, FlowAssocList, Loops) },
 	rl_opt_info_set_loops(Loops).
 
@@ -278,9 +275,8 @@
 		relation__lookup_element(FlowGraph, Node, NodeKey),
 		relation__lookup_to(FlowGraph, NodeKey, Predecessors),
 		set__to_sorted_list(Predecessors, PredecessorList),
-		HandlePredecessor =
-		    lambda([PredecessorKey::in, Info0::in, 
-		    		Info::out] is det, (
+		HandlePredecessor = (pred(PredecessorKey::in, Info0::in, 
+		    		Info::out) is det :-
 		    	Info0 = Nodes0 - Queue0,
 			relation__lookup_key(FlowGraph, PredecessorKey,
 				Predecessor),
@@ -292,7 +288,7 @@
 				queue__put(Queue0, Predecessor, Queue)
 			),
 			Info = Nodes - Queue
-		    )),
+		),
 		list__foldl(HandlePredecessor, PredecessorList, 
 			LoopNodes0 - NodeQueue1, LoopNodes1 - NodeQueue2),
 		rl_block__get_loop(FlowGraph, DominatorInfo, NodeQueue2,
@@ -335,12 +331,11 @@
 		-->
 	rl_opt_info_get_block(BlockId, Block),
 	{ Block = block(_, Instrs, MaybeBranch, _) },
-	{ AddInstrRels =
-		lambda([Instr::in, Rels0::in, Rels::out] is det, (
+	{ AddInstrRels = (pred(Instr::in, Rels0::in, Rels::out) is det :-
 			rl__instr_relations(Instr, Inputs, Outputs),
 			set__insert_list(Rels0, Inputs, Rels1),
 			set__insert_list(Rels1, Outputs, Rels)
-		)) },
+		) },
 	{ set__init(BlockRels0) },
 	{ list__foldl(AddInstrRels, Instrs, BlockRels0, BlockRels1) },
 	{ MaybeBranch = yes(Branch) ->
@@ -734,8 +729,7 @@
 	rl_opt_info_get_rev_block_order(RevOrder, Info0, Info1),
 	list__reverse(RevOrder, Order),
 	rl_opt_info_get_block_map(BlockMap, Info1, Info2),
-	GetInstrs = 
-	    lambda([BlockId::in, Instrs::out] is det, (
+	GetInstrs = (pred(BlockId::in, Instrs::out) is det :-
 		map__lookup(BlockMap, BlockId, 
 			block(MaybeLabel, Instrs0, MaybeBranch, _)),
 		( MaybeBranch = yes(Branch) ->
@@ -748,7 +742,7 @@
 		;
 			Instrs = Instrs1
 		)
-	    )),
+	),
 	list__map(GetInstrs, Order, InstrLists),
 	list__condense(InstrLists, Instructions),
 	rl_opt_info_get_input_relations(Inputs, Info2, Info3),
Index: compiler/rl_block_opt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_block_opt.m,v
retrieving revision 1.10
diff -u -b -r1.10 rl_block_opt.m
--- compiler/rl_block_opt.m	26 May 2003 09:00:08 -0000	1.10
+++ compiler/rl_block_opt.m	2 Nov 2003 12:49:24 -0000
@@ -312,11 +312,11 @@
 		dag_get_node_info_map(NodeInfoMap0),
 		{ map__lookup(NodeInfoMap0, Node, NodeInfo0) },
 		{ NodeInfo0 = node_info(Instr, Outputs0) },
-		{ DeleteOutput = lambda([Output0::in, Output::out] is det, (
+		{ DeleteOutput = (pred(Output0::in, Output::out) is det :-
 				Output0 = output_node(Schema, Index, Set0),
 				set__delete(Set0, RelationId, Set),
 				Output = output_node(Schema, Index, Set)
-			)) },
+			) },
 		{ list__map(DeleteOutput, Outputs0, Outputs) },
 		{ NodeInfo = node_info(Instr, Outputs) },
 		{ map__det_update(NodeInfoMap0, Node, NodeInfo, NodeInfoMap) },
@@ -468,16 +468,16 @@
 
 rl_block_opt__add_node_dependencies(MatchingNode, InputNodes) -->
 	dag_get_output_use_map(Uses0),
-	{ AddDepArc = lambda([OutputId::in, UseMap0::in, UseMap::out] is det, (
+	{ AddDepArc = (pred(OutputId::in, UseMap0::in, UseMap::out) is det :-
 		multi_map__set(UseMap0, OutputId, MatchingNode, UseMap)
-	)) },
+	) },
 	{ list__foldl(AddDepArc, InputNodes, Uses0, Uses) },
 	dag_set_output_use_map(Uses),
 
 	dag_get_node_dep_map(Dep0),
-	{ MMapSet = lambda([Node::in, Depend0::in, Depend::out] is det, (
+	{ MMapSet = (pred(Node::in, Depend0::in, Depend::out) is det :-
 		multi_map__set(Depend0, MatchingNode, Node, Depend)
-	)) },		
+	) },		
 	{ list__foldl(MMapSet, InputNodes, Dep0, Dep) },
 	dag_set_node_dep_map(Dep).
 
@@ -755,9 +755,9 @@
 	( { multi_map__search(Dep0, Node, UsedNodes) } ->
 		{ multi_map__det_replace(Dep0, Node, [], Dep) },
 		{ list__foldl(
-			lambda([Use::in, UseMap0::in, UseMap::out] is det, (
+			(pred(Use::in, UseMap0::in, UseMap::out) is det :-
 				multi_map__delete(UseMap0, Use, Node, UseMap)
-			)), UsedNodes, Uses0, Uses) },
+			), UsedNodes, Uses0, Uses) },
 		dag_set_output_use_map(Uses),
 		dag_set_node_dep_map(Dep)
 	;		
@@ -782,11 +782,11 @@
 	( { map__search(Deps, OldNode, UsedNodes) } ->
 		dag_get_output_use_map(Uses0),
 		{ list__foldl(
-			lambda([Use::in, UseMap0::in, UseMap::out] is det, (
+			(pred(Use::in, UseMap0::in, UseMap::out) is det :-
 				multi_map__delete(UseMap0,
 					Use, OldNode, UseMap1),
 				multi_map__set(UseMap1, Use, NewNode, UseMap)
-			)), UsedNodes, Uses0, Uses) },
+			), UsedNodes, Uses0, Uses) },
 		dag_set_output_use_map(Uses)
 	;
 		[]
@@ -975,13 +975,12 @@
 
                 dag_get_output_use_map(Uses0),
                 { multi_map__lookup(Uses0, Input, InputUses0) },
-                { list__filter(
-                    lambda([NodeId::in] is semidet, (
+                { list__filter((pred(NodeId::in) is semidet :-
                         \+ (
                                 list__member(Project, Projects),
                                 Project = output_projection(NodeId, _, _, _)
                         )
-                    )), InputUses0, InputUses) },
+                ), InputUses0, InputUses) },
 		{ multi_map__det_replace(Uses0, Input,
 			[NewNode | InputUses], Uses) },
 		dag_set_output_use_map(Uses),
@@ -1195,11 +1194,10 @@
 	% Find out which of the non-locals are evaluated by this block.
 	dag_get_rel_node_map(RelNodeMap),
 	dag_get_output_loc_map(Locs),
-	{ IsProducedNonLocal =
-		lambda([Rel::in, Node::out] is semidet, (
+	{ IsProducedNonLocal = (pred(Rel::in, Node::out) is semidet :-
 			map__search(RelNodeMap, Rel, OutputId),
 			map__lookup(Locs, OutputId, input_node(Node, _))
-		)) },
+	) },
 
 	{ list__filter_map(IsProducedNonLocal, LiveAtEnd,
 		RequiredNodes0) },
@@ -1215,7 +1213,7 @@
 		error("rl_block_opt__deconstruct_dag: relation__tsort failed")
 	},
 	{ list__filter(
-		lambda([X::in] is semidet, set__member(X, RequiredNodes)),
+		(pred(X::in) is semidet :- set__member(X, RequiredNodes)),
 		NodeSort1, NodeSort) },
 	{ map__init(NodeRels) },
 	rl_block_opt__evaluate_nodes(NodeSort, LiveAtEnd0,
@@ -1242,19 +1240,17 @@
 		dag_get_output_loc_map(Locs),
 		{ map__search(Dep, Node, NeededOutputs) ->
 			GetNode = 
-				lambda([OutputId::in, OutputNode::out] is det,
-				(
+				(pred(OutputId::in, OutputNode::out) is det :-
 					map__lookup(Locs, OutputId,
 						input_node(OutputNode, _))
-				)),
+				),
 			list__map(GetNode, NeededOutputs, SubNodes),
 			list__append(SubNodes, Nodes0, Nodes1),
 			AddDep =
-				lambda([DepNode::in, Rel0::in, Rel::out] is det,
-				(
+				(pred(DepNode::in, Rel0::in, Rel::out) is det :-
 					relation__add_values(Rel0,
 						Node, DepNode, Rel)
-				)),
+				),
 			list__foldl(AddDep, SubNodes, NodeRel0, NodeRel1)
 		;
 			Nodes1 = Nodes0,
@@ -1348,10 +1344,9 @@
 		list(rl_instruction)::out) is det.
 
 rl_block_opt__get_ref_instrs(RelationId, OutputList, RefInstrs) :-
-	GetRefInstr =
-	    lambda([OtherOutput::in, Instr::out] is det, (
+	GetRefInstr = (pred(OtherOutput::in, Instr::out) is det :-
 		Instr = ref(OtherOutput, RelationId) - ""
-	    )),
+	),
 	list__map(GetRefInstr, OutputList, RefInstrs).
 
 %-----------------------------------------------------------------------------%
Index: compiler/rl_dump.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_dump.m,v
retrieving revision 1.10
diff -u -b -r1.10 rl_dump.m
--- compiler/rl_dump.m	24 Oct 2003 06:17:47 -0000	1.10
+++ compiler/rl_dump.m	2 Nov 2003 12:50:29 -0000
@@ -40,15 +40,14 @@
 	{ Proc = rl_proc(Name, Inputs, Outputs, MemoedRels,
 			RelationInfo, Instructions, SCC) },
 	io__write_string("% Procedure for\n"),
-	{ OutputProcName = 
-	    lambda([PredProcId::in, IO0::di, IO::uo] is det, (
+	{ OutputProcName = (pred(PredProcId::in, IO0::di, IO::uo) is det :-
 		PredProcId = proc(PredId, _ProcId),
 		module_info_pred_info(ModuleInfo, PredId, PredInfo),
 		PredName = pred_info_name(PredInfo),
 		io__write_string("%\t", IO0, IO1),
 		io__write_string(PredName, IO1, IO2),
 		io__nl(IO2, IO)
-	    )) },
+	) },
 	list__foldl(OutputProcName, SCC),
 	io__write_string("% Memoed relations "),
 	{ set__to_sorted_list(MemoedRels, MemoedList) },
@@ -732,7 +731,7 @@
 		io__state::di, io__state::uo) is det.
 
 rl_dump__write_var_list(VarSet, Vars) -->
-        { PrintVar = lambda([Var::in, IO0::di, IO::uo] is det,
+        { PrintVar = (pred(Var::in, IO0::di, IO::uo) is det :-
 			mercury_output_var(Var, VarSet, yes, IO0, IO)
 		) },
 	rl_dump__write_list(PrintVar, Vars).
Index: compiler/rl_exprn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_exprn.m,v
retrieving revision 1.34
diff -u -b -r1.34 rl_exprn.m
--- compiler/rl_exprn.m	24 Oct 2003 06:17:47 -0000	1.34
+++ compiler/rl_exprn.m	2 Nov 2003 12:50:53 -0000
@@ -2066,8 +2066,7 @@
 	map__init(Labels0),
 	rl_exprn__get_exprn_labels(0, _, Labels0, Labels,
 		ByteTree0, ByteTree1),
-	ResolveAddr =
-		lambda([Code0::in, Code::out] is det, (
+	ResolveAddr = (pred(Code0::in, Code::out) is det :-
 			% This is incomplete, but we don't generate any
 			% of the other jump instructions.
 			( Code0 = rl_EXP_jmp(Label0) ->
@@ -2100,7 +2099,7 @@
 			;
 				Code = Code0
 			)
-		)),
+	),
 	rl_out__resolve_addresses(ResolveAddr, ByteTree1, ByteTree).
 
 :- pred rl_exprn__get_exprn_labels(int::in, int::out, map(label_id, int)::in,
Index: compiler/rl_file.pp
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_file.pp,v
retrieving revision 1.5
diff -u -b -r1.5 rl_file.pp
--- compiler/rl_file.pp	26 May 2003 09:00:08 -0000	1.5
+++ compiler/rl_file.pp	2 Nov 2003 15:58:10 -0000
@@ -128,13 +128,12 @@
 	%
 #if INCLUDE_ADITI_OUTPUT	% See ../Mmake.common.in.
 rl_file__write_binary(ByteWriter, RLFile, Length, IO0, IO) :-
-	Writer =
-	    lambda([Byte::in, Pair0::di, Pair::uo] is det, (
+	Writer = (pred(Byte::in, Pair0::di, Pair::uo) is det :-
 		Pair0 = Len0 - IOState0,
 		Len = Len0 + 1,			
 		call(ByteWriter, Byte, IOState0, IOState),
 	    	Pair = Len - IOState
-	    )),
+	),
 	State0 = 0 - IO0,
 	rl_file__write_binary_2(Writer, RLFile, State0, State),
 	State = Length - IO.
@@ -351,11 +350,10 @@
 		rl_state::di, rl_state::uo) is det.
 
 rl_file__output_bytecodes(Writer, Code) -->
-	{ OutputByteCode =
-		lambda([Instr::in, IO0::di, IO::uo] is det, (
+	{ OutputByteCode = (pred(Instr::in, IO0::di, IO::uo) is det :-
 			bytecode_to_intlist(Instr, IntList),
 			list__foldl(Writer, IntList, IO0, IO)
-		)) },
+	) },
 	list__foldl(OutputByteCode, Code).
 
 %-----------------------------------------------------------------------------%
Index: compiler/rl_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_gen.m,v
retrieving revision 1.13
diff -u -b -r1.13 rl_gen.m
--- compiler/rl_gen.m	24 Oct 2003 06:17:47 -0000	1.13
+++ compiler/rl_gen.m	2 Nov 2003 13:06:36 -0000
@@ -299,12 +299,12 @@
 	% Make sure predicates with `generate_inline' markers (used to
 	% create input relations for calls) do not have code generated for
 	% them, and are not considered to be entry points to the SCC.
-	{ list__filter(lambda([PredProcId::in] is semidet, (
+	{ list__filter((pred(PredProcId::in) is semidet :-
 		PredProcId = proc(PredId, _),
 		module_info_pred_info(ModuleInfo, PredId, PredInfo),
 		pred_info_get_markers(PredInfo, Markers),
 		\+ check_marker(Markers, generate_inline)
-	)), SCC0, SCC) },
+	), SCC0, SCC) },
  
 	rl_info_set_scc(SCC),
 	{ dependency_graph__get_scc_entry_points(SCC, SCCs, 
@@ -435,9 +435,9 @@
 	rl_info_lookup_relation(full - EntryPoint, Output),
 
 	{ set__init(SavedRels) },
-	{ list__map(lambda([Rel::in, OutputRel::out] is det, (
+	{ list__map((pred(Rel::in, OutputRel::out) is det :-
 			OutputRel = output_rel(Rel, [])
-		)), OutputArgs, OutputRels) },
+		), OutputArgs, OutputRels) },
 	{ Instr = call(SubModuleProc, InputArgs, OutputRels, SavedRels) - "" },
 	rl_info_get_relation_info(RelInfo),
 	{ set__init(MemoedRels) },
@@ -1199,7 +1199,7 @@
 
 		% A negated goal must have another call providing 
 		% input to subtract from.
-	{ require(lambda([] is semidet, IsNeg = no), 
+	{ require(unify(IsNeg, no), 
 		"rl_gen__single_call_rule: negated supp or magic call") },
 
 	( { MaybeDiffRel = yes(DiffRel) } ->
@@ -1230,7 +1230,7 @@
 	{ CallInfo2 = db_call(_PredProcId2, IsNeg2,
 		_InputArgs2, OutputArgs2, _GoalInfo2) },
 
-	{ require(lambda([] is semidet, (IsNeg1 = no, IsNeg2 = no)),
+	{ require(unify({IsNeg1, IsNeg2}, {no, no}),
 		"rl_gen__diff_diff_rule: negated differential call") },
 
 	{ rl_gen__get_call_instmap(CallInfo1, CallInfo2, InstMap) },
@@ -1253,7 +1253,7 @@
 	{ CallInfo2 = db_call(_PredProcId2, IsNeg2,
 		_InputArgs2, OutputArgs2, _GoalInfo2) },
 
-	{ require(lambda([] is semidet, (IsNeg1 = no)),
+	{ require(unify(IsNeg1, no),
 		"rl_gen__rec_non_rec_rule: negated recursive call") },
 
 	{ rl_gen__get_call_instmap(CallInfo1, CallInfo2, InstMap) },
@@ -1284,10 +1284,9 @@
 	{ CallInfo2 = db_call(_PredProcId2, IsNeg2,
 		_InputArgs2, OutputArgs2, _GoalInfo2) },
 
-	{ require(lambda([] is semidet, (IsNeg1 = no, IsNeg2 = no)),
+	{ require(unify({IsNeg1, IsNeg2}, {no, no}),
 		"rl_gen__non_rec_rec_rule: negated recursive or magic call") },
 
-
 	{ rl_gen__get_call_instmap(CallInfo1, CallInfo2, InstMap) },
 
 	rl_relops__join(Full1, Diff2, OutputArgs1, OutputArgs2, InstMap,
@@ -1307,7 +1306,7 @@
 	{ CallInfo2 = db_call(_PredProcId2, IsNeg2,
 		_InputArgs2, OutputArgs2, _GoalInfo2) },
 
-	{ require(lambda([] is semidet, (IsNeg1 = no)),
+	{ require(unify(IsNeg1, no),
 		"rl_gen__non_rec_non_rec_rule: negated magic call") },
 
 	{ rl_gen__get_call_instmap(CallInfo1, CallInfo2, InstMap) },
@@ -1660,7 +1659,7 @@
 	{ list__append(CurriedArgs, OutputArgs, Args) },
 	rl_gen__rename_inline_call(Args, CalledPredInfo, CalledProcInfo, Goal),	
 	( { Goal = conj(_) - _ } ->
-		{ require(lambda([] is semidet, OutputArgs = []),
+		{ require(unify(OutputArgs, []),
 		    "rl_gen__inline_call: `true' relation not zero arity") },
 		% create a zero arity relation containing a tuple
 		{ true_goal(True) },
Index: compiler/rl_key.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_key.m,v
retrieving revision 1.16
diff -u -b -r1.16 rl_key.m
--- compiler/rl_key.m	24 Oct 2003 06:17:48 -0000	1.16
+++ compiler/rl_key.m	2 Nov 2003 13:08:10 -0000
@@ -180,10 +180,10 @@
 		MaybeConstructArgTypes = no
 	),
 		% Partial matches on indexes aren't yet allowed.
-	list__map(lambda([Attr::in, (Attr - AttrBound)::out] is semidet, (
+	list__map((pred(Attr::in, (Attr - AttrBound)::out) is semidet :-
 			list__index1(Args, Attr, KeyArg), 
 			map__search(VarBoundMap, KeyArg, AttrBound)
-		)), Attrs, AttrBounds),
+		), Attrs, AttrBounds),
 				
 	list__map(list__index1(Args), Attrs, KeyArgs),
 	map__apply_to_list(KeyArgs, VarTypes, ArgTypes),
@@ -737,12 +737,12 @@
 rl_key__add_compare_result(CompareResult, Arg1, Arg2) -->
 	key_info_get_constraints(Cnstrs0),
 	{ UpdateCompares =
-		lambda([VarMap0::in, VarMap::out] is det, (
+		(pred(VarMap0::in, VarMap::out) is det :-
 			VarMap0 = var_map(Map, Compares0),
 			map__set(Compares0, CompareResult,
 				Arg1 - Arg2, Compares),
 			VarMap = var_map(Map, Compares)
-		)) },
+		) },
 	{ list__map(UpdateCompares, Cnstrs0, Cnstrs) },
 	key_info_set_constraints(Cnstrs).
 
@@ -822,10 +822,10 @@
 
 rl_key__unify_functor(Var, ConsId, Args) -->
 	key_info_get_constraints(Constraints0),	
-	{ GetArgTerm = lambda([Arg::in, ArgTerm::out] is det, (
+	{ GetArgTerm = (pred(Arg::in, ArgTerm::out) is det :-
 			set__singleton_set(ArgSet, Arg),
 			ArgTerm = var - ArgSet
-		)) },
+		) },
 	{ list__map(GetArgTerm, Args, ArgTerms) },
 
 	{ set__singleton_set(VarSet, Var) },
@@ -833,8 +833,7 @@
 	{ map__lookup(VarTypes, Var, Type) },
 	{ Term1 = functor(ConsId, Type, ArgTerms) - VarSet },
 	key_info_get_module_info(ModuleInfo),
-	{ AddConstraint =
-	    lambda([VarMap0::in, VarMap::out] is semidet, (
+	{ AddConstraint = (pred(VarMap0::in, VarMap::out) is semidet :-
 		VarMap0 = var_map(Map0, CompRes),
 		( map__search(Map0, Var, VarInfo0) ->
 			VarInfo0 = var_info(LBound0, UBound0),
@@ -848,7 +847,7 @@
 		),
 		map__set(Map0, Var, VarInfo, Map),
 		VarMap = var_map(Map, CompRes)
-	)) },
+	) },
 	{ list__filter_map(AddConstraint, Constraints0, Constraints) },
 	key_info_set_constraints(Constraints).
 
@@ -857,11 +856,10 @@
 
 rl_key__unify_var_var(Var1, Var2) -->
 	key_info_get_constraints(Constraints0),	
-	{ AddEquality =
-	    lambda([Map0::in, Map::out] is det, (
+	{ AddEquality = (pred(Map0::in, Map::out) is det :-
 		rl_key__add_alias(Var1, Var2, Map0, Map1),
 		rl_key__add_alias(Var2, Var1, Map1, Map)
-	    )) }, 
+	) }, 
 	{ list__map(AddEquality, Constraints0, Constraints) },
 	key_info_set_constraints(Constraints).
 
@@ -949,8 +947,7 @@
 rl_key__update_bounds(Var, LowerBound1, UpperBound1) -->
 	key_info_get_constraints(Cnstrs0),
 	key_info_get_module_info(ModuleInfo),
-	{ UpdateBounds =
-	    lambda([VarMap0::in, VarMap::out] is det, (
+	{ UpdateBounds = (pred(VarMap0::in, VarMap::out) is det :-
 		VarMap0 = var_map(Map0, CompRes),
 		( map__search(Map0, Var, VarInfo0) ->
 			VarInfo0 = var_info(LowerBound0, UpperBound0),
@@ -964,7 +961,7 @@
 		),
 		map__set(Map0, Var, VarInfo, Map),
 		VarMap = var_map(Map, CompRes)
-	    )) },
+	) },
 	{ list__map(UpdateBounds, Cnstrs0, Cnstrs) },
 	key_info_set_constraints(Cnstrs).
 
@@ -994,12 +991,11 @@
 	( ConsId1 = ConsId2 ->	
 		ConsId = ConsId1,
 		assoc_list__from_corresponding_lists(Args1, Args2, Args3),
-		UpdatePair = 
-			lambda([Pair::in, Bound::out] is det, (
+		UpdatePair = (pred(Pair::in, Bound::out) is det :-
 				Pair = Bound1 - Bound2,
 				rl_key__unify_term(ModuleInfo,
 					UpperLower, Bound1, Bound2, Bound)
-			)),
+			),
 		list__map(UpdatePair, Args3, Args)
 	;
 		rl_key__det_choose_cons_id(ModuleInfo, UpperLower, 
Index: compiler/rl_liveness.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_liveness.m,v
retrieving revision 1.5
diff -u -b -r1.5 rl_liveness.m
--- compiler/rl_liveness.m	15 Mar 2003 03:09:09 -0000	1.5
+++ compiler/rl_liveness.m	2 Nov 2003 13:08:45 -0000
@@ -249,10 +249,10 @@
 	rl_opt_info_get_block(BlockId, Block),
 	{ Block = block(_, Instrs, _, _) },
 	{ set__init(Created0) },
-	{ AddCreated = lambda([Instr::in, C0::in, C::out] is det, (
+	{ AddCreated = (pred(Instr::in, C0::in, C::out) is det :-
 			rl__instr_relations(Instr, _, Outputs),
 			set__insert_list(C0, Outputs, C)
-		)) },
+		) },
 	{ list__foldl(AddCreated, Instrs, Created0, Created) },
 
 	rl_opt_info_get_first_block_id(FirstBlock),
@@ -321,10 +321,10 @@
 	{ list__map(relation__lookup_key(Graph), CallingBlockKeys, 
 		CallingBlocks) },
 	{ GetLiveOutputs = 
-		lambda([CallingBlock::in, LiveRels::out] is det, (
+		(pred(CallingBlock::in, LiveRels::out) is det :-
 			map__lookup(LiveMap, CallingBlock, CallingData),
 			CallingData = block_data(LiveRels, _, _)
-		)) },
+		) },
 	{ list__map(GetLiveOutputs, CallingBlocks, CallingBlockLiveRels0) },
 	( { BlockId = FirstBlockId } ->
 		{ CallingBlockLiveRels1 = CreatedAtStart }
@@ -362,7 +362,7 @@
 	{ list__map(relation__lookup_key(Graph), CalledBlockKeys,
 		CalledBlocks) },
 	{ GetCreatedOutputs =
-		lambda([CalledBlock::in, CalledInitAtStart::out] is det, (
+		(pred(CalledBlock::in, CalledInitAtStart::out) is det :-
 			map__lookup(CreateMap, CalledBlock, CalledCreateData),
 			map__lookup(LiveMap, CalledBlock, CalledLiveData),
 			CalledLiveData = block_data(_, CalledLiveAtStart, _),
@@ -370,7 +370,7 @@
 				block_data(_, CalledInitAtStart0, _),
 			set__intersect(CalledInitAtStart0, CalledLiveAtStart,
 				CalledInitAtStart)
-		)) },
+		) },
 	{ list__map(GetCreatedOutputs, CalledBlocks, CalledBlockCreated0) },	
 	( { BlockId = LastBlockId } ->
 		{ CalledBlockCreated1 = LiveAtEnd }
Index: compiler/rl_loop.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_loop.m,v
retrieving revision 1.3
diff -u -b -r1.3 rl_loop.m
--- compiler/rl_loop.m	15 Mar 2003 03:09:09 -0000	1.3
+++ compiler/rl_loop.m	2 Nov 2003 14:19:36 -0000
@@ -29,7 +29,7 @@
 :- import_module aditi_backend__rl.
 
 :- import_module assoc_list, bimap, bool, int, list, map, queue, relation.
-:- import_module require, set, std_util.
+:- import_module string, require, set, std_util.
 
 rl_loop__shift_invariants -->
 	rl_opt_info_get_loops(Loops0),
@@ -37,8 +37,7 @@
 	% as they can go in one jump. If a variable is an invariant of
 	% an outer loop, it must be invariant in any inner loops of that
 	% outer loop.
-	{ CompareLoops = 
-	    lambda([Loop1::in, Loop2::in, Compare::out] is det, (
+	{ CompareLoops = (pred(Loop1::in, Loop2::in, Compare::out) is det :-
 	    	Loop1 = loop(_, Nodes1),
 		Loop2 = loop(_, Nodes2),
 		set__to_sorted_list(Nodes1, Nodes1List),
@@ -47,7 +46,7 @@
 		list__length(Nodes2List, Size2),
 		% Sort in descending order on size.
 		compare(Compare, Size2, Size1)
-	    )) },
+	) },
 	{ list__sort(CompareLoops, Loops0, SortedLoops) },
 	rl_loop__shift_invariants_2(SortedLoops, [], Loops),
 	rl_opt_info_set_loops(Loops).
@@ -65,7 +64,7 @@
 		% it dominates all the exit points.
 	rl_opt_info_get_flow_graph(FlowGraph),
 	{ IsExitPoint = 
-		lambda([Node::in] is semidet, (
+		(pred(Node::in) is semidet :-
 			relation__lookup_element(FlowGraph, Node, NodeKey),
 			relation__lookup_from(FlowGraph, NodeKey,
 				CalledNodeKeys),
@@ -73,7 +72,7 @@
 			relation__lookup_key(FlowGraph,
 				CalledNodeKey, CalledNode),
 			\+ set__member(CalledNode, Nodes)
-		)) },
+		) },
 	{ set__to_sorted_list(Nodes, NodeList) },
 	{ list__filter(IsExitPoint, NodeList, ExitNodes) },
 	rl_opt_info_get_dominator_info(DominatorInfo), 
@@ -81,10 +80,10 @@
 		ExitNodes = [ExitNode | ExitNodes1],
 		map__lookup(DominatorInfo, ExitNode, ExitDominatingNodes0),
 		IntersectDominators =
-		    lambda([N::in, Inter0::in, Inter::out] is det, (
+			(pred(N::in, Inter0::in, Inter::out) is det :-
 		    	map__lookup(DominatorInfo, N, DominatingNodes1),
 			set__intersect(Inter0, DominatingNodes1, Inter)
-		    )),
+			),
 		list__foldl(IntersectDominators, ExitNodes1, 
 			ExitDominatingNodes0, ExitDominatingNodes)
 	;
@@ -123,16 +122,15 @@
 		ManyBlock0, ManyBlock) -->
 	rl_opt_info_get_block(Block, block(_, Instrs, _, _)),
 	{ GetInstrRelations = 
-		lambda([Instr::in, Rels0::in, Rels::out] is det, (
+		(pred(Instr::in, Rels0::in, Rels::out) is det :-
 			rl__instr_relations(Instr, Inputs, Outputs),
 			set__insert_list(Rels0, Inputs, Rels1),
 			set__insert_list(Rels1, Outputs, Rels)
-		)) },
+		) },
 	{ set__init(BlockRels0) },
 	{ list__foldl(GetInstrRelations, Instrs, BlockRels0, BlockRels1) },
 
-	{ Update =
-	    lambda([Rel::in, Changed0::in, Changed::out] is det, (
+	{ Update = (pred(Rel::in, Changed0::in, Changed::out) is det :-
 		Changed0 = One0 - Many0,
 		( set__member(Rel, Many0) ->
 			Many = Many0,
@@ -145,7 +143,7 @@
 			Many = Many0
 		),
 		Changed = One - Many
-	    )) },
+	) },
 	{ set__to_sorted_list(BlockRels1, BlockRels) },
 	{ list__foldl(Update, BlockRels,
 		OneBlock0 - ManyBlock0, OneBlock1 - ManyBlock1) },
@@ -166,10 +164,10 @@
 	rl_opt_info_get_block(LoopNode, Block0),
 	{ Block0 = block(Label, Instrs0, Branch, BlockInfo) },
 	{ GetChangedRels = 
-		lambda([Instr::in, Rels0::in, Rels::out] is det, (
+		(pred(Instr::in, Rels0::in, Rels::out) is det :-
 			rl__instr_relations(Instr, _, Outputs),
 			set__insert_list(Rels0, Outputs, Rels)
-		)) },
+		) },
 	{ set__init(BlockChangedRels0) },
 	{ list__foldl(GetChangedRels, Instrs0, 
 		BlockChangedRels0, BlockChangedRels) },
@@ -346,8 +344,7 @@
 
 	% Add the new block to all loops containing the old header.
 	( { EntryBlock = block(yes(EntryLabel), _, _, _) } ->
-		{ UpdateLoop = 
-		    lambda([L0::in, L::out] is det, (
+		{ UpdateLoop = (pred(L0::in, L::out) is det :-
 			L0 = loop(LEntry0, LNodes0),
 			( set__member(EntryNode, LNodes0) ->
 				set__insert(LNodes0, HeaderBlockId, LNodes)
@@ -355,13 +352,14 @@
 				LNodes = LNodes0
 			),
 			L = loop(LEntry0, LNodes)
-		    )) },
+		) },
 		{ list__map(UpdateLoop, ProcessedLoops0, ProcessedLoops) },
 		{ list__map(UpdateLoop, LoopsToProcess0, LoopsToProcess) },
 		rl_loop__update_gotos(LoopNodes, EntryLabel, HeaderLabel, 
 			EntryNode, HeaderBlockId)
 	;
-		{ error("rl_loop__maybe_add_header: loop entry does not have a label") }
+		{ error("rl_loop__maybe_add_header: " ++
+			"loop entry does not have a label") }
 	).
 
 %-----------------------------------------------------------------------------%
@@ -394,8 +392,8 @@
 	%
 	rl_opt_info_get_block_map(BlockMap0),
 	{ map__to_assoc_list(BlockMap0, BlockAL0) },
-	{ UpdateBlock =
-	   lambda([BlockIdAndBlock0::in, BlockIdAndBlock::out] is det, (
+	{ UpdateBlock = (pred(BlockIdAndBlock0::in, BlockIdAndBlock::out)
+			is det :-
 	   	BlockIdAndBlock0 = BlockId - block(A, B, MaybeBranch0, D),
 		( set__member(BlockId, LoopNodes) ->
 		    MaybeBranch = MaybeBranch0
@@ -406,16 +404,18 @@
 			MaybeBranch = yes(goto(NewLabel) - Comment)
 		    ; 
 		    	MaybeBranch0 = 
-				yes(conditional_goto(Cond, OldLabel) - Comment)
+					yes(conditional_goto(Cond, OldLabel)
+						- Comment)
 		    ->
 			MaybeBranch = 
-				yes(conditional_goto(Cond, NewLabel) - Comment)
+					yes(conditional_goto(Cond, NewLabel)
+						- Comment)
 		    ;
 		        MaybeBranch = MaybeBranch0
 		    )
 		),
 	   	BlockIdAndBlock = BlockId - block(A, B, MaybeBranch, D)
-	    )) },
+	) },
 	{ list__map(UpdateBlock, BlockAL0, BlockAL) },
 	{ map__from_assoc_list(BlockAL, BlockMap) },
 	rl_opt_info_set_block_map(BlockMap),
Index: compiler/rl_out.pp
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_out.pp,v
retrieving revision 1.22
diff -u -b -r1.22 rl_out.pp
--- compiler/rl_out.pp	24 Oct 2003 06:17:48 -0000	1.22
+++ compiler/rl_out.pp	2 Nov 2003 15:58:10 -0000
@@ -747,13 +747,13 @@
 	{ string__to_char_list(ProcNameStr, ProcNameList0) },
 	% Slashes are significant in relation names, so convert them to colons.
 	{ RemoveSlashes =
-		lambda([Char0::in, Char::out] is det, (
+		(pred(Char0::in, Char::out) is det :-
 			( Char0 = ('/') ->
 				Char = (':')
 			;
 				Char = Char0
 			)
-		)) },
+		) },
 	{ list__map(RemoveSlashes, ProcNameList0, ProcNameList) },
 	{ string__from_char_list(ProcNameList, ProcNameStr1) },
 	rl_out_info_get_module_info(ModuleInfo),
@@ -843,10 +843,10 @@
 
 rl_out__get_rel_var_list(Rels, Code) -->
 	list__map_foldl(rl_out_info_get_relation_addr, Rels, Addrs),
-	{ ConsElems = lambda([Addr::in, Cons::out] is det, (
+	{ ConsElems = (pred(Addr::in, Cons::out) is det :-
 			LockSpec = 0,
 			Cons = rl_PROC_var_list_cons(Addr, LockSpec)
-		)) },
+		) },
 	{ list__map(ConsElems, Addrs, Code1) },
 	{ Code = tree(node(Code1), node([rl_PROC_var_list_nil])) }.
 
@@ -1104,9 +1104,9 @@
 		OverlapTmpVars, OverlapCode),
 
 	{ list__append(NewInputs, NewOutputs, CallArgs) },
-	{ list__map(lambda([Arg::in, ArgCode::out] is det, (
+	{ list__map((pred(Arg::in, ArgCode::out) is det :-
 		ArgCode = rl_PROC_var_list_cons(Arg, 0)
-	)), CallArgs, CallArgCodes) },
+	), CallArgs, CallArgCodes) },
 	{ rl__proc_name_to_string(ProcName, ProcNameStr) },
 	rl_out_info_assign_const(string(ProcNameStr), ProcNameConst),
 	rl_out_info_return_tmp_vars(SaveTmpVars, SaveClearCode),
@@ -2088,10 +2088,10 @@
 :- pred rl_out__generate_arg_list(list(int)::in, byte_tree::out) is det.
 
 rl_out__generate_arg_list(List, Code) :-
-	ConsElem = lambda([Elem::in, ArgCode::out] is det, (
+	ConsElem = (pred(Elem::in, ArgCode::out) is det :-
 			LockSpec = 0, % default lock spec.
 			ArgCode = rl_PROC_var(Elem, LockSpec)
-		)),
+		),
 	list__map(ConsElem, List, Codes),
 	Code = node(Codes).
 
@@ -2100,9 +2100,9 @@
 :- pred rl_out__generate_int_list(list(int)::in, byte_tree::out) is det.
 
 rl_out__generate_int_list(List, Code) :-
-	ConsElem = lambda([Elem::in, Cons::out] is det, (
+	ConsElem = (pred(Elem::in, Cons::out) is det :-
 			Cons = rl_PROC_int_list_cons(Elem)
-		)),
+		),
 	list__map(ConsElem, List, Codes0),
 	list__append(Codes0, [rl_PROC_int_list_nil], Codes),
 	Code = node(Codes).
@@ -2115,7 +2115,7 @@
 rl_out__resolve_proc_addresses(ByteTree0, ByteTree) -->
 	rl_out_info_get_labels(Labels),
 	{ ResolveAddr = 
-		lambda([Code0::in, Code::out] is det, (
+		(pred(Code0::in, Code::out) is det :-
 			%
 			% The actual code addresses of rl_PROC_goto_label
 			% are resolved at runtime, we possibly could resolve
@@ -2139,7 +2139,7 @@
 			;
 				Code = Code0
 			)
-		)) },
+		) },
 	{ rl_out__resolve_addresses(ResolveAddr, ByteTree0, ByteTree) }.
 
 	% Labels introduced as optimizations in rl_out.m don't
@@ -2167,11 +2167,11 @@
 
 rl_out__instr_code_size(empty, 0).
 rl_out__instr_code_size(node(Instrs), Size) :-
-	AddSize = lambda([Instr::in, S0::in, S::out] is det, (
+	AddSize = (pred(Instr::in, S0::in, S::out) is det :-
 			bytecode_to_intlist(Instr, IntList),
 			list__length(IntList, S1),
 			S = S0 + S1
-		)),
+		),
 	list__foldl(AddSize, Instrs, 0, Size).
 rl_out__instr_code_size(tree(CodeA, CodeB), Size) :-
 	rl_out__instr_code_size(CodeA, SizeA),
Index: compiler/rl_relops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_relops.m,v
retrieving revision 1.7
diff -u -b -r1.7 rl_relops.m
--- compiler/rl_relops.m	15 Mar 2003 03:09:09 -0000	1.7
+++ compiler/rl_relops.m	2 Nov 2003 13:13:39 -0000
@@ -157,11 +157,11 @@
 	{ instmap__apply_instmap_delta(InstMap0, InstMapDelta, InstMap) },
 	rl_info_get_module_info(ModuleInfo),
 	{ IsInput = 
-		lambda([Var::in] is semidet, (
+		(pred(Var::in) is semidet :-
 			instmap__lookup_var(InstMap0, Var, Inst0),
 			instmap__lookup_var(InstMap, Var, Inst),
 			mode_is_input(ModuleInfo, (Inst0 -> Inst))
-		)) },
+		) },
 	{ list__filter(IsInput, NonLocalsList, InputNonLocalsList) },
 	{ set__sorted_list_to_set(InputNonLocalsList, InputNonLocals) },
 	{ set__difference(InputNonLocals, Vars, OtherCallInputs) },
Index: compiler/rl_sort.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_sort.m,v
retrieving revision 1.12
diff -u -b -r1.12 rl_sort.m
--- compiler/rl_sort.m	26 May 2003 09:00:08 -0000	1.12
+++ compiler/rl_sort.m	2 Nov 2003 13:21:43 -0000
@@ -253,12 +253,11 @@
 
 rl_sort__map_equal(UnifyValue, Map1, Map2) :-
 	map__foldl(
-		lambda([Key1::in, Value1::in, _Unit0::in, Unit::out] is semidet,
-		(
+		(pred(Key1::in, Value1::in, _Unit0::in, Unit::out) is semidet :-
 			Unit = unit,
 			map__search(Map2, Key1, Value2),
 			call(UnifyValue, Value1, Value2)
-		)), Map1, unit, _).
+		), Map1, unit, _).
 
 %-----------------------------------------------------------------------------%
 
@@ -461,9 +460,9 @@
 rl_sort__restrict(SortData0, Rels, SortData) :-
 	SortData0 = sortedness(SortedRels0, SortVars0),
 	map__select(SortedRels0, Rels, SortedRels),
-	IntersectRels = lambda([_::in, VarRels0::in, VarRels::out] is det, (
+	IntersectRels = (pred(_::in, VarRels0::in, VarRels::out) is det :-
 			set__intersect(VarRels0, Rels, VarRels)
-		)),
+		),
 	map__map_values(IntersectRels, SortVars0, SortVars),
 	SortData = sortedness(SortedRels, SortVars).
 
@@ -626,11 +625,10 @@
 		{ map__init(Specs0) },
 		{ set__singleton_set(BlockIds, BlockId) },
 		{ list__foldl(
-			lambda([Index::in, SpecMap0::in, SpecMap::out] is det, 
-			(
+			(pred(Index::in, SpecMap0::in, SpecMap::out) is det :-
 				map__set(SpecMap0, index(Index),
 					sort_req(definite, BlockIds), SpecMap)
-			)), Indexes, Specs0, Specs1) },
+			), Indexes, Specs0, Specs1) },
 		{ map__to_assoc_list(Specs1, SpecAL1) },
 		{ list__filter(SpecFilter, SpecAL1, SpecAL) },
 		{ map__from_assoc_list(SpecAL, Specs) },
@@ -651,9 +649,9 @@
 	{ set__singleton_set(BlockIds, BlockId) },
 	{ list__sort_and_remove_dups(Indexes0, Indexes) },
 	{ list__map(
-		lambda([Index::in, Spec::out] is det,
-			Spec = index(Index) - sort_req(definite, BlockIds)),
-		Indexes, Specs0) },
+		(pred(Index::in, Spec::out) is det :-
+			Spec = index(Index) - sort_req(definite, BlockIds)
+		), Indexes, Specs0) },
 	{ map__from_assoc_list(Specs0, Specs) },
 	rl_sort__add_relation_sortedness_map(Specs, Output).
 
@@ -1004,34 +1002,31 @@
 
 		% Work out the sort specification in terms
 		% of the input arguments.
-		list__map(
-			lambda([AttrDir::in, VarDir::out] is det, (
+		list__map((pred(AttrDir::in, VarDir::out) is det :-
 				AttrDir = Attr - Dir,
 				list__index1_det(InputArgs, Attr, Var),
 				VarDir = Var - Dir
-			)), SortAttrs0, VarAttrs0),
+			), SortAttrs0, VarAttrs0),
 
 		% Take the longest prefix of the sort specification that
 		% is in the output arguments (we could do better here
 		% by looking at the goal, since some of the outputs may
 		% be equivalent but not named identically to the input).
-		list__takewhile(
-			lambda([VarDir::in] is semidet, (
+		list__takewhile((pred(VarDir::in) is semidet :-
 				VarDir = Var - _,
 				list__member(Var, OutputArgs)
-			)), VarAttrs0, VarAttrs, _),
+			), VarAttrs0, VarAttrs, _),
 		VarAttrs \= [],
 
 		% Map those output arguments back into argument numbers.
-		list__map(
-			lambda([VarDir::in, AttrDirs::out] is det, (
+		list__map((pred(VarDir::in, AttrDirs::out) is det :-
 				VarDir = Var - Dir,
 				rl_sort__all_positions(OutputArgs,
 					1, Var, Attrs),
-				list__map(lambda([X::in, Y::out] is det, (
+				list__map((pred(X::in, Y::out) is det :-
 					Y = X - Dir
-				)), Attrs, AttrDirs)
-			)), VarAttrs, SortAttrs1),
+					), Attrs, AttrDirs)
+			), VarAttrs, SortAttrs1),
 		list__condense(SortAttrs1, SortAttrs),
 		SortSpec = attributes(SortAttrs)
 	).
@@ -1372,7 +1367,7 @@
 		IndexRanges = []
 	;
 		list__filter_map(
-		    lambda([Index::in, ThisIndexRanges::out] is semidet, (
+			(pred(Index::in, ThisIndexRanges::out) is semidet :-
 			Inputs = two_inputs(Args1, Args2),
 			( 
 				TupleNum = one,
@@ -1386,7 +1381,7 @@
 					VarBounds, Ranges)
 			),
 			ThisIndexRanges = Index - Ranges
-		    )), Indexes, IndexRanges)
+			), Indexes, IndexRanges)
 	).
 
 :- type index_ranges == list(index_range).
@@ -1474,8 +1469,8 @@
 		list(sort_spec)::out) is det.
 
 find_definite_sort_specs(SortMap, SortSpecs) :-
-    map__foldl(
-	(pred(SortIndex::in, SortReq::in, Specs0::in, Specs::out) is det :-
+	map__foldl((pred(SortIndex::in, SortReq::in, Specs0::in, Specs::out)
+			is det :-
 		(
 			SortReq = sort_req(definite, _),
 			%(
@@ -1593,9 +1588,9 @@
 
 		% Partition out those expressions for which there
 		% are no suitable indexes.
-		list__filter(lambda([ProjOutput::in] is semidet, 
-			ProjOutput = proj_output(_, _, [])),
-			ProjOutputIndexes, NoIndexOutputs0, IndexOutputs),
+		list__filter((pred(ProjOutput::in) is semidet :-
+				ProjOutput = proj_output(_, _, [])
+			), ProjOutputIndexes, NoIndexOutputs0, IndexOutputs),
 		( IndexOutputs = [] ->
 			Instrs = [Instr0 | Instrs0],
 			RLInfo = RLInfo2
@@ -1606,10 +1601,11 @@
 				Partitions = Partitions0
 			;
 				list__map(
-				    lambda([POutput::in, PRel::out] is det,  (
-					POutput = proj_output(ORel, Goal, _),
+					(pred(POutput::in, PRel::out) is det :-
+						POutput = proj_output(ORel,
+							Goal, _),
 					PRel = ORel - Goal
-				    )), NoIndexOutputs0, NoIndexOutputs),	
+					), NoIndexOutputs0, NoIndexOutputs),
 				Partition = NoIndexOutputs - no,
 				Partitions = [Partition | Partitions0]
 			),
@@ -1643,12 +1639,13 @@
 		IndexRanges = []
 	;
 		list__filter_map(
-		    lambda([Index::in, ThisIndexRanges::out] is semidet, (
+			(pred(Index::in, ThisIndexRanges::out) is semidet :-
 			Inputs = one_input(Args),
-			rl_key__get_select_key_ranges(ModuleInfo, VarTypes,
-				Args, Index, VarBounds, Ranges),
+				rl_key__get_select_key_ranges(ModuleInfo,
+					VarTypes, Args, Index, VarBounds,
+					Ranges),
 			ThisIndexRanges = Index - Ranges
-		    )), Indexes, IndexRanges)
+			), Indexes, IndexRanges)
 	).
 
 	% Find the set of indexes which results in the smallest
@@ -1713,10 +1710,10 @@
 		( map__search(RelSortMap, Rel, Specs0) ->
 			map__to_assoc_list(Specs0, SpecsAL),
 			list__filter_map(
-				lambda([SpecPair::in, Index::out] is semidet, (
+				(pred(SpecPair::in, Index::out) is semidet :-
 					SpecPair = index(Index)
 						- sort_req(definite, _)
-				)), SpecsAL, Indexes)
+				), SpecsAL, Indexes)
 		;
 			Indexes = []
 		),
@@ -1922,11 +1919,11 @@
 		project(Output,
 			B, C, ProjectOutputs, Type) - F) :-
 	call(OutputPred, Output0, Output),
-	list__map(lambda([ProjOutput0::in, ProjOutput::out] is det, (
+	list__map((pred(ProjOutput0::in, ProjOutput::out) is det :-
 			ProjOutput0 = OutputRel0 - Expr,
 			call(OutputPred, OutputRel0, OutputRel),
 			ProjOutput = OutputRel - Expr
-		)), ProjectOutputs0, ProjectOutputs),
+		), ProjectOutputs0, ProjectOutputs),
 	(
 		Type0 = index(Index0, Range),
 		call(IndexPred, Index0, Index),
@@ -2028,87 +2025,86 @@
 	Instr = comment - _.
 
 %-----------------------------------------------------------------------------%
-/*
-	% Beyond this point is junk at the moment.
-
-	% Do an assignment of sort specifiers to each sort variable.
-:- pred rl_sort__assign_sort_vars(sort_data_map::in, var_requests::in,
-	sort_data_map::in, var_requests::in, map(int, sort_index)::out,
-	rl_opt_info::in, rl_opt_info::out) is det.
 
-rl_sort__assign_sort_vars(_AvailData0, AvailRequests0, _NeededData0,
-		NeededRequests, VarBindings) -->
-	{
-	map__keys(AvailRequests, VarsList0),
-	map__keys(NeededRequests, VarsList1),
-	set__sorted_list_to_set(VarsList0, Vars0),
-	set__sorted_list_to_set(VarsList1, Vars1),
-	set__union(Vars0, Vars1, Vars),
-
-	map__init(VarBindings0), 
-
-	% Find out which sort vars can be allocated based on
-	% available sortedness.
-	rl_sort__single_request_vars(AvailRequests0,
-		VarBindings0, VarBindings1),
-	rl_sort__bind_vars(AvailRequests0, VarBindings1, AvailRequests),
-
-	map__keys(VarBindings1, BoundVars1),
-	set__delete_list(Vars, BoundVars1, UnboundVars1)
-	},
-	{ set__empty(UnboundVars1) ->
-		VarBindings = VarBindings0
-	;
-		% Find out which sort vars can be allocated based on
-		% needed sortedness intersecting with available sortedness.
-		rl_sort__intersect_requests(AvailRequests, NeededRequests,
-			IntersectedRequests),
-
-		rl_sort__single_request_vars(IntersectedRequests,
-			VarBindings1, VarBindings)
-
-		% If there's anything left unbound, just pick one of the
-		% available sortednesses. XXX try all with cost measurement
-		% to pick the best.
-	}.
-
-	% Find all sort variables which have only one requested sortedness.
-:- pred rl_sort__single_request_vars(var_requests::in,
-		map(int, sort_index)::in,
-		map(int, sort_index)::out) is det.
-
-rl_sort__single_request_vars(Requests0, SingleVars0, SingleVars) :-
-	IsSingleBindingVar =
-		lambda([Var::in, Reqs0::in, Single0::in, Single::out] is det, (
-			set__to_sorted_list(Reqs0, Reqs1),
-			(
-				\+ map__contains(Single0, Var),
-				list__filter(lambda([Req::in] is semidet, (
-						\+ Req = sort_var(Var) - _
-					)), Reqs1, [Request]),
-				Request = attributes(_) - _
-			->
-				map__det_insert(Single0, Var, Request, Single)
-			;
-				Single = Single0
-			)
-		)),
-	map__foldl(IsSingleBindingVar, Requests0, SingleVars0, SingleVars).
-
-:- pred rl_sort__intersect_requests(var_requests::in,
-		var_requests::in, var_requests::out) is det.
-
-rl_sort__intersect_requests(Requests1, Requests2, Intersection) :-
-	IntersectBindings =
-		lambda([Key::in, Value0::in, Inter0::in, Inter::out] is det, (
-			( map__search(Inter0, Key, Value1) ->
-				set__intersect(Value0, Value1, Value),
-				map__det_update(Inter0, Key, Value, Inter)
-			;
-				Inter = Inter0
-			))),
-	map__foldl(IntersectBindings, Requests1, Requests2, Intersection).
-*/
+% 	% Beyond this point is junk at the moment.
+% 
+% 	% Do an assignment of sort specifiers to each sort variable.
+% :- pred rl_sort__assign_sort_vars(sort_data_map::in, var_requests::in,
+% 	sort_data_map::in, var_requests::in, map(int, sort_index)::out,
+% 	rl_opt_info::in, rl_opt_info::out) is det.
+% 
+% rl_sort__assign_sort_vars(_AvailData0, AvailRequests0, _NeededData0,
+% 		NeededRequests, VarBindings) -->
+% 	{
+% 	map__keys(AvailRequests, VarsList0),
+% 	map__keys(NeededRequests, VarsList1),
+% 	set__sorted_list_to_set(VarsList0, Vars0),
+% 	set__sorted_list_to_set(VarsList1, Vars1),
+% 	set__union(Vars0, Vars1, Vars),
+% 
+% 	map__init(VarBindings0),
+% 
+% 	% Find out which sort vars can be allocated based on
+% 	% available sortedness.
+% 	rl_sort__single_request_vars(AvailRequests0,
+% 		VarBindings0, VarBindings1),
+% 	rl_sort__bind_vars(AvailRequests0, VarBindings1, AvailRequests),
+% 
+% 	map__keys(VarBindings1, BoundVars1),
+% 	set__delete_list(Vars, BoundVars1, UnboundVars1)
+% 	},
+% 	{ set__empty(UnboundVars1) ->
+% 		VarBindings = VarBindings0
+% 	;
+% 		% Find out which sort vars can be allocated based on
+% 		% needed sortedness intersecting with available sortedness.
+% 		rl_sort__intersect_requests(AvailRequests, NeededRequests,
+% 			IntersectedRequests),
+% 
+% 		rl_sort__single_request_vars(IntersectedRequests,
+% 			VarBindings1, VarBindings)
+% 
+% 		% If there's anything left unbound, just pick one of the
+% 		% available sortednesses. XXX try all with cost measurement
+% 		% to pick the best.
+% 	}.
+% 
+% 	% Find all sort variables which have only one requested sortedness.
+% :- pred rl_sort__single_request_vars(var_requests::in,
+% 		map(int, sort_index)::in,
+% 		map(int, sort_index)::out) is det.
+% 
+% rl_sort__single_request_vars(Requests0, SingleVars0, SingleVars) :-
+% 	IsSingleBindingVar =
+% 		(pred(Var::in, Reqs0::in, Single0::in, Single::out) is det :-
+% 			set__to_sorted_list(Reqs0, Reqs1),
+% 			(
+% 				\+ map__contains(Single0, Var),
+% 				list__filter((pred(Req::in) is semidet :-
+% 						\+ Req = sort_var(Var) - _
+% 					), Reqs1, [Request]),
+% 				Request = attributes(_) - _
+% 			->
+% 				map__det_insert(Single0, Var, Request, Single)
+% 			;
+% 				Single = Single0
+% 			)
+% 		),
+% 	map__foldl(IsSingleBindingVar, Requests0, SingleVars0, SingleVars).
+% 
+% :- pred rl_sort__intersect_requests(var_requests::in,
+% 		var_requests::in, var_requests::out) is det.
+% 
+% rl_sort__intersect_requests(Requests1, Requests2, Intersection) :-
+% 	IntersectBindings =
+% 		(pred(Key::in, Value0::in, Inter0::in, Inter::out) is det :-
+% 			( map__search(Inter0, Key, Value1) ->
+% 				set__intersect(Value0, Value1, Value),
+% 				map__det_update(Inter0, Key, Value, Inter)
+% 			;
+% 				Inter = Inter0
+% 			)
+% 		),
+% 	map__foldl(IntersectBindings, Requests1, Requests2, Intersection).
 
-%-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
Index: compiler/rl_stream.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/rl_stream.m,v
retrieving revision 1.9
diff -u -b -r1.9 rl_stream.m
--- compiler/rl_stream.m	26 May 2003 09:00:09 -0000	1.9
+++ compiler/rl_stream.m	2 Nov 2003 13:22:37 -0000
@@ -173,11 +173,11 @@
 	%
 	Block = block(_, Instrs, MaybeBranch, _),
 	AddMustMaterialiseRels =
-	    lambda([Instr::in, StreamInfo0::in, StreamInfo::out] is det, (
+		(pred(Instr::in, StreamInfo0::in, StreamInfo::out) is det :-
 		rl_stream__must_materialise_rels(Instr, Rels),
 		rl_stream__add_must_materialise_rels(Rels,
 			StreamInfo0, StreamInfo)
-	    )),
+		),
 	list__foldl(AddMustMaterialiseRels, Instrs, Info2, Info3),
 	( MaybeBranch = yes(Branch) ->
 		AddMustMaterialiseRels(Branch, Info3, Info)
@@ -246,9 +246,9 @@
 		list__split_list(N1, BlockIds, _, AfterBlockIds0),
 		AfterBlockIds0 = [BlockId | AfterBlockIds]
 	->
-		list__filter(lambda([CalledBlock::in] is semidet, (
+		list__filter((pred(CalledBlock::in) is semidet :-
 				list__member(CalledBlock, AfterBlockIds)
-			)), CalledBlocks, InsideLaterCalledBlocks)
+			), CalledBlocks, InsideLaterCalledBlocks)
 	;
 		error("rl_stream__inside_and_after")
 	).
@@ -338,7 +338,7 @@
 	( set__empty(Intersect) ->
 		set__to_sorted_list(Relations, RelationsList),
 		list__map(bag__count_value(Uses), RelationsList, Counts),
-		list__foldl(lambda([X::in, Y::in, Z::out] is det, Z = X + Y),
+		list__foldl((pred(X::in, Y::in, Z::out) is det :- Z = X + Y),
 			Counts, 0, NumUses),
 		( NumUses = 1 ->
 			Materialise = Materialise0
@@ -470,10 +470,10 @@
 		list(relation_id)::out) is det.
 
 rl_stream__outputs_are_indexed(Outputs, Indexed) :-
-	list__filter_map(lambda([OutputRel::in, Output::out] is semidet, (
+	list__filter_map((pred(OutputRel::in, Output::out) is semidet :-
 		OutputRel = output_rel(Output, Indexes),
-		Indexes = [_|_]
-	)), Outputs, Indexed).
+		Indexes = [_ | _]
+	), Outputs, Indexed).
 
 :- pred rl_stream__output_is_indexed(output_rel::in,
 		list(relation_id)::out) is det.
Index: compiler/simplify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.123
diff -u -b -r1.123 simplify.m
--- compiler/simplify.m	31 Oct 2003 03:27:29 -0000	1.123
+++ compiler/simplify.m	2 Nov 2003 13:24:52 -0000
@@ -152,9 +152,9 @@
 	map__det_update(Procs0, ProcId, Proc, Procs),
 	pred_info_set_procedures(Procs, !PredInfo),
 	set__to_sorted_list(Msgs1, Msgs2),
-	list__filter(lambda([Msg::in] is semidet,
-		det_msg_is_any_mode_msg(Msg, any_mode)),
-		Msgs2, AnyModeMsgs1, AllModeMsgs1),
+	list__filter((pred(Msg::in) is semidet :-
+			det_msg_is_any_mode_msg(Msg, any_mode)
+		), Msgs2, AnyModeMsgs1, AllModeMsgs1),
 	set__sorted_list_to_set(AnyModeMsgs1, AnyModeMsgs2),
 	set__sorted_list_to_set(AllModeMsgs1, AllModeMsgs2),
 	( !.MaybeMsgs = yes(AnyModeMsgs0 - AllModeMsgs0) ->
@@ -2047,9 +2047,9 @@
 		error("simplify__goal_2 - get_arg_insts failed")
 	),
 	InstToUniMode =
-		lambda([ArgInst::in, ArgUniMode::out] is det, (
+		(pred(ArgInst::in, ArgUniMode::out) is det :-
 			ArgUniMode = ((ArgInst - free) -> (ArgInst - ArgInst))
-		)),
+		),
 	list__map(InstToUniMode, ArgInsts, UniModes),
 	UniMode = (Inst0 -> Inst0) - (Inst0 -> Inst0),
 	UnifyContext = unify_context(explicit, []),
@@ -2337,23 +2337,23 @@
 
 :- implementation.
 
-simplify_info_get_det_info(SI, SI^det_info).
-simplify_info_get_msgs(SI, SI^msgs).
-simplify_info_get_simplifications(SI, SI^simplifications).
-simplify_info_get_common_info(SI, SI^common_info).
-simplify_info_get_instmap(SI, SI^instmap).
-simplify_info_get_varset(SI, SI^varset).
+simplify_info_get_det_info(SI, SI ^ det_info).
+simplify_info_get_msgs(SI, SI ^ msgs).
+simplify_info_get_simplifications(SI, SI ^ simplifications).
+simplify_info_get_common_info(SI, SI ^ common_info).
+simplify_info_get_instmap(SI, SI ^ instmap).
+simplify_info_get_varset(SI, SI ^ varset).
 simplify_info_get_var_types(SI, VarTypes) :-
-	det_info_get_vartypes(SI^det_info, VarTypes).
+	det_info_get_vartypes(SI ^ det_info, VarTypes).
 simplify_info_requantify(SI) :-
-	SI^requantify = yes.
+	SI ^ requantify = yes.
 simplify_info_recompute_atomic(SI) :-
-	SI^recompute_atomic = yes.
+	SI ^ recompute_atomic = yes.
 simplify_info_rerun_det(SI) :-
-	SI^rerun_det = yes.
-simplify_info_get_cost_delta(SI, SI^cost_delta).
-simplify_info_get_type_info_varmap(SI, SI^type_info_varmap).
-simplify_info_get_typeclass_info_varmap(SI, SI^typeclass_info_varmap).
+	SI ^ rerun_det = yes.
+simplify_info_get_cost_delta(SI, SI ^ cost_delta).
+simplify_info_get_type_info_varmap(SI, SI ^ type_info_varmap).
+simplify_info_get_typeclass_info_varmap(SI, SI ^ typeclass_info_varmap).
 
 simplify_info_get_module_info(Info, ModuleInfo) :-
 	simplify_info_get_det_info(Info, DetInfo),
@@ -2412,23 +2412,24 @@
 
 :- implementation.
 
-simplify_info_set_det_info(SI, Det, SI^det_info := Det).
-simplify_info_set_msgs(SI, Msgs, SI^msgs := Msgs). 
-simplify_info_set_simplifications(SI, Simp, SI^simplifications := Simp).
-simplify_info_set_instmap(SI, InstMap, SI^instmap := InstMap). 
-simplify_info_set_common_info(SI, Common, SI^common_info := Common). 
-simplify_info_set_varset(SI, VarSet, SI^varset := VarSet). 
-simplify_info_set_var_types(SI, VarTypes, SI^det_info := DetInfo) :-
+simplify_info_set_det_info(SI, Det, SI ^ det_info := Det).
+simplify_info_set_msgs(SI, Msgs, SI ^ msgs := Msgs). 
+simplify_info_set_simplifications(SI, Simp, SI ^ simplifications := Simp).
+simplify_info_set_instmap(SI, InstMap, SI ^ instmap := InstMap). 
+simplify_info_set_common_info(SI, Common, SI ^ common_info := Common). 
+simplify_info_set_varset(SI, VarSet, SI ^ varset := VarSet). 
+simplify_info_set_var_types(SI, VarTypes, SI ^ det_info := DetInfo) :-
 	det_info_set_vartypes(SI ^ det_info, VarTypes, DetInfo).
-simplify_info_set_requantify(SI, SI^requantify := yes).
-simplify_info_set_recompute_atomic(SI, SI^recompute_atomic := yes).
-simplify_info_set_rerun_det(SI, SI^rerun_det := yes).
-simplify_info_set_cost_delta(SI, Delta, SI^cost_delta := Delta).
-simplify_info_set_type_info_varmap(SI, Map, SI^type_info_varmap := Map).
+simplify_info_set_requantify(SI, SI ^ requantify := yes).
+simplify_info_set_recompute_atomic(SI, SI ^ recompute_atomic := yes).
+simplify_info_set_rerun_det(SI, SI ^ rerun_det := yes).
+simplify_info_set_cost_delta(SI, Delta, SI ^ cost_delta := Delta).
+simplify_info_set_type_info_varmap(SI, Map, SI ^ type_info_varmap := Map).
 simplify_info_set_typeclass_info_varmap(SI, Map,
-		SI^typeclass_info_varmap := Map).
+		SI ^ typeclass_info_varmap := Map).
 
-simplify_info_incr_cost_delta(SI, Incr, SI^cost_delta := SI^cost_delta + Incr).
+simplify_info_incr_cost_delta(SI, Incr,
+	SI ^ cost_delta := SI ^ cost_delta + Incr).
 
 simplify_info_add_msg(Info0, Msg, Info) :-
 	( simplify_do_warn(Info0) ->
@@ -2442,16 +2443,16 @@
 	set__insert(Msgs0, Msg, Msgs),
 	simplify_info_set_msgs(Info0, Msgs, Info).
 
-simplify_info_enter_lambda(SI, SI^lambdas := SI^lambdas + 1).
-simplify_info_leave_lambda(SI, SI^lambdas := LambdaCount) :-
-	LambdaCount1 = SI^lambdas - 1,
+simplify_info_enter_lambda(SI, SI ^ lambdas := SI ^ lambdas + 1).
+simplify_info_leave_lambda(SI, SI ^ lambdas := LambdaCount) :-
+	LambdaCount1 = SI ^ lambdas - 1,
 	( LambdaCount1 >= 0 ->
 		LambdaCount = LambdaCount1
 	;
 		error("simplify_info_leave_lambda: Left too many lambdas")
 	).
 simplify_info_inside_lambda(SI) :-
-	SI^lambdas > 0.
+	SI ^ lambdas > 0.
 
 simplify_info_set_module_info(Info0, ModuleInfo, Info) :-
 	simplify_info_get_det_info(Info0, DetInfo0),
@@ -2499,8 +2500,8 @@
 :- pred simplify_info_update_instmap(simplify_info::in, hlds_goal::in,
 		simplify_info::out) is det.
 
-simplify_info_update_instmap(SI, Goal, SI^instmap := InstMap) :-
-	update_instmap(Goal, SI^instmap, InstMap).
+simplify_info_update_instmap(SI, Goal, SI ^ instmap := InstMap) :-
+	update_instmap(Goal, SI ^ instmap, InstMap).
 
 :- type before_after
 	--->	before
Index: compiler/tag_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/tag_switch.m,v
retrieving revision 1.57
diff -u -b -r1.57 tag_switch.m
--- compiler/tag_switch.m	27 Oct 2003 05:42:37 -0000	1.57
+++ compiler/tag_switch.m	2 Nov 2003 13:25:02 -0000
@@ -1047,10 +1047,10 @@
 	;
 		LowRangeEnd = (MinStag + MaxStag) // 2,
 		HighRangeStart = LowRangeEnd + 1,
-		InLowGroup = lambda([StagGoal::in] is semidet, (
+		InLowGroup = (pred(StagGoal::in) is semidet :-
 			StagGoal = Stag - _,
 			Stag =< LowRangeEnd
-		)),
+		),
 		list__filter(InLowGroup, StagGoals, LowGoals, HighGoals),
 		code_info__get_next_label(NewLabel, !CI),
 		string__int_to_string(MinStag, LowStartStr),
Index: compiler/term_errors.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_errors.m,v
retrieving revision 1.20
diff -u -b -r1.20 term_errors.m
--- compiler/term_errors.m	25 Jun 2003 06:57:34 -0000	1.20
+++ compiler/term_errors.m	2 Nov 2003 13:25:40 -0000
@@ -383,11 +383,11 @@
 	proc_info_varset(ProcInfo, Varset),
 	term_errors_var_bag_description(OutputSuppliers, Varset,
 		OutputSuppliersNames),
-	list__map(lambda([OS::in, FOS::out] is det, (FOS = fixed(OS))),
+	list__map((pred(OS::in, FOS::out) is det :- FOS = fixed(OS)),
 		OutputSuppliersNames, OutputSuppliersPieces),
 	Pieces3 = [words("is not a subset of the head variables")],
 	term_errors_var_bag_description(HeadVars, Varset, HeadVarsNames),
-	list__map(lambda([HV::in, FHV::out] is det, (FHV = fixed(HV))),
+	list__map((pred(HV::in, FHV::out) is det :- FHV = fixed(HV)),
 		HeadVarsNames, HeadVarsPieces),
 	list__condense([Pieces1, OutputSuppliersPieces, Pieces3,
 		HeadVarsPieces], Pieces).
Index: compiler/term_pass1.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_pass1.m,v
retrieving revision 1.12
diff -u -b -r1.12 term_pass1.m
--- compiler/term_pass1.m	15 Mar 2003 03:09:11 -0000	1.12
+++ compiler/term_pass1.m	2 Nov 2003 13:26:20 -0000
@@ -130,7 +130,7 @@
 	PPId = proc(PredId, ProcId),
 	module_info_pred_proc_info(Module, PredId, ProcId, _, ProcInfo),
 	proc_info_headvars(ProcInfo, HeadVars),
-	MapToNo = lambda([_HeadVar::in, Bool::out] is det, (Bool = no)),
+	MapToNo = (pred(_HeadVar::in, Bool::out) is det :- Bool = no),
 	list__map(MapToNo, HeadVars, BoolList),
 	map__det_insert(OutputSupplierMap0, PPId, BoolList, OutputSupplierMap).
 
@@ -326,10 +326,7 @@
 		EqnSet0, EqnSet),
 	set__to_sorted_list(EqnSet, Equations),
 	map__values(PPVars, Vars),
-	Convert = lambda([Var::in, Coeff::out] is det,
-	(
-		Coeff = Var - 1.0
-	)),
+	Convert = (pred(Var::in, Coeff::out) is det :- Coeff = Var - 1.0),
 	list__map(Convert, Vars, Objective).
 
 :- pred convert_equations_2(list(path_info)::in,
@@ -345,13 +342,12 @@
 	Eqn = eqn(Coeffs, (>=), FloatGamma),
 	pred_proc_var(ThisPPId, ThisVar, Varset0, Varset2, PPVars0, PPVars1),
 	Coeffs = [ThisVar - 1.0 | RestCoeffs],
-	Convert = lambda([PPId::in, Coeff::out, Pair0::in, Pair::out] is det,
-	(
+	Convert = (pred(PPId::in, Coeff::out, Pair0::in, Pair::out) is det :-
 		Pair0 = VS0 - PPV0,
 		pred_proc_var(PPId, Var, VS0, VS, PPV0, PPV),
 		Coeff = Var - (-1.0),
 		Pair = VS - PPV
-	)),
+	),
 	list__map_foldl(Convert, PPIds, RestCoeffs, Varset2 - PPVars1,
 		Varset3 - PPVars2),
 	set__insert(Eqns0, Eqn, Eqns1),
Index: compiler/term_pass2.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_pass2.m,v
retrieving revision 1.12
diff -u -b -r1.12 term_pass2.m
--- compiler/term_pass2.m	26 May 2003 09:00:10 -0000	1.12
+++ compiler/term_pass2.m	2 Nov 2003 13:27:49 -0000
@@ -111,14 +111,13 @@
 	proc_info_headvars(ProcInfo, HeadVars),
 	proc_info_argmodes(ProcInfo, ArgModes),
 	partition_call_args(Module, ArgModes, HeadVars, InArgs, _OutVars),
-	MapIsInput = lambda([HeadVar::in, Bool::out] is det,
-	(
+	MapIsInput = (pred(HeadVar::in, Bool::out) is det :-
 		( bag__contains(InArgs, HeadVar) ->
 			Bool = yes
 		;
 			Bool = no
 		)
-	)),
+	),
 	list__map(MapIsInput, HeadVars, BoolList),
 	map__det_insert(RecSupplierMap0, PPId, BoolList, RecSupplierMap).
 
@@ -220,11 +219,7 @@
 		mode_is_input(Module, Mode),
 		ArgNum = 1
 	->
-		MapToNo = lambda([_Mode::in, Bool::out] is det,
-		(
-			Bool = no
-		)),
-		list__map(MapToNo, Modes, BoolList1),
+		list__map(map_to_no, Modes, BoolList1),
 		BoolList = [yes | BoolList1]
 	;
 		(
@@ -257,11 +252,7 @@
 	PPId = proc(PredId, ProcId),
 	module_info_pred_proc_info(Module, PredId, ProcId, _, ProcInfo),
 	proc_info_headvars(ProcInfo, HeadVars),
-	MapToNo = lambda([_HeadVar::in, Bool::out] is det,
-	(
-		Bool = no
-	)),
-	list__map(MapToNo, HeadVars, BoolList),
+	list__map(map_to_no, HeadVars, BoolList),
 	map__det_insert(RecSupplierMap0, PPId, BoolList, RecSupplierMap1),
 	init_rec_input_suppliers_single_arg_others(PPIds, Module,
 		RecSupplierMap1, RecSupplierMap).
@@ -592,5 +583,11 @@
 			LookforPPId, ProcContext, WeightSoFar1,
 			NewVisitedCalls, CallWeights, Cycles)
 	).
+
+%-----------------------------------------------------------------------------
+
+:- pred map_to_no(T::in, bool::out) is det.
+
+map_to_no(_, no).
 
 %-----------------------------------------------------------------------------
Index: compiler/termination.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.34
diff -u -b -r1.34 termination.m
--- compiler/termination.m	31 Oct 2003 03:27:30 -0000	1.34
+++ compiler/termination.m	2 Nov 2003 13:30:00 -0000
@@ -425,14 +425,14 @@
 	globals__io_lookup_bool_option(verbose_check_termination,
 		VerboseErrors),
 	( 
-		{ IsCheckTerm = lambda([PPId::in] is semidet, (
+		{ IsCheckTerm = (pred(PPId::in) is semidet :-
 			PPId = proc(PredId, ProcId),
 			module_info_pred_proc_info(Module0, PredId, ProcId,
 				PredInfo, _),
 			\+ pred_info_is_imported(PredInfo),
 			pred_info_get_markers(PredInfo, Markers),
 			check_marker(Markers, check_termination)
-		)) },
+		) },
 		{ list__filter(IsCheckTerm, SCC, CheckTermPPIds) },
 		{ CheckTermPPIds = [_ | _] }
 	->
@@ -443,12 +443,12 @@
 		io__set_exit_status(1),
 		{ module_info_incr_errors(Module0, Module) }
 	;
-		{ IsNonImported = lambda([PPId::in] is semidet, (
+		{ IsNonImported = (pred(PPId::in) is semidet :-
 			PPId = proc(PredId, ProcId),
 			module_info_pred_proc_info(Module0, PredId, ProcId,
 				PredInfo, _),
 			\+ pred_info_is_imported(PredInfo)
-		)) },
+		) },
 		{ list__filter(IsNonImported, SCC, NonImportedPPIds) },
 		{ NonImportedPPIds = [_ | _] },
 
@@ -462,10 +462,10 @@
 		{ VerboseErrors = yes ->
 			PrintErrors = Errors
 		; NormalErrors = yes ->
-			IsNonSimple = lambda([ContextError::in] is semidet, (
+			IsNonSimple = (pred(ContextError::in) is semidet :-
 				ContextError = _Context - Error,
 				\+ indirect_error(Error)
-			)),
+			),
 			list__filter(IsNonSimple, Errors, PrintErrors)
 		;
 			fail
Index: compiler/type_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_util.m,v
retrieving revision 1.129
diff -u -b -r1.129 type_util.m
--- compiler/type_util.m	27 Oct 2003 05:36:48 -0000	1.129
+++ compiler/type_util.m	2 Nov 2003 13:32:32 -0000
@@ -1309,9 +1309,9 @@
 	module_info_ctors(ModuleInfo, Ctors),
 	% will fail for builtin cons_ids.
 	map__search(Ctors, ConsId, ConsDefns),
-	MatchingCons = lambda([ThisConsDefn::in] is semidet, (
+	MatchingCons = (pred(ThisConsDefn::in) is semidet :-
 			ThisConsDefn = hlds_cons_defn(_, _, _, TypeCtor, _)
-		)),
+		),
 	list__filter(MatchingCons, ConsDefns, [ConsDefn]).
 
 %-----------------------------------------------------------------------------%
@@ -1897,43 +1897,36 @@
 
 apply_subst_to_constraint_proofs(Subst, Proofs0, Proofs) :-
 	map__init(Empty),
-	map__foldl(
-		lambda([Constraint0::in, Proof0::in, Map0::in, Map::out] is det,
-		(
-			apply_subst_to_constraint(Subst, Constraint0,
-				Constraint), 
+	map__foldl((pred(Constraint0::in, Proof0::in, Map0::in, Map::out)
+			is det :-
+		apply_subst_to_constraint(Subst, Constraint0, Constraint), 
 			(
 				Proof0 = apply_instance(_),
 				Proof = Proof0
 			;
 				Proof0 = superclass(Super0),
-				apply_subst_to_constraint(Subst, Super0, 
-					Super),
+			apply_subst_to_constraint(Subst, Super0, Super),
 				Proof = superclass(Super)
 			),
 			map__set(Map0, Constraint, Proof, Map)
-		)),
+	),
 	Proofs0, Empty, Proofs).
 
 apply_rec_subst_to_constraint_proofs(Subst, Proofs0, Proofs) :-
 	map__init(Empty),
-	map__foldl(
-		lambda([Constraint0::in, Proof0::in, Map0::in, Map::out] is det,
-		(
-			apply_rec_subst_to_constraint(Subst, Constraint0,
-				Constraint), 
+	map__foldl((pred(Constraint0::in, Proof0::in, Map0::in, Map::out)
+			is det :-
+		apply_rec_subst_to_constraint(Subst, Constraint0, Constraint), 
 			(
 				Proof0 = apply_instance(_),
 				Proof = Proof0
 			;
 				Proof0 = superclass(Super0),
-				apply_rec_subst_to_constraint(Subst, Super0, 
-					Super),
+			apply_rec_subst_to_constraint(Subst, Super0, Super),
 				Proof = superclass(Super)
 			),
 			map__set(Map0, Constraint, Proof, Map)
-		)),
-	Proofs0, Empty, Proofs).
+	), Proofs0, Empty, Proofs).
 
 apply_variable_renaming_to_type_map(Renaming, Map0, Map) :-
 	map__map_values(
Index: compiler/unneeded_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unneeded_code.m,v
retrieving revision 1.15
diff -u -b -r1.15 unneeded_code.m
--- compiler/unneeded_code.m	24 Oct 2003 06:17:51 -0000	1.15
+++ compiler/unneeded_code.m	2 Nov 2003 13:59:06 -0000
@@ -290,9 +290,9 @@
 		NeededVarsList),
 	map__init(WhereNeededMap0),
 	NeededEverywhere =
-		lambda([Var::in, NeededMap0::in, NeededMap::out] is det, (
+		(pred(Var::in, NeededMap0::in, NeededMap::out) is det :-
 			map__det_insert(NeededMap0, Var, everywhere, NeededMap)
-		)),
+		),
 	list__foldl(NeededEverywhere, NeededVarsList,
 		WhereNeededMap0, WhereNeededMap1),
 	map__init(RefinedGoals0),
Index: compiler/unused_args.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unused_args.m,v
retrieving revision 1.88
diff -u -b -r1.88 unused_args.m
--- compiler/unused_args.m	31 Oct 2003 03:27:31 -0000	1.88
+++ compiler/unused_args.m	2 Nov 2003 13:59:41 -0000
@@ -401,16 +401,14 @@
 		VarDep) :-
 	map__lookup(VarTypeMap, Var, Type),
 	type_util__vars(Type, TVars),
-	list__map(lambda([TVar::in, TypeInfoVar::out] is det, 
-		(
+	list__map((pred(TVar::in, TypeInfoVar::out) is det :-
 			map__lookup(TVarMap, TVar, Locn),
 			type_info_locn_var(Locn, TypeInfoVar)
-		)), 
-		TVars, TypeInfoVars),
+		), TVars, TypeInfoVars),
 	AddArgDependency = 
-		lambda([TVar::in, VarDepA::in, VarDepB::out] is det, (
+		(pred(TVar::in, VarDepA::in, VarDepB::out) is det :-
 			add_arg_dep(VarDepA, TVar, PredProcId, Var, VarDepB)
-		)),
+		),
 	list__foldl(AddArgDependency, TypeInfoVars, VarDep0, VarDep1),
 	setup_typeinfo_deps(Vars, VarTypeMap, PredProcId, TVarMap, 
 		VarDep1, VarDep).
@@ -541,10 +539,10 @@
 traverse_goal(_, foreign_proc(_, _, _, Args, Names, _, _),
 		UseInf0, UseInf) :-
 	assoc_list__from_corresponding_lists(Args, Names, ArgsAndNames),
-	ArgIsUsed = lambda([ArgAndName::in, Arg::out] is semidet, (
+	ArgIsUsed = (pred(ArgAndName::in, Arg::out) is semidet :-
 				ArgAndName = Arg - MaybeName,
 				MaybeName = yes(_)
-			)),
+		),
 	list__filter_map(ArgIsUsed, ArgsAndNames, UsedArgs),
 	set_list_vars_used(UseInf0, UsedArgs, UseInf).
 
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/getopt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/getopt.m,v
retrieving revision 1.28
diff -u -b -r1.28 getopt.m
--- library/getopt.m	3 Mar 2003 06:13:40 -0000	1.28
+++ library/getopt.m	2 Nov 2003 10:19:38 -0000
@@ -233,10 +233,10 @@
 
 getopt__process_options(OptionOps, Args0, OptionArgs, NonOptionArgs, Result) :-
 	getopt__get_option_defaults(OptionOps, OptionDefaultsPred),
-	solutions(lambda([OptionDataPair::out] is nondet, (
+	solutions((pred(OptionDataPair::out) is nondet :-
 			OptionDataPair = Option - OptionData,
 			call(OptionDefaultsPred, Option, OptionData)
-		)), OptionDefaultsList),
+		), OptionDefaultsList),
 	map__from_assoc_list(OptionDefaultsList, OptionTable0),
 	getopt__process_arguments(Args0, NonOptionArgs, OptionOps,
 		[], RevOptionArgs, OptionTable0, Result),
Index: library/relation.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/relation.m,v
retrieving revision 1.29
diff -u -b -r1.29 relation.m
--- library/relation.m	1 Sep 2003 10:11:18 -0000	1.29
+++ library/relation.m	2 Nov 2003 10:22:27 -0000
@@ -499,7 +499,7 @@
 	map__lookup(Fwd, Key, Set),
 	set__to_sorted_list(Set, List),
 	bimap__reverse_lookup(ElementMap, KeyEl, Key),
-	Lookup = lambda([U::in, V::out] is det,
+	Lookup = (pred(U::in, V::out) is det :-
 			bimap__reverse_lookup(ElementMap, V, U)),
 	list__map(Lookup, List, ListEls),
 	relation__append_to(KeyEl, ListEls, AssocList2),
@@ -594,7 +594,7 @@
 		relation__lookup_from(R2, Y_R2Key, Zs_R2Keys_Set),
 		set__to_sorted_list(Zs_R2Keys_Set, Zs_R2Keys),
 		list__map(relation__lookup_key(R2), Zs_R2Keys, Zs),
-		AddValue = lambda([Z::in, Rel0::in, Rel::out] is det,
+		AddValue = (pred(Z::in, Rel0::in, Rel::out) is det :-
 				relation__add_values(Rel0, X, Z, Rel)),
 		list__foldl(AddValue, Zs, Comp0, Comp)
 	;
@@ -1051,28 +1051,25 @@
 	set_bbbtree(relation_key), relation(T), relation(T)).
 :- mode relation__rtc_2(in, in, in, in, out) is det.
 
-relation__rtc_2([], _, _, RTC, RTC).
-relation__rtc_2([H | T], Rel, Visit0, RTC0, RTC) :-
+relation__rtc_2([], _, _, !RTC).
+relation__rtc_2([H | T], Rel, Visit0, !RTC) :-
 	( set_bbbtree__member(H, Visit0) ->
-		relation__rtc_2(T, Rel, Visit0, RTC0, RTC)
+		relation__rtc_2(T, Rel, Visit0, !RTC)
 	;
 		relation__dfs_3([H], Rel, Visit0, [], Visit, CliqueL0),
 		list__sort_and_remove_dups(CliqueL0, CliqueL),
-		list__foldl(lambda([K :: in, L0 :: in, L :: out] is det,
-			( relation__lookup_from(Rel, K, Followers0),
+		list__foldl((pred(K :: in, L0 :: in, L :: out) is det :-
+				relation__lookup_from(Rel, K, Followers0),
 			  set__to_sorted_list(Followers0, Followers),
 			  list__merge_and_remove_dups(Followers, L0, L)
-			)),
-			CliqueL, CliqueL, CliqueFollowers),
-		list__foldl(lambda([K :: in, L0 :: in, L :: out] is det,
-			( relation__lookup_from(RTC0, K, Followers0),
+			), CliqueL, CliqueL, CliqueFollowers),
+		list__foldl((pred(K :: in, L0 :: in, L :: out) is det :-
+				relation__lookup_from(!.RTC, K, Followers0),
 			  set__to_sorted_list(Followers0, Followers),
 			  list__merge_and_remove_dups(Followers, L0, L)
-			)),
-			CliqueFollowers, CliqueL, NewFollowers),
-		relation__add_cartesian_product(CliqueL, NewFollowers,
-			RTC0, RTC1),
-		relation__rtc_2(T, Rel, Visit, RTC1, RTC)
+			), CliqueFollowers, CliqueL, NewFollowers),
+		relation__add_cartesian_product(CliqueL, NewFollowers, !RTC),
+		relation__rtc_2(T, Rel, Visit, !RTC)
 	).
 
 :- pred relation__add_cartesian_product(list(relation_key), list(relation_key),
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list