David Heffernan 2345 Posted December 1, 2020 1 hour ago, Lars Fosdal said: // Type inference makes the <T> argument to When optional when the parameters are the same type This is pretty flaky mind you. Sometimes type inference works, sometimes it doesn't and you have to be explicit. It is something that may have improved in more recent releases, but IIRC some issues remain. 1 Share this post Link to post
Lars Fosdal 1792 Posted December 1, 2020 The Byte example shows that flakiness, but it does seem to work well in 10.4.1 - also with regards to Error Insight. Share this post Link to post
Stefan Glienke 2002 Posted December 2, 2020 20 hours ago, David Heffernan said: How I wish we could have generic functions outside of classes or records. That or something like this. 1 Share this post Link to post
Fr0sT.Brutal 900 Posted December 17, 2020 (edited) In the exactly same situation (using extra unit for just one 3-lined function annoys me like hell) I ended up with most trivial solution - I named my functions `IfTh`. Edited December 17, 2020 by Fr0sT.Brutal 1 Share this post Link to post
TonyB 3 Posted December 19, 2020 On 12/18/2020 at 12:31 AM, Fr0sT.Brutal said: In the exactly same situation (using extra unit for just one 3-lined function annoys me like hell) I ended up with most trivial solution - I named my functions `IfTh`. Mine - in use for the last 20 years - is named iif. Yes, I was a FoxPro user in the 1990s! I was looking at something in one of my programs a few weeks back and realised it was there to save space when saving to floppy disk. If there's such a thing as a code archaeologist they could have a great time with my codebase. Share this post Link to post
Fr0sT.Brutal 900 Posted December 20, 2020 On 12/19/2020 at 1:28 PM, TonyB said: Mine - in use for the last 20 years - is named iif This one is nice as well, SQL-style Share this post Link to post