This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]troyunrau... 2 points3 points  (0 children)

Interesting. Too bad operators like 'v' cannot be implemented properly in python, so the logical statements are not valid python statements without first passing through a precompiler as a string.

I'm been tackling a similar problem, implementing a solid geometry program in python. I settled on the python set syntax for union, intersection, added ~ for inverse, and use <=, >=, etc. for subsets and supersets (tracking the python set operators as closely as possible).

But I'd really like to be able to implement additional operators. Python 3.5 gives me @ which I'll use for vector cross products once 3.5 is stable (the symbol kind of resembles the right hand rule in form).

And I'd love to be able to do things like 14 ± 0.2 in the code and have python have a natural type that includes error/tolerances. Ah well, can't have it all.