59 Matching Annotations
  1. Sep 2021
  2. Nov 2018
    1. File::open("hello.txt")?

      If the value of the Result is an Ok, the value inside the Ok will get returned If the value is an Err, the Err will be returned from the whole function

    1. 印象中是分发到所有MainSection类型的实例,实例需要自己决定是否要react on这个action<br>比如给所有的TodoItem发一个 complete id:1 的消息,所有TodoItem会收到,但应该只有id:1 的item通过比较id相等来做出反应

    1. hi, 如果没记错第二章中的可持续化数据结构的引的源代码是clojure源代码(不是clojure代码),其实就是java,应该也还好吧,对应的图应该更好理解。

      惰性求值的实现确实用了clojure的实现作为例子,是偷懒啦哈哈,(如果出版社还再版的话)我改改

    2. 你好,我买了您的书《函数式攻城指南》,我才读到第二章,但是我对书里面出现的Clojure代码完全搞不懂(一个是持久性数据结构的实现,一个是惰性求指的实现),因为我对Clojure这门语言完全不了解。我在想如果这些贴clojure源码的内容如果转化为js来讲解会不会好一些?

    1. 6.2.1 一般解法里面,landRight 的定义有问题吧。如果按照原先的定义的话,

      var result = R.pipe(landLeft(1), landRight(2), landLeft(2))([0, 0]);<br>console.log(result);

      // 结果为 [4, 1] ,并不是预期中的 [3, 2]<br>// 具体看这里 http://ramdajs.com/repl/?v=...

      正确的定义应该是这样吧:

      var landRight = R.curry(function(n, pole) {<br> // 感觉还不如直接 return [pole[0], pole[1] + n] ...<br> return R.reverse(landLeft(n, R.reverse(pole))); <br>});

    1. This is a very useful information for those people who wanted to achieve some desirable output on how are they going to use that kind of language in programming that will be going to be a perfect thing for their projects. At least, through this kind of idea, they can make this tool as a better tool than another tool out there.