Fork me on GitHub
#core-async
<
2018-12-29
>
smnplk01:12:39

@caleb.macdonaldblack isn't that load-urls function missing a (when urls ... check ?

smnplk01:12:14

Also, it's called without specifying a channel

caleb.macdonaldblack01:12:08

Im not sure if the nil check on the url is necessary here, however it is odd the example doesn't pass in a channel into 'load-urls'

caleb.macdonaldblack01:12:51

Perhaps put! can take nil instead of a channel? But then wouldnt the call to load-urls throw an arity exception? Maybe its just an example to explain how put! works but the actual code and whether or not it runs doesn't matter for the explaination

smnplk23:12:53

@caleb.macdonaldblack I am pretty sure it's just docs written in a hurry. Nil check on urls parameter is necessary, because in the callback to put! we are basically calling (load-urls (next urls) .. Next returns nil once we process last url. Then calling (first nil) throws NullPonterException.

smnplk23:12:32

Anyway, it's just a minor thing.