4 ms·
CoffeeScript is just JavaScript, so to the extent that you can compose and curry functions in JavaScript, the same is possible here. Either directly, or through
by jashkenas 17y ago
CoffeeScript is just JavaScript, so to the extent that you can compose and curry functions in JavaScript, the same is possible here. Either directly, or through libraries like Oliver Steele's Functional.js, or Underscore:
http://documentcloud.github.com/underscore/#compose http://documentcloud.github.com/underscore/#compose
As for adding linked lists, we have something of a golden rule with CoffeeScript -- there are no special objects or functions added to the runtime (with a couple miniscule exceptions). We're not building a standard library, because that would open Pandora's box, and there would be no end to the project's scope. Instead the idea is just to show a certain side of JavaScript in a different light, and to work seamlessly with whatever libraries (server-side or client-side) you choose to use.
- andrewcooke 17y agook, i understand. not quite what i'm looking for, then, but thanks...
- jrockway 17y agoHaskell can be compiled to Javascript. Perhaps that's what you're looking for? http://www.haskell.org/haskellwiki/Yhc/Javascript http://www.haskell.org/haskellwiki/Yhc/Javascript Haskell has dynamic typing via the Data.Dynamic module, but I don't find it to be useful. I can't think of any reason why anyone would want dynamic typing, anyway. Eventually you need to know the type of your data, why not figure that out before you start the program running? (But if you disagree, Haskell is not going to stop you.)
- andrewcooke 17y agoNo, it's not what I want thanks. It's not eager and it's not simple and it's pretty fiercely pure. What I am thinking of is something more like a functional Python, or a Scheme with a "nice" syntax.
- jrockway 17y agoUse Scheme for more than five minutes and I think you'll find you don't care about the syntax anymore. Plus you won't have to write your own language, which is always nice. Strict evaluation is a pain, though, IMHO.
- andrewcooke 17y agoThanks, but I have used Scheme for more than 5 minutes. [edit: more generally, what is the point of this conversation? You've stated that you don't understand how anyone could want dynamic types, and that strict evaluation is a pain. It's pretty obvious that you want completely different things to me. Given that, are you really trying to help me here, or just being a bit of an asshole? You're welcome to disagree, but simply repeating your opinions as if they are somehow more valid than mine isn't helping anyone.]
- jrockway 17y agoWell, at least my comments aren't one sentence saying how the other person is wrong with the overtone of "no, that's not good enough, I am a unique flower and eveyrone else is wrong". Er, this one is, but...
- anthonyb 17y agoHe's not being an asshole, he's just trying to help. Perhaps if you were a bit more forthcoming about what you do want (or why you don't want X), his comments might be a bit more on target.