I'm working on IronJS, and one of our source files is getting very long.
Right now, I'm trying to get .NET interop working. I'm adding the TryBinaryOperation
method to the Undefined
so that C# can use the JavaScript semantics of the Undefined value.
However, this introduces a dependency on the Operators
type, which causes a circular dependency.
Runtime.fs:
type BoxedValue() =
struct
// Contains IsUndefined and get_Undefined, referencing the Undefined class, below.
...
and type Undefined() =
inherit DynamicObject()
...
override x.TryBinaryOperation(binder:BinaryOperationBinder, arg:obj, result:obj byref) : bool =
// Here, we are referencing BoxedValue, above.
result <- Operators.add(Und, BoxedValue.Box(arg))
true
...
Operators.fs:
type Operators =
...
// Here, we are referencing BoxedValue.
static member add(BoxedValue l, BoxedValue r)
...
So, we have this set of dependencies:
Ideally, we would like to split each of these into its own file.
Is it possible in F# to have cross-file circular dependencies?