funjs / book-source

The example source code for the book Functional JavaScript by Michael Fogus, published by O'Reilly
Other
349 stars 101 forks source link

Fork with coffeescript variants #7

Closed joyrexus closed 10 years ago

joyrexus commented 10 years ago

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).

fogus commented 10 years ago

This is fun! I would love to contribute also, but I sadly can't find the cycles. I would however be interested in hosting this when it's complete in the funjs account if you're interested.

joyrexus commented 10 years ago

@fogus cool, I'll let you know when we're done working through it. Thanks for the tweet.

joyrexus commented 10 years ago

Update: we're now through Chapter 4.

DinisCruz commented 9 years ago

Hi @joyrexus can you add issues to https://github.com/joyrexus/func-js-book that would make it easier to contribute to your changes :)

joyrexus commented 9 years ago

@DinisCruz Sure, done.

DinisCruz commented 9 years ago

Btw I've started to add a couple of these methods to fluentnode (see https://github.com/o2platform/fluentnode/issues/29) including unit tests to confirm its behaviour:

require('../src/globals')

describe 'global',->

  it 'existy',->
    existy(null      ).assert_False()
    existy(undefined ).assert_False()
    existy({}.notHere).assert_False()
    existy((()->)()  ).assert_False() # same as existy((function(){})())
    existy(@         ).assert_True()
    existy(0         ).assert_True()
    existy(true      ).assert_True()
    existy(false     ).assert_True()

  it 'truthly',->
    truthly(null     ).assert_False()
    truthly(false    ).assert_False()
    truthly(undefined).assert_False()
    truthly(0        ).assert_True()
    truthly(1        ).assert_True()
    truthly(''       ).assert_True()
    truthly(' '      ).assert_True()
    truthly(true     ).assert_True()