fsprojects / FSharp.Interop.Dynamic

DLR interop for F# -- works like dynamic keyword in C#
https://fsprojects.github.io/FSharp.Interop.Dynamic/
Apache License 2.0
95 stars 14 forks source link

Can I wrap a value of arbitrary type into an Expando #22

Closed robkuz closed 4 years ago

robkuz commented 4 years ago

So that

 let x = Expando(some_value_of_some_arbitrary_type); let z = x?SomeProperty

is possible?

jbtule commented 4 years ago

Is this what you are asking?

 let unknown:obj = some_value_of_some_arbitrary_type
 let x = unknown?SomeProperty

or maybe this?

open System.Dynamic
let expando = ExpandoObject()
expando?SomeProperty <- some_value_of_some_arbitrary_type
let x = expando?SomeProperty

Both of these should work.