I am debugging and trying to print some logic value on the screen.
But I have no idea how to print anything that is not of type string.
I am debugging and trying to print some logic value on the screen.
But I have no idea how to print anything that is not of type string.
yeah no ToString
for logic. +vote to adding this
You have to do the less elegant way:
if (Logicc = true): Logger.Print("true") else: Logger.Print("false")
Yes - it is a pain not having it.
Here is another variation of what you suggested:
Logger.Print(if(Logicc?) {"true"} else {"false"})
In the future maybe we could add an extension function for logic
:
Logger.Print(Logicc.ToString())
I would love that addition
I actually created a one-liner extension method for this yesterday. Seemed to work as expected. I added the <computes>
so that it could be called from a failure context, but I’m still a little green in that area of verse, so maybe that’s not a good thing to do.
(Logic : logic).ToString<public>()<computes> : []char = if (Logic?) then "true" else "false"