tag:blogger.com,1999:blog-7577421612120825312.post6496249450473816508..comments2023-10-03T10:41:13.944+01:00Comments on Functional Fun: C# 5.0 and the sample that made me go “wow!”Anonymoushttp://www.blogger.com/profile/01345100698738870730noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-7577421612120825312.post-67707788175892209212014-03-05T19:47:11.113+00:002014-03-05T19:47:11.113+00:00Now that is elegantNow that is elegantGrantnoreply@blogger.comtag:blogger.com,1999:blog-7577421612120825312.post-63908764405982129372011-03-29T19:12:26.477+01:002011-03-29T19:12:26.477+01:00I have seen the async functionality in F#, but for...I have seen the async functionality in F#, but for me the syntax rather obscured what was going on. With 5.0 I get understood is really fast.alliance level guide expert Peterhttp://alliancelevelingguidex.com/noreply@blogger.comtag:blogger.com,1999:blog-7577421612120825312.post-59634140491075225442011-01-17T15:57:55.315+00:002011-01-17T15:57:55.315+00:00The comment says "Switch _BACK_ to UI thread&...The comment says "Switch _BACK_ to UI thread". There are much more syntactically meaningful ways to enter and leave a operational context. How about something like this:<br /><br />await(new SynchronizationContext.SwitchTo()) {<br /> // Do cpu intensive work<br />}<br /><br />I know, using a scope block to enclose a scope of operation; ground breaking.<br /><br />When a developer calls AsyncSwitchToCPU from a thread that isn't the UI thread, this code does not "Return" to the UI thread; it enters the UI begins running on the UI thread potentially confusing the calling code.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7577421612120825312.post-84678197482690072592010-11-04T11:18:00.415+00:002010-11-04T11:18:00.415+00:00It's just awesome right? :-)
And you can use t...It's just awesome right? :-)<br />And you can use the CTP today so :pAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7577421612120825312.post-57170777527954462612010-11-03T09:41:18.901+00:002010-11-03T09:41:18.901+00:00@Robert,
Thanks for the reminder. I had seen the...@Robert,<br /> Thanks for the reminder. I had seen the async functionality in F#, but for me the syntax rather obscured what was going on. When I saw the way they've done it in C# 5.0, I was able to grasp it intuitively - and therein lies Anders' genius!Anonymoushttps://www.blogger.com/profile/01345100698738870730noreply@blogger.comtag:blogger.com,1999:blog-7577421612120825312.post-86085389282453938392010-11-03T09:37:08.929+00:002010-11-03T09:37:08.929+00:00Want to use this kind of functionality today? It&#...Want to use this kind of functionality today? It's already available in F#. See Tomas Petricek's blog for a comparison: http://tomasp.net/blog/csharp-fsharp-async-intro.aspxUnknownhttps://www.blogger.com/profile/04770530304906171660noreply@blogger.com