[m-rev.] Proposal: move lazy.m from extras/ to library/

Ian MacLarty maclarty at csse.unimelb.edu.au
Wed Sep 29 13:55:35 AEST 2010


On Wed, Sep 29, 2010 at 8:17 AM, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
>
> Hi.
>
> I'd like to move lazy.m from extras/lazy_evaluation/lazy.m to library/lazy.m or
> perhaps deep_profiler/lazy.m
>
> I've cleaned it up somewhat, this removes the foreign code and replaces it with
> mutvars.  Should I commit this back to extras first?
>
> This is my current version:
>
>
> %-----------------------------------------------------------------------------%
> % vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
> %-----------------------------------------------------------------------------%
> % Copyright (C) 1999, 2006, 2009-2010 The University of Melbourne.
> % This file may only be copied under the terms of the GNU Library General
> % Public License - see the file COPYING.LIB in the Mercury distribution.
> %-----------------------------------------------------------------------------%
> %
> % lazy.m - provides support for optional lazy evaluation.
> %
> % Author: fjh, pbone.
> % Stability: medium.
> %
> % This module provides the data type `lazy(T)' and the functions
> % `val', `delay', and `force', which can be used to emulate lazy
> % evaluation.
> %
> % Note that laziness is most useful for recursive data types,
> % and for that case, you can't just use e.g. `lazy(list(T))',
> % since that would only be lazy at the top-level; instead
> % you need to define a new recursive data type lazy_list(T)
> % which uses lazy(T) for the recursion.  See the module
> % `lazy_list.m' for an example of how to do this.
> %

Given the above comment, I think you should move lazy_list.m into library too.

> % See the file README in extras/lazy_evaluation for additional documentation.
> %
> % This code has been copied and modified from extras/lazy_evaluation.  Foreign
> % code has been removed.
> %

I would remove the references to extras.  If the documentation in the
README in extras is useful, then I'd put it into this module.

Ian.

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



More information about the reviews mailing list