[m-rev.] bug fix: deconstructing closures in hlc grades

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 25 23:38:08 AEDT 2002


On 25-Feb-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Fix a bug: closures do not contain valid layout information in hlc grades,
> so in those grades closures cannot be deconstructed.
...
> library/deconstruct.m:
> 	Document this behavior.
...
> Index: library/deconstruct.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/library/deconstruct.m,v
> retrieving revision 1.5
> diff -u -b -r1.5 deconstruct.m
> --- library/deconstruct.m	24 Feb 2002 11:53:29 -0000	1.5
> +++ library/deconstruct.m	25 Feb 2002 06:53:25 -0000
> @@ -64,10 +64,12 @@
>  	%	- for strings, the string, inside double quotation marks
>  	%	- for characters, the character inside single quotation marks
>  	%	- for predicates, the string <<predicate>>, and for functions,
> -	%	  the string <<function>>, except with include_details_cc,
> -	%	  in which case it will be the predicate or function name.
> -	%	  (The predicate or function name will be artificial for
> -	%	  predicate and function values created by lambda expressions.)
> +	%	  the string <<function>>, except with include_details_cc
> +	%	  in low-level C grades (those starting with none, reg, jump,
> +	%	  fast, asm_jump or asm_fast), in which case it will be the
> +	%	  predicate or function name. (The predicate or function name
> +	%	  will be artificial for predicate and function values created
> +	%	  by lambda expressions.)

The documentation for the standard library should define the behaviour
in terms which are independent of any implementation.  It's OK to specify
what happens for particular back-ends only if this is preceded by an
implementation-independent definition of the semantics, and the
back-end-specific behaviour is documented as being specific to this
implementation (e.g. "For the University of Melbourne Mercury
implementation, ...").

Also, we should not assume that people will read the user's guide
before they read the library reference manual.
If the library documentation refers to grades, it should include
a pointer to the appropriate section in the user's guide.
(It might be better to just refer to the `--high-level-code' option.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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