I typically use closures to do this in other languages, but the syntax is always so cumbersome. You get the "dog balls" that Douglas Crockford always called them:
``` const config = (() => { const raw_data = ...
...
return compiled;
})()'const result = config.whatever;
// carry on
return result; ```
Really wish block were expressions in more languages.
like
this {
const x = 5;
x + 5
}
// => 10
x
// => undefined
But I don’t see a way to get the result out of it. As soon as you try to use it in an expression, it will treat it as an object and fail to parse.(Not to be confused with do notation)
It's convenient I will say that. I've tried not to replicate this exactly and instead have adminer running on a server on the network but only listening to localhost connections. To get access to it you can then SSH tunnel the ports locally:
> # Route 8082 on your machine to localhost:8080 on the server: > ssh -N -L 8082:localhost:8080 db.devopsdomain.com
^(<(<(<(<(<(<<>>)*>)*>)*>)*>)*>)*$
If we had named captures: ^(((?<P><)|(?<-P>>))*(?(P)(?!)))$The function may reference the variable `card` but by the time the first one is triggered the for-loop had already decremented the variable to 0.
I think that I will stick with this: "You should stick with the simple stuff from now on. Capisce?"