Menu
  • HOME
  • TAGS

int -> string conversion in Funscript?

visual-studio-2013,f#,funscript

This looks like a bug in FunScript (i.e. missing mapping that should certainly be there), so if you can submit a bug report on GitHub, that would be good. (I'm not sure what is going wrong here, because there is a mapping for string in the source code. In any...

How to pass arguments to funscript function?

f#,funscript

FunScript attempts to translate the code of all top-level declarations. As you mentioned, this includes thy MyJSFunc function but also the myStr value (which is not possible as it accesses the file system). One way to solve this is to turn myStr into a local declaration. That way, the F#...

How to pass a “Function” type in FunScript?

f#,funscript

This works more or less as you would expect when passing lambdas between F# and C#. In F#, functions can be curried, while in C# (and JavaScript) cannot. So when you need to send a lambda from F# to C# you need to convert it first. In F# this is...

FunScript querySelector null result

f#,funscript

Yes, it's true the F# code assumes Element is not nullable. You can trick the compiler to think otherwise in several ways. Probably the easiest one is to box the value like this: let el = Globals.document.querySelector(".myclass") if (box el) = null then doSomething() else doSomethingElse()` box will be ignored...