>>7
You need to have a ':' on the first row, or it won't parse properly.
Also, you need to have a ':' on the second row, or it won't parse properly.
Third row looks fine though, good job!
if you in (depressed, sadness, resignation):
print 'me, my sweetheart'
if feel(you) is 'lonely' or feel(you) is 'neglected':
talk_me(this)
while always:
I.take_care(you)
if you.love() is not me:
# I will follow in the madness
# I will
break # down...
for emotion in my.heart:
try:
your.lover = me
except:
your.best_friend = me
if you.hate(me):
love(me)
elif I.annoying():
love(me)
else:
love(me, how='deeply', when='now')
Name:
Anonymous2006-12-07 18:16
>>7
What is this faggotry? slapPosters :: [Poster] -> IO ()
slapPosters ps = (mapM_ (slap) (filter ((== 5) . posterNumber) ps))
Text on the line after a code block.
>>14
That's ok though; languages are only supposed to be used by those who actually know them.
Name:
Anonymous2006-12-08 7:16
>>17
Being able to understand it with general programming knowledge, but without specific knowledge of that language, tells something about the design quality and goals of a language.
>>18
I find it better to read the language's formal specification rather than second-guessing. I haven't been able to track down Python's design docs yet, but then again I haven't been trying very hard.
python is nice because I can write half of it in C anyway. It's like... the best of both worlds. All the shitty GUI stuff gets done in python in record time, and all the business logic done in C so it doesn't eat 5% of my CPU to add a few hundred numbers.
Name:
Anonymous2006-12-11 15:05
>>35
reduce(int.__add__, xrange(500)) takes about 0.000 seconds
Name:
Anonymous2006-12-11 16:11
>>36
Does it just get replaced by its result during preprocessing?
Result: adding 500 numbers that way takes 0.000139416266593 seconds (Athlon 64 3000+, Python 2.4.2 official build, Windows 2000)
Name:
Anonymous2006-12-11 18:48
Why even bother timing something as minute as adding 500 numbers? Do at least a billion floating point ops, then compare that across languages.
Name:
Anonymous2006-12-11 19:23
>>38 I don't think so
So you're saying Python is shit at optimising?
Name:
Anonymous2006-12-12 6:07
>>39
Cause >>35 said a few hundred numbers. Will compare fp ops when I have time.
>>40
Troll less. You know xrange returns an iterable object, and I'm applying reduce over a function (which could have been impure) and this object. It'd be pretty hard to optimize that, unless you write a recipe-based optimizer, i.e. not nearly as useful.
Name:
Anonymous2006-12-15 10:29
PYTHON IS ACTUALLY USELESS CUZ OF JAVA THAT DOES EVERYTHING BETTER AND THAT IS USED 4 THE SAME PURPOSE
Name:
Anonymous2006-12-15 12:24
>>42
Okay, so how would you do reduce(int.__add__, xrange(m)) in Java?