[m-rev.] for review: smart recompilation

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 29 04:14:41 AEST 2001


On 28-May-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> library/time.m:
> 	Add undocumented predicates to convert time_t to and from int.
> 	They are undocumented because they rely on the assumption that
> 	`time_t' fits in a Mercury `int'.

I don't think this is a good idea, if it can be avoided.
It would be better to write the code in a way which doesn't
rely on that assumption.

Also it would not be a great idea to write out time_t values as ints
into files, since that would cause problems if the time_t representation
is not the same on all platforms that access those files.

Instead, how about writing out the time_t values as strings,
e.g. in yyyy-mm-dd hh:mm:ss format, and then parsing them back in again?

The output can be done by

	char buf[sizeof "yyyy-mm-dd hh:mm:ss"];
	strftime(buf, sizeof buf, "%Y-%m-%d %H:%M:%S", tm_ptr);

If we could rely on X/Open, we could also use strptime() to parse it,
but it would probably be best to roll our own.

Using strings for the time stamps would also make it easier to debug...

> +++ browser/Mmakefile	2001/05/27 19:33:43
> @@ -57,6 +57,10 @@
>  		  esac							\
>  		`
>  
> +# XXX Smart recompilation currently doesn't work when the module
> +# name doesn't match the file name, so disable it in this directory.
> +MCFLAGS += --no-warn-smart-recompilation
> +

The comment here suggests that this will disable smart recompilation,
but the code seems to only disable _the warnings about_ smart recompilation.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  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