Rejecting the gender binary: a vector-space operation
bookworm.benschmidt.org3 pointsby Rangi420 comments
#define MATCH_VARIANT(x) [](auto& x)
#define CASE_VARIANT(x, T) constexpr (std::is_same_v<std::decay_t<decltype(x)>, T>)
MATCH_VARIANT(arg) {
if CASE_VARIANT(arg, string) {
printf("string: %s\n", arg.c_str());
// ...
}
else if CASE_VARIANT(arg, int) {
printf("integer: %d\n", arg);
// ...
}
else if CASE_VARIANT(arg, bool) {
printf("bool: %d\n", arg);
// ...
}
}
(MATCH_VARIANT could be extended to allow capturing vairables, or just omit that macro, it saves less typing than CASE_VARIANT anyway.) def setrange(first, next, last):
return set(range(first, last+1, next-first))
fizz = setrange(3, 6, 100)
buzz = setrange(5, 10, 100)
fizzbuzz = fizz & buzz
fizz -= fizzbuzz
buzz -= fizzbuzz
num = setrange(1, 2, 100) - fizz - buzz - fizzbuzz
line_map = dict({n: "Fizz" for n in fizz}.items() +
{n: "Buzz" for n in buzz}.items() +
{n: "FizzBuzz" for n in fizzbuzz}.items() +
{n: n for n in num}.items())
for i in range(1, 100+1):
print(line_map[i])
Some SETL features Python lacks: 1 Lovelace = 1 Bitcoin
1 Goldwasser = 10 Bitcoin
1 Rackoff = 25 Bitcoin
1 Pedersen = 50 Bitcoin
1 Williamson = 100 Bitcoin
But yes, those are meaningless names in themselves. Metric prefixes like "hectobitcoin" would be better.
At 100% scaling, they look they way they're supposed to.[1] But at other scales, particularly non-integer ones, their drawing code will need updating to use the new fl_override_scale()/fl_restore_scale() API.[2] (Now that 1.4.0 is officially out, I expect to get back to maintaining those programs.)
[1]: https://i.imgur.com/A7CvKFe.png [2]: https://groups.google.com/g/fltkgeneral/c/gcqn9EeA7_A/