This function literal does a pattern match on the message instance to decide how to handle the message.
这个字面函数给消息做了一个模式匹配来决定它被如何处理。
In this case, we passed in the following function literal.
在这个例子里,我们传入这样的一个字面函数。
The result of this call is returned by the function literal.
调用的结果会被函数返回。
Let me write a function, in fact the literal thing I would do is to say, identify the things that change, give each of them a variable name because I want to refer to them, and then write a function that captures the rest of that computation just with those variable names inside.
让我来写个方法,实际上我的意思是,辨别出变化的东西,然后给它们逐个命名以区分,然后写一个用来计算,这些变量的,包括计算过程的方法。
应用推荐