Averages/Arithmetic mean: Difference between revisions

Content added Content deleted
Line 547: Line 547:
#define std'patterns'*.
#define std'patterns'*.
#define std'dictionary'*.
#define std'dictionary'*.

// --- Sum ---


#class MeanAction
#class MeanAction
Line 582: Line 580:
theValue += aValue.
theValue += aValue.
]
#method start : aPattern
[
aPattern run:self.
^ self numeric.
]
]
}
}

// --- Program ---


#symbol Program =>
#symbol Program =>
[
[
'program'Output << MeanAction start:Scan::(1, 2, 3, 4, 5, 6, 7, 8).
#var anAction := MeanAction.
].
</lang>
Scan::(1, 2, 3, 4, 5, 6, 7, 8) run:anAction.
'program'Output << anAction numeric.
].</lang>


=={{header|Erlang}}==
=={{header|Erlang}}==