|
Post by barackobama on Oct 31, 2014 12:59:19 GMT -5
haskell does
and most other languages with a functionalish flavor have some kind of easy equivalent even if they don't have special syntax for it, like in ruby you can do
(0...100).collect { |x| x*x }
to generate a list of the first 100 perfect squares
|
|
chrlz
babby robby
Posts: 51
favorite thing about robby: hair
|
Post by chrlz on Oct 31, 2014 13:30:26 GMT -5
wow fancy
|
|
|
Post by barackobama on Nov 3, 2014 20:48:04 GMT -5
ruby is more concise than python but it's also a little weirder in some ways. its closure semantics are kinda fluffernuttered up / more complex than strictly necessary
|
|
fogrobarty
crock jacket
GETT TYHE fluffernutter OUT OF MY BUSINESS
Posts: 24
|
Post by fogrobarty on Nov 3, 2014 22:38:22 GMT -5
You guys don't know a single fuc king thing about computers
|
|
|
Post by barackobama on Nov 3, 2014 22:40:28 GMT -5
me rn
|
|
eldoxe
babby robby
IMPOSTER
alksdjfaksdjfkajsdfkljas
Posts: 50
|
Post by eldoxe on Nov 4, 2014 10:43:41 GMT -5
[x^2 | x <- [1..100]]
haskell list comps is lazily evaluated, pythong's ain't. python is shit
|
|
|
Post by barackobama on Nov 4, 2014 11:05:34 GMT -5
lazy lists are just a convenience; a function from naturals to whatever your list domain is will also always work
not to say that haskell isn't better than python because haskell is awesome
|
|
|
Post by barackobama on Nov 4, 2014 11:06:22 GMT -5
and if you really want the same space/time characteristics as a lazy list you can add some caching to that function
|
|
|
Post by robbyfogarty on Nov 4, 2014 11:08:14 GMT -5
im going to hax u
|
|
eldoxe
babby robby
IMPOSTER
alksdjfaksdjfkajsdfkljas
Posts: 50
|
Post by eldoxe on Nov 4, 2014 11:14:49 GMT -5
or generators
|
|
|
Post by robbyfogarty on Nov 4, 2014 12:05:07 GMT -5
im going to hax u 2
|
|