Files
mercury/tests/hard_coded
Zoltan Somogyi c3b1c2003e Support constant "mutables". Though this sounds like a contradiction in terms,
Estimated hours taken: 3
Branches: main

Support constant "mutables". Though this sounds like a contradiction in terms,
they can be useful, because in some cases they are the best alternative.

- For some types, e.g. arrays, there is no way to write manifest constants.

- For some other types, one can write manifest constants, but the compiler
  may be too slow in compiling clauses containing them if the constant is
  very large (even after my recent improvements).

- Using a tabled zero-arity function incurs overhead on every access to check
  whether the result was recorded previously or not. This is a bad idea e.g.
  in the inner loop of a scanner (which may want to use an array for the
  representation of the DFA).

compiler/prog_item.m:
	Add a new attribute to say whether the mutable is constant or not.

compiler/prog_io.m:
	Recognize the "constant" mutable attribute.

compiler/prog_mutable.m:
	Provide predicates to construct the signatures of the get and set
	predicates of constant mutables. Rename some existing predicates
	to better reflect their purpose.

compiler/make_hlds_passes.m:
compiler/modules.m:
	Modify the code for creating mutables' get, set and init predicates
	to do the right thing for constant mutables.

doc/reference_manual.texi:
	Document the new attribute.

tests/hard_coded/pure_mutable.{m,exp}:
	Test the new attribute.
2006-04-27 07:34:37 +00:00
..
2004-01-08 04:49:47 +00:00
2003-05-26 09:01:46 +00:00
2003-05-07 06:42:44 +00:00
2003-05-07 06:42:44 +00:00
2003-05-26 09:01:46 +00:00
2003-05-26 09:01:46 +00:00
2003-07-28 15:50:45 +00:00
2003-07-28 15:50:45 +00:00
2003-07-28 15:50:45 +00:00
2003-05-26 09:01:46 +00:00
2003-05-26 09:01:46 +00:00
2005-09-12 13:00:15 +00:00
2005-09-12 13:00:15 +00:00