On Thu, Aug 22, 2013 at 9:49 PM, Oren Ben-Kiki <o...@ben-kiki.org> wrote:
> Is it possible to implement something like Haskell's Dynamic value holder > in Rust? > > I'm sure you've all seen it, but C# has something similar but a lot more powerful. Basically, it has support for allowing runtime resolution of types if they are declared as having the "dynamic" type. But it's even better, the specification for how that resolution happens is defined in a library. This way you can work directly with dynamic values without having to cast them first (e.g. imagine just "dotting your way" through a JSON document and parse it on-demand). See For how it's used: http://msdn.microsoft.com/en-us/library/vstudio/dd264736.aspx For how to implement dynamic libraries (e.g. decide what happens when a field is accessed, or a method is called, on your dynamic objects): http://msdn.microsoft.com/en-us/library/vstudio/system.dynamic.dynamicobject.aspx -- Sebastian Sylvan
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev