Default args and function composition bruh
-
-
-
Replying to @chaosprime @danlistensto
Recently had this discussion re: locales (or TZ, …) as a process-wide thing in e.g. web servers. Passing through of all these things entirely impractical, as is creating closures/partials for a hundred functions. Hate thread/request locals.
1 reply 0 retweets 2 likes -
Best I got is something like computing these data from request and memoizing it with a MRU LUT; request as a parameter is usually in scope. Still vaguely suckish, but at least explicit yet up-front practical. Anything nicer?
1 reply 0 retweets 2 likes -
Replying to @ITBeHa @danlistensto
if request as a parameter is in scope, you're half a step away from passing around a context model that provides request, memoized localization what-have-you, etc
1 reply 0 retweets 4 likes -
Replying to @chaosprime @danlistensto
Yeah, that’s a nice model. I wish pedestal had better documentation.
1 reply 0 retweets 2 likes -
Aren’t you a static types practitioner tho? How do you work with plugging arbitrary context model data into statically defined values?
1 reply 0 retweets 2 likes -
Replying to @ITBeHa @danlistensto
not mainly, but when i am i'd make the context model data not arbitrary if i could (like, the set of things i'm going to want to know about localization is well-defined), make crappy generic abstractions if i couldn't
2 replies 0 retweets 2 likes -
Replying to @chaosprime @danlistensto
The problem I’ve had with well-definedness in the past is that things are well-defined at time t, and well-defined at time t', … & all these various well-defined-nesses are always present simultaneously later
1 reply 0 retweets 2 likes -
Got me to “static typing is great, for things you build in one consistent compilation run”; seems to be considered gauche these days.
1 reply 0 retweets 2 likes
and that's why i love me some crappy generic abstractions
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.