monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Python-style divmod() for integers #164

Closed MostAwesomeDude closed 7 years ago

MostAwesomeDude commented 7 years ago

It would be nice if, instead of writing this:

def x := index // 64
def y := index % 64

I could write this:

def [x, y] := index.divMod(64)

I am not against a new operator either:

def [x, y] := index //% 64
MostAwesomeDude commented 7 years ago

I think that we've got this licked, but I am always suspicious when code passes property testing on the first try.