> On 05 Sep 2016, at 18:03, Sean P. DeNigris <[email protected]> wrote:
> 
> Sven Van Caekenberghe-2 wrote
>> Could you elaborate a bit on the concrete use case (or a similar example)
>> ?
> 
> Sure. Say the data rows are events which contain, among other things, the
> following fields:
> -a date
> - an employeeID
> - a title (as in position in the company e.g. CEO).
> 
> Usually, the title is filled in, but sometimes it's missing. When it's
> missing, it can be calculated by `(employees detectID: employeeID) titleOn:
> timestamp`*, but if it's present, you should just use the value in the field
> because the lookup is inconsistent and expensive.
> 
> Thanks for following up!
> 
> * The timestamp is necessary because you're actually searching through the
> employment history to see the title on that particular date in the past.

Could you write your #title accessor then as

title
  ^ title ifNil: [ title := (employees detectID: employeeID) titleOn:
timestamp ]

?

Or do you then again have problems with the #emptyFieldValue: from your 
previous issue ?


Reply via email to