OEP

133

Title

Iterator-replicators

Summary

Permit IN keyword in replicators to iterate over an array.

Owner

Adam Sampson <ats@offog.org>

Status

Proposed

Date-Proposed

2006-03-14

Keywords

language replicators

It is sometimes useful to be able to iterate over an array -- for example, searching for an unused slot. The obvious semantics for this use abbreviation:

SEQ el IN array
  out.thing (el, out!)

This can be trivially expanded by the compiler into the equivalent code:

SEQ $$temp = 0 FOR SIZE array
  el IS array[$$temp]:
  out.thing (el, out!)

OEP/133 (last edited 2007-09-27 00:53:47 by ats1)