[m-dev.] Inductive goals

Peter Schachte pschachte at gmail.com
Thu Jan 23 19:52:48 AEDT 2014


On 23/01/14 19:12, Mark Brown wrote:
> On Thu, Jan 23, 2014 at 1:20 PM, Peter Schachte <pschachte at gmail.com> wrote:
>> The keyword 'maps' seems a bit quirky.  Why not 'in'?  It reads much
>> more naturally.
> Given the semantics, 'maps' and 'folds' are both instances of 'in'. I
> needed to distinguish the two cases so the syntax is unambiguous, and
> I thought the analogy with the map and fold predicates was reasonable.

I didn't see an 'in' in the proposal, so I don't see why you can't use
'in' as a generator.

This proposal is reminiscent of list comprehensions, where the maps and
folds constructs are analogous to the generator expressions.  Hence the
proposal for incorporating filtering.

>> Having "do true" on the end may be reasonably common; you could make the
>> 'do' optional, and true the default goal.
> That would lead to a "dangling do" problem. You don't want to go there.

What associativity did you plan for 'for' to have?  I assumed it would
be such that nested fors would need to be parenthesised, in which case
dangling dos can't happen.

-- 
Peter Schachte               In theory, theory and practice are the
University of Melbourne      same, but in practice they are not. --
schachte at unimelb.edu.au      Keith Rollins
www.cs.mu.oz.au/~schachte/
Phone: +61 3 8344 1338




More information about the developers mailing list