Skip to content

Comment on My newest invention: The Glas Language (A Pythonic offshot)parent

Comments

bhdzOP

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
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.