For loop variable scope vs closures: GoLang and DMN FEEL



For loop variable scope vs closures: GoLang and DMN FEEL

For loop variable scope vs closures: GoLang and DMN FEEL

In this instalment of “a video that could be a blog post” I want to share with you initial my impressions while learning #golang and stumbling upon a weird behaviour, followed by transposing the same concept as applicable in the #DMN FEEL expression language. Follow on a ride about for-loop variable scope Vs closures and don’t let your scope escape!!

Resources for this video:
– Fixing For Loops in Go 1.22 original article: https://go.dev/blog/loopvar-preview
– I’ve enjoyed this video-commentary: https://www.youtube.com/watch?v=P7pICDfsfgM
– An awesome course on Go: https://www.ardanlabs.com/training/ultimate-go (I’ve been following it on Pearson education video)
– Simple example using Table based testing in Go: https://gist.github.com/tarilabs/6b60e2babb6ef69864140595cb5c6c99
– oops Kubernetes was impacted too at least in some of Table based testing: https://github.com/kubernetes/kubernetes/issues/98213#event-6581848177
– oops #Drools DMN open source engine was impacted analogously, let’s fix it: https://github.com/apache/incubator-kie-drools/pull/5537
– Y Combinator in DMN FEEL: https://blog.kie.org/2020/04/functional-programming-in-dmn-it-feels-like-recursing-my-university-studies-again.html

0:00 Introduction
0:53 Fixing For Loops in Go 1.22
3:18 Simple example using Table based testing
6:16 oops Kubernetes was impacted too at least in some of Table based testing
7:53 oops #drools DMN open source engine was impacted analogously, let’s fix it:

Comments are closed.