what in particular are you having
what in particular are you having trouble with?
F# has
ref T
via byref<'T>
, in T
via inref<'T>
, out T
via outref<'T>
you can declare pointers via nativeptr<'T>
and for external functions in particular (DllImport
) it directly supports T*
and T&
for pointers/byrefs3 Replies
I was having an issue with this in particular:
I cannot find any F# equivalent of
var availableLayers = new LayerProperties[layerCount];
, I only get let layers = LayerProperties layerCount
which returns LayerProperties
and not an array, as well as not being able to replicate
in any capacityyou want
let availableLayers = Array.zeroCreate layerCount
pretty sure
https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/arrays#create-arrays
F# in general has a lot of the functionality either in patterns or via custom F# helper types
https://github.com/tannergooding/fsharp-demoapp is an older demo-app I did that has some Win32 interop and does software rendering using hardware intrinsics, entirely in F#Oh man, I didn't even realize that was empty array!
let mutable layers: LayerProperties[] = Array.zeroCreate <| int layerCount
this works
https://discord.com/channels/521092042781229087/607634593201520651/1202199796719554561Now I can put this idea to rest a little while longer