I'm trying to work through an example in Expert F#, which is based on v1.9.2, but the CTP releases after that have changed enough that some of them don't even compile anymore.
I'm running into some trouble with listing 13-13. Here's the snippet of the urlCollector
object definition:
let urlCollector =
MailboxProcessor.Start(fun self ->
let rec waitForUrl (visited : Set<string>) =
async { if visited.Count < limit then
let! url = self.Receive()
if not (visited.Contains(url)) then
do! Async.Start
(async { let! links = collectLinks url
for link in links do
do self <-- link })
return! waitForUrl(visited.Add(url)) }
waitForUrl(Set.Empty))
I'm compiling with Version 1.9.6.16, and the compiler complains thusly:
- incomplete structured construct at or before this point in expression [after the last paren]
- error in the return expression for this 'let'. Possible incorrect indentation [refers to the let defining
waitForUrl
]
Can anyone spot what's going wrong here?