180 karma · joined Jul 8, 2020 (6y ago) · 46 submissions
comment 4d ago · link · parent
Source: https://archive.org/details/VIC-20ProgrammersReferenceGuide1...
comment 2mo ago · link · parent
All of this is completely correct, but it has nothing to do with bash vs. Clojure. The same decoupling can easily be achieved in either language.
comment 2mo ago · link · parent
One of the core features of the Unix command-line is that it is user-extensible. If there's no "native" command equivalent to frequencies, you can write your own, and it will be given the same first-class treatment as any other binary in your PATH. This is entirely in keeping with the Unix philosophy of simple implementations.
comment 11mo ago · link · parent
https://jacobfilipp.com/DrDobbs/articles/CUJ/2000/cexp1812/a...
A similar macro later (2006) made its way into Boost as BOOST_SCOPE_EXIT:
https://www.boost.org/doc/libs/latest/libs/scope_exit/doc/ht...
I can't say for sure whether Go's creators took inspiration from these, but it wouldn't be surprising if they did.
comment 1y ago · link · parent
import std.meta: AliasSeq;
enum E { a, b, c }
void handle(E e)
{
// Need label to break out of 'static foreach'
Lswitch: final switch (e)
{
static foreach (ab; AliasSeq!(E.a, E.b))
{
case ab:
handleAB();
// No comptime switch in D
static if (ab == E.a)
handleA();
else static if (ab == E.b)
handleB();
else
static assert(false, "unreachable");
break Lswitch;
}
case E.c:
handleC();
break;
}
}comment 2y ago · link · parent
The only source I can find for the claim about police confusion is the one cited by Wikipedia [4], whose reliability I'm inclined to doubt based on the 1997/1977 discrepancy.
[1] https://www.npr.org/sections/thetwo-way/2014/03/17/290849704...
[2] https://www.wired.com/1997/09/paris-smog/
[3] https://www.npr.org/sections/pictureshow/2012/11/10/16479229...
[4] https://en.m.wikipedia.org/wiki/Odd%E2%80%93even_rationing#D...
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
This seems like an uncharitable interpretation to me. When he says "I'm not sure if anyone else has ever used this approach," it's pretty clear from context that the "approach" he's referring to is interleaving the sine and cosine tables to improve cache usage. And he doesn't even claim to be the first to come up with it, just to have independently discovered it.
comment 3y ago · link · parent
Of course, in the POSIX world, "library API" means "C API", so if you want to write nice-looking Python code like in the article, there is still some more work to do.
comment 4y ago · link · parent
https://archive.org/details/recursive-functions-symbolic-exp...
comment 4y ago · link · parent
Now, it may be true that you get better reviews selling software that corrupts data or gets its users hacked than selling software that crashes. But unless you hate your users, those are probably things you want to avoid.