Closed Artoria2e5 closed 9 years ago
Well actually the original
ABLIBS='|base|'
ABLIBS+='foo|'
is a good idea, since it would be easier to read the regex.
When it comes to arrays, with an assumption that sane programmers do not put spaces into lib names, we can use grep -E "\<$i\>" <<< "${ablibs[@]}"
to do a whole-word matching.
Your IQ is not higher than me at all, and the original '|base|' design cost me several days to think.
And a latex-iron, rounder wheel like arrays is much smoother than your days-made rough wooden wheel.
IQ is not a vaild reason for writing cryptic and fucked-up code. Human create, use and reuse tools.
So this is closed. I was going to remove the 2 of you guys' comments, and I've just decided not to. Flame war is totally unnecessary, well at least to me. This is not a good year for us already due to that **\ NCEE, we DO NOT NEED MORE OF THIS.
To change a code, we can do either one of these:
Again, we are to discuss about coding style in AOSCC, I mean, you two may just calm down for a month or so... it is fine... To me, a not-so-good coder it was not such a big deal to just look at two distinct coding style, it just takes time and that's exactly why we should discuss such thing.
Sorry to bother you guys but... anyways.
This may help with array spliting since splited[0] would actually contain something.
So the lib loading would look like:
Sadly the regex may look awful:
Or shall we use an array directly instead?