def f(x):
print x
if __name__ == '__main__':
f('Functions are annoying, by the same token?')
for a_better_example in illustration_of_my_point:
def you_now_see_why_they_are_there():
print 'At this point, you lack sufficient context to'
print 'understand why this function is necessary.'
after(you_read_the_above_lines, you_now_see_why_they_are_there)
# ie. by requiring the programmer to declare a named function before
# passing a closure containing statements, you force the order of
# declaration to be the reverse of the order of operation.
after(supporting_codeblocks,
[ you |
you.dont_have_to_read_things_backwards_anymore()
])
# Also, consider an asynchronous chain of events:
def async_chain():
def do_step_3():
print 'Step 3.'
def do_step_2():
print 'Step 2'.
after_idle(do_step_3)
def do_step_1():
print 'Step 1'.
after_idle(do_step_2)
# Do everything I said, but in the opposite order:
after_idle(do_step_1)
if only(we_could_find_a_nice_syntax_for_codeblocks):
print 'We could again forward talking start.'
# all in good fun,
ramen()