FSharp.Interop.Dynamic
F# Dynamic Operator using the DLR (Portable Class Library WinRT, .NET 4.5, Silverlight 5)
Install from nuget
PM> Install-Package FSharp.Interop.Dynamic
Build Status
Usage
target?Property
, target?Property<-value
, and target?Method(arg,arg2)
allow you to dynamically get/set properties and call methods
Also >?>
(dynImplicit
), >>?>>
(dynExplicit
) and more.
Examples:
###System.Dynamic open FSharp.Interop.Dynamic let ex1 = ExpandoObject() ex1?Test<-"Hi"//Set Dynamic Property ex1?Test //Get Dynamic
###SignalR
open FSharp.Interop.Dynamic
type MyHub =
inherit Hub
member x.Send (name : string) (message : string) =
base.Clients.All?addMessage(name,message) |> ignore
###MVC ViewBag
x.ViewBag?Name<-"George"
#Caveats:
The dlr
is incompatible with interface explicit members, so are these operators, just like C#'s dynamic
keyword.
Maintainer(s)
The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)