Re:Using Monads in C++ to Solve Constraints: 1. The List Monad
by bpicolo on Monday May 11, 2015 @11:41PM
(#9529478)
If you don't need other bases you can just string join them. : P
Re:Using Monads in C++ to Solve Constraints: 1. The List Monad
by TheLoneWolfling on Tuesday May 12, 2015 @09:41AM
(#9531647)
That's actually how I started, and `int` has a base parameter.
But it's still relatively verbose, due to Python's whole "join-only-takes-strings" thing:
def valueOf(*values, base=10):
return int("".join(map(str, values)), base=10)
Not to mention it's doing a whole lot of unnecessary work.
Re:Using Monads in C++ to Solve Constraints: 1. The List Monad
by TheLoneWolfling on Tuesday May 12, 2015 @12:45PM
(#9533011)
Whoops. Miscopied. the second `=10` shouldn't be there.
To put it simply, I don't see an improvement with that version.
And Python 3 has some improvements w.r.t. wildcard arguments.