You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often use guids in my url since I like to generate unique ids in a simple way. I know this might be tricky, but would it be possible to add a specifier for guid in pathScan? Without that option using routes that contain one or more guid values aren't nice or type safe.
Usually I just treat guids as strings and parse them when necessary.
I spent a little bit of time trying to get pathScan to support parsing guids via the 't' format modifier but it does not seem trivial if at all possible.
I think that is the easiest at the moment, but why would you differ the behavior when having a guid or an int in a string when a guid has a specific format.
I played around with the TextWriterFormat and it seems to be possible to use %A and then specify specifically that %A should be a guid.
let fmtStr = "somepath/%s/%A"
let textFormat = Printf.TextWriterFormat<string -> Guid -> unit>(fmtStr)
printfn textFormat "stuff" (Guid.NewGuid())
Not sure it helps, or if it is possible to get something like that to work in the sscanf function. The best thing would be if there was a formatter for guid.
I often use guids in my url since I like to generate unique ids in a simple way. I know this might be tricky, but would it be possible to add a specifier for guid in
pathScan
? Without that option using routes that contain one or more guid values aren't nice or type safe.I tried using active patterns to see what it would be and I think it way to verbose if you have a lot of urls in an application, https://gist.github.com/mastoj/b191859e2c45bd233fb0.
Another approach would be to just read the parameters as a regular string and parse it in the webpart, but that isn't that nice either.
I guess this won't be fixed unless a specifier for guid is added to the
Core.Printf
module, or can it be added without guid support inCore.Printf
?The text was updated successfully, but these errors were encountered: