Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LiveScript

Name: Anonymous 2013-11-11 22:20

Did you ever tried this thing?

FizzBuzzBazz in 62 characters:

[++x>?[k+\zz for k,v of{Fi:3,Bu:5,Ba:7}|x%v<1]*'' for x to 99]


Currying:

times = (x, y) --> x * y
times 2, 3 #=> 6 (normal use works as expected)
double = times 2
double 5 #=> 10


Composing Functions:

even = (x) -> x % 2 == 0
invert = (x) -> not x
odd = invert << even


Comprehensions:

r = [x + y for x in [1, 2] for y in ['a', 'b']]
r #=> ['1a', '1b', '2a', '2b']


It compiles to JavaScript, so basically is a CoffeeScript well done.
http://livescript.net/

Name: Anonymous 2016-07-20 1:37

If you want a functional language that compiles to Javascript, check out [PureScript](http://www.purescript.org/). It has almost 1000 more stars on Github than does Livescript, so it's probably a better choice.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List