[TransWarp] Proposed peak.binding API change

Niki Spahiev niki at vintech.bg
Wed Sep 3 04:08:51 EDT 2003


Phillip J. Eby wrote:

> So, here's my "new new proposal"...
> 
> 
> Before
> -----------------------------------------
> binding.Once(aFunction)
> binding.New(someType)
> binding.New("somemodule.sometype")
> binding.Constant(value)
> binding.Copy(expr)
> 
> binding.bindTo(key)
> binding.requireBinding("what's required")
> binding.Acquire(key)
> binding.bindSequence(key1,key2,...)
> binding.delegateTo("attrName")
> 
> 
> After
> -----------------------------------------
> binding.Provide(aFunction)
> binding.Provide(someType)
> binding.Provide("somemodule.sometype")
> binding.Provide(default=value)
> binding.Provide(lambda: expr)
> 
> binding.Require(key)
> binding.Require(doc="what's required")
> binding.Require(key, offerAs=[key])
> binding.Require( [key1,key2,...] )
> binding.Require( binding.delegate("attrName") )

IMHO i preffer more names (as explicit is better than implicit).

[...]

> Anyway...  if someone has a good suggestion for an alternative name to 
> Provide, that would be most helpful.  I'd also be interested in feedback 
> on this proposal, which I haven't discussed with anyone at this point, 
> since I thought of it after everybody else left work for the day.  :)

myAttr = binding.Define( ... )

Niki Spahiev




More information about the PEAK mailing list