>>1 The reason Lisp failed was that it was too successful at what it was designed for. >>2 The power of Lisp is its own worst enemy.
Stop spouting this bullshit. I hate all of you. IHBT.
Name:
Anonymous2011-07-04 2:02
can't fuck with my spout i'm a fucking teapooooooooooooooooooooooooooooooooooooooooooot
>>1 Since it [Visual Basic] could be used by those with little programming skill, it replaced COBOL for a while. Why pay for an expensive compiler, if a cheap interpreter that comes with your machine is all you need? Recently, Microsoft has moved to the .Net system, leaving VB behind. Its replacement, C#, is an ALGOL family member closely related to Java.
The dude is retarded. None of the three statements here bears any relation to truth.
>>2 Yeah, yeah, http://tvtropes.org/pmwiki/pmwiki.php/Main/CursedWithAwesome. Except in this case the awesomeness of the curse of those angsty teenagers is entirely imaginary -- no, if they managed to organize themselves, they would discover that they are not "bright but disorganized", just disorganized. Of course they suspect it and would never abandon such a useful excuse for being worthless piece of shit.
grammar = Dict(
S = [['NP','VP']],
NP = [['Art', 'N']],
VP = [['V', 'NP']],
Art = ['the', 'a'],
N = ['man', 'ball', 'woman', 'table'],
V = ['hit', 'took', 'saw', 'liked']
)
def generate(phrase):
"Generate a random sentence or phrase"
if isinstance(phrase, list):
return mappend(generate, phrase)
elif phrase in grammar:
return generate(choice(grammar[phrase]))
else: return [phrase]
def generate_tree(phrase):
"""Generate a random sentence or phrase,
with a complete parse tree."""
if isinstance(phrase, list):
return map(generate_tree, phrase)
elif phrase in grammar:
return [phrase] + generate_tree(choice(grammar[phrase]))
else: return [phrase]
def mappend(fn, list):
"Append the results of calling fn on each element of list."
return reduce(lambda x,y: x+y, map(fn, list))