[e-lang] Sugar for ad-hoc facet construction

David Hopwood david.hopwood at industrial-designers.co.uk
Tue May 15 17:21:31 EDT 2007


Mark Miller wrote:
> On 5/14/07, Kevin Reid <kpreid at mac.com> wrote:
>>On May 14, 2007, at 16:02, Mark Miller wrote:
>>
>>>    ? def issuer := <donut:makeIOUIssuerAuthor>(timer)("Sugar")
>>>    # value: <issues Sugar>
>>>
>>>It became an author because it now bundles in some record keeping, and
>>>so needs an alleged timer which responds to a "now()" message with an
>>>integer.
>>
>>If that's all it will ever possibly need, why not pass just timer.now?
>>
>>   ? def issuer := <donut:makeIOUIssuerAuthor>(timer.now)("Sugar")
> 
> That would have been a better design. I didn't think of it because I'm
> still not used to the verb-curry syntax.

This works only because a single method is needed.

Is the need for facet construction common enough to justify adding
sytactic sugar to construct facets which may have two or more methods,
e.g. timer.{now,every}?

(That syntax won't work, and timer is perhaps not a good example, but
you get the idea.)

-- 
David Hopwood <david.hopwood at industrial-designers.co.uk>



More information about the e-lang mailing list