Unrestricted dictionary

Dear all,

I'd like to propose a kind of dictionary where the keys are unrestricted.

The use case is the Web Animations specification[1] where we are 
considering providing an interface similar that that of the Raphaƫl 
library[2]. Namely, like so:

   var anim = new Anim(elem, { dur: 2, height: '100px' });

In this example, 'height' corresponds to a CSS property on elem which we 
want to animate but could potentially be any animatable CSS property.

This is obviously a lot easier than splitting this out into a separate 
property like so:

   var anim = new Anim(elem, { dur: 2, prop: 'height', to: '100px' });

particularly when animating multiple CSS properties simultaneously.

I spoke with Cameron about this and it seems having a kind of 
unrestricted dictionary-like thing would be useful for cases like this.

I'm afraid I'm still unfamiliar with the terminology of WebIDL but I 
think roughly what is required is the ability to have a collection of 
properties where the set of properties/keys is unrestricted and the type 
of the values is also free. Obviously prose would be required to 
describe how to interpret whatever members were found.

Does that make any sense?

Best regards,

Brian

[1] https://dvcs.w3.org/hg/FXTF/raw-file/tip/web-anim/index.html (see 
section 5.1, 'the Anim interface', for where the use case in this email 
appears)
[2] http://raphaeljs.com/

Received on Wednesday, 15 August 2012 00:43:31 UTC