Git Product home page Git Product logo

book-source's Introduction

book-source's People

Contributors

fogus avatar gpg0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

book-source's Issues

Dependencies

It would be great if all the chapters worked right out of the box as node modules, so you can play with them at the node.js REPL or require() them into a temporary javascript file to play with.

For example, Chapter02 is dependent on truthy() and existy() and underscore.js, but you need to modify the chapter to make these available in chapter02.

Caveat: To make it easy to play with at the REPL, you may need to do something with _.noConflict since the node REPL uses _ to store the previous REPL value.

truthy fn

Im not sure if this is the correct implementation of the truthy function as 0 & ' ' are both falsey values in javascript which is confusing..

I think you should use the boolean operator to tell if the value is truthy

function truthy(x){ return !!x; }

truthy needed before truthy used? true!

just a comment about the ordering of the book... truthy is needed before its shown or discussed in the book. :) might consider ordering that sooner or at least noting where truthy is coming from otherwise comparator function doesn't work before you know the truthy!

existy() and truthy()

Awesome book. I love it.

About your helper predicates, existy() and truthy(), couldn't you just do:

function existy(x) { return x != null; }
function truthy(x) { return !!x; }

Granted, it doesn't really illustrate the idea of composing functions from functions but is more succinct, I think.

Example on 'To Curry Right, or To Curry Left' is harder to understand

Hi, on page 94 you explain the right vs left currying techniques, but in the example you provide there isn't much 'right or left' action going on. That only happens later on, specially with the blueGreenish example on page 99.

My understanding is that on page 94 the difference actually happening inside the div function, and the order of the parameters is not that relevant (from a curry point of view), where on the blueGreenish you can really see the currying from the rightmost argument.

I think the 'To Curry Right, or To Curry Left' section would be easier to understand on first read if the 'HTML Hexadecimal values with specific hues' example was used instead

Error on page 32

There is an error on page 32. It is stated that the following function returns the global Window object, but it returns the object b:

var bFunc = function () { return this; }
var b = { name: "b", fun: bFunc };

b.fun()

console.log(b.fun()); gives:

Object {name: "b", fun: function}

MIT License

Any plans to include an MIT License with the source so any code snippets can be reused in production code?

the function comparator is flaw and must not be used with array.sort

to the function sort: -1 means LT, 1 means GT and 0 means EQ. To the comparator function: -1 means the first test to pass, 1 means the opposite of first test, and 0 means both tests failure. Comparator drifts away from what really matters ordinal position.
if the first test has predicate lessThan and x is less than y, ok
but if the first test has the pedicate greaterThan and x is greater than y, comparator returns -1 meaning GT, and sorts only accepts -1 to mean LT.

Besides comparator only accepts 2 parameters predicates, isPrime, isOdd, isEven are one parameter predicates. Don't say they can be passed to comparator, they do not fit comparator contract.

Fork with coffeescript variants

FWIW, my fork contains CoffeeScript variants of the first three chapters. I'd welcome contributions from the later chapters if anyone else is working through through the text in this manner (i.e., converting to idiomatic CS).

example on chapter 2

that second example ( I think ) on chapter 2

var bFun = function(){ return this}
var b = {name : 'b' , fun : bFun }

b.fun(); // returns b not the global window object .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.