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

Python sucks

Name: Anonymous 2011-05-19 22:57

``If you can do exactly what you want with Python 3.x, great! There's a few downsides, such as comparatively limited library support and the fact that current Linux distributions and Macs are still shipping with 2.x by default, but as a language Python 3.x is definitely ready." - Python Official Website

They really go out of their way to try and apologize for a shitty language.  3.x is awful and NO ONE will ever adopt it.  Python is going to die when 2.7 becomes too old to be useful since Python is just a novelty language that represent an idea that will actually be polished and efficient at some point down the road.

Name: Anonymous 2011-05-20 21:06

Lisp

react A                     B:(unseenBy A)                 ->
     ;A:[Damage=pos?]       B:[Owner=(enemyOf A)]          -> attack A B
     ;A:[Healer=y? MP=pos?] B:[Hits=pos? Owner=(allyOf A)] -> heal   A B



Python

def magic(dispatch, res):
     def inner(wrapped):
         dispatch.dispatch_map[res] = wrapped
         return dispatch
     return inner
 
def destruct(f):
     def dispatch(*args):
         key = f(*args)
         func = dispatch.dispatch_map[key]
         return func(*args)
     dispatch.dispatch_map = {}
     return dispatch
 
react = destruct(lambda x,y : (x["Unit"], y["Unit"]))
 
@magic(react, ("A","B"))
def react(x, y): return "Attack"
 
@magic(react, ("A","A"))
def react(x, y):  return "Heal"
 
@magic(react, ("B","B"))
def react(x, y):  return "Woot?"
 
A = {"Unit" : "A"}; B = {"Unit" : "B"}
 
print react(A, A)
print react(A, B)
print react(B, B)

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