HN user

voidiac

57 karma
Posts0
Comments26
View on HN
No posts found.

Python's implementation of sum doesn't care about types, the function looks something like:

    def sum(iterable):
        r = 0
        for v in iterable:
            r += v
        return v

it always starts with an integer, and since int.__add__(str) returns NotImplemented it tries str.__radd__(int) instead, which raises an AttributeError because str has no method __radd__, so no summing of strings and integers.

Ireland and Great Britain are islands. On these two islands are two sovereign states: Ireland and the United Kingdom of Great Britain and Northern Ireland (also known as UK). The UK consists of four parts: England, Wales and Scotland on the island of Great Britain and Northern Ireland on the island of Ireland.

.ie is the domain of the state Ireland. .uk is the domain of the UK.

Register based VMs are not more complex than stack based VMs. You can even have a stack and the only difference is that your instructions operate on registers and not directly on the stack. I only consider generating code more complex with a register based VM.

If you are interested here is a toy vm I wrote myself: https://github.com/byo3rn/ire

PS: I suck at documentation.