Topic: foreach and for all statements

topics > computer science > programming > program control > Group: repetitive control

control file
quantified repetition
processing a sequence
set operations
set-oriented languages
uniform reference to data


A general repetitive control structure is 'for all Elements in Set-or-list do Program'. It parallels universal quantification in mathematics. The for-all acts as a generator or control vector for the program. It processes a composite structure or order independent set in terms of processing individual components. This provides uniform reference for a set's or list's components. (cbb 5/80)
Subtopic: iterator name up

Quote: temporary name for iterating over a set; e.g., "with all flowers calling each the flower" [»paneJF9_2002]

Subtopic: examples up

Quote: use "all ..." for queries; returns all cards with that value in any property; ignores trailing "s" [»paneJF9_2002]
Quote: ring operations to insert, remove, copy, foreach forward/backward; no special cases for empty and one member rings [»suthIE5_1963]
QuoteRef: buxtJN_1962 ;;95 FOR I seta over all value in seta
QuoteRef: chamDD_1971 ;;264 quoted name means execute for each value in tuple
QuoteRef: earlJ4_1974 ;;35 have existential (there exists) and universal for all operators over sets.o
QuoteRef: feldJA8_1969 ;;443 FOREACH x IN sons DO MAKE father.x==john
QuoteRef: feldJA8_1969 ;;444 FOREACH father. (father.x) ==z DO MAKE granddad.x==z xz are local
QuoteRef: kayAC6_1968 ;;33 a as set or list, sets a to next value and returns true if it exists for use in for statement while statement do statement
QuoteRef: grisRE4_1979 ;;21 "the 'every construct produces all alternatives of an expression and evaluates a 'do clause for each alternative. An example is every i := (1|3|7) do f(i)"
QuoteRef: hehnEC7_1975 ;;21 standard control functions eg for name in sectorlist
QuoteRef: simscrip_1971 ;;121 For each entity and For each set-name (can give starting location or reverse order)
QuoteRef: sammJE_1969 ;;574 for v in y does for each element in list y
QuoteRef: sammJE_1969 ;;574 for v on y does for each list contained in y (starts with y itself)
QuoteRef: markHM_1963 ;;40 Simscript has a for all operator
QuoteRef: sammJE_1969 ;;226 sum i=1(1)10: i*2 == i**2, also prod for

Related Topics up

Topic: control file (10 items)
Topic: iterator (13 items)
Topic: quantified repetition (11 items)
Topic: processing a sequence (17 items)
Topic: set operations (12 items)
Topic: set-oriented languages (20 items)
Topic: uniform reference to data
(34 items)

Updated barberCB 6/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.