Mike

I believe that let! and friends are used to force evaluation of an asynch computation. So, for instance,

<i>let! foo = exp<i> requires that "exp" be of type async<`a> and "foo" then will be of type `a. If instead you'd written <i>let foo = exp<i> where "exp" is of type async<`a> then "foo" would also be of type async<`a>. So, you can think of "exp" as holding a (possibly) delayed computation and the use of the bang (!) forces that computation to complete and produce a value. Similar semantics for <i>return!, yield!<i> Hope this helps. Bill <quote> This has proven very difficult to find anything on in search engines, this site, etc. Can someone please explain the meaning of putting an exclamation point at the end of let and return and other keywords? Thanks ahead of time!</quote>

By on 11/26/2008 8:58 AM ()

Thanks a lot I appreciate the replies!

By on 12/8/2008 11:48 AM ()

This answer does not help explain or motivate these keywords, but if you want an operational definition, check out 6.4.10 of the spec:

[link:research.microsoft.com]

which explains the desugaring of F# computation expressions (computation expressions (a.k.a. workflows or monads) are they only syntactic form that allow the '!' keywords).

By on 11/25/2008 11:55 PM ()

Hi,
you can find some explanation in my article here: [link:tomasp.net]. Getting more detailed information about this is a bit difficult, because this is an advanced feature, so you can find a good explanation in F# books. If is most frequently used with F# "asynchronous workflows",so this may be a good keyword to look for.

Expert F# ([link:www.expert-fsharp.com]) covers this feature, and I'm going to explain it in my book Real-World Functional Programming in .NET as well ([link:functional-programming.net]), which is more focused at people with no prior FP experience - it assumes that you know C# 2.0.

By on 11/24/2008 12:46 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper