3 ms·
Just like Python, Glas (Глас) doesn't really distinguish between dicts, objects or methods/functions. For it functions are just a fancier version of objects whi
by bhdz 13y ago
Just like Python, Glas (Глас) doesn't really distinguish between dicts, objects or methods/functions. For it functions are just a fancier version of objects which are a fancier version of normal dicts. Later on, during evaluation, Glas makes a distinction, not before though.
I am planning on adding additional features like adding statements after each method call with the ':' operator, like this:
# ship.attach_weapons(...):
ship's attach weapons: blasters, rockets, lasers:
print "Eeeekkrrrrgh! Weapons attached successfully!"
print "listing:"
for weapon in *: #all arguments of attach weapons
print "Weapon:", weapon
else:
print "WARNING! WARNING! Ship weaponry attachment FAILED"
print "You're defenseless!"
detach weapons:' ship:
print "Weaponry detached, seek cover!"
else:
print "Weaponry detachment FAILED!"
print " AUTODESTRUCT SEQ. INITIATED"
print " EJECT EJECT EJECT!"
auto destruct: 20s' ship