Shared publicly  - 
 
yay for my super js power.

else if (fixedCharCodeAt(srchText,0) > 127 ) { for (ii = 0; ii < srchText.length ; ii++) { if ( srchText.slice(ii, ii+1) === " " ) { } else { foundCodepoints.push(fixedCharCodeAt(srchText,ii));} } }

notice the formatting. lol. js kinda forced it that way, and actually is the way i prefer too, as similar with Mathematica code. ALL ONE SINGLE LINE!

#javascript  
1
Xah Lee's profile photoNick Alcock's profile photo
15 comments
 
I see that and raise you this, which there is no way G+ will leave unmolested:

find / \( -fstype nfs -o -fstype proc -o -path "/mirror" -o -path "/var/spool" -o -path "/mnt" -o -path "/vm" -o -path "/media" -o -path "/trees/transient" -o -path "/home" -o -path "/usr/src" -o -path "/usr/distros" \) -prune -o -perm /a+x -type f -print | grep -v "'" | xargs file | grep -E "dynamically linked|shared object" | cut -d: -f1 | xargs readelf -s | grep -E "^File: |UND gcry_ac|UND gcry_(pk|cipher|md)register|UND gcry(pk|cipher|md)unregister|UND gcry(pk|cipher|md)_list" | awk ' BEGIN { header=0; oldline=""; } /^File: / { header=1; oldline=$0; } { if (match ($0,/File: /) == 0) { if (header == 1) { header=0; print oldline; } print $0; } }' | sed -r 's/[ \t]+/ /'g
 
One-liners: great for quick hacks. I'd rather not use them for anything else though. :)
Xah Lee
 
+Nick Alcock isn't that from emacs lisp?

btw, one-liner is great, in Mathematica. It's not great elsewhere because those lang syntax doesn't do well. It is great in lisp too, but unfortunately, lispers don't understand it, and thus there's no facility to compact/expand lisp code automatically, although it can be easily done.
Xah Lee
 
+Nick Alcock this is another decade long rant of mine.

normal, average programers don't understand this, because they've never seen Mathematica, or APL.

perl claims to be one-liners, but perl syntax actually doesn't do well. ALL Mathematica code (or APL) is one huge single line, and it is practical. 
 
The problem is more that on one line everything has a tendency to become bloody unreadable :) no room for comments, no room for spacing, the line is too long for the human eye and it's generally gaaah, for anything but throwaways that is.

(As for compact/expand... the expansion is easy, macroexpand, and you'd think you could contract it by just remembering the pre-expanded content -- but the problem is what do you do if the user does something to the text between expansion and contraction?)
 
btw, you are to be congratulated for some truly epically unreadable one-liners in that one-liner screw post. They're all as bad as each other, though I think you should have thrown some APL in to really make people's eyes bleed!
Xah Lee
 
+Nick Alcock i agree with you that one-liner functional style in general is harder to read. However, not the way most programer think!

and, there you mentioned line wrap again. STOP saying that! there's automatic line wrapping at margin or window edge.

also, when doing one-liner functional style, comment begin each big line. And, the comment basically entail input output, and that's it. Functional. As opposed to pages of blocks with lots temp vars here and here and comments telling us how each snippet is doing what to achieve what.

also, most lang syntax are idiotic except M, because, you see here, that we need nested comment in order to do one-liner functional style. So, if needed, comment can be inside the line. In M, it's (* like this *). Most langs don't have nested comment syntax, and here including lisp.

as i mentioned, i've been arguing with the common programers for a decade on this. People will never understand, because, they've never coded Mathematica, or APL, or similar. (and, the CRIME, is that some of these hacker types, will aggressive insist you are wrong, troll, etc. That is how i have come to despise them fuckers)
Xah Lee
 
+Nick Alcock you said "(As for compact/expand... the expansion ...".
I've heard that before Right, macros again. Macros, macros. Until you actually implemented it, i won't believe it can be done or has anything to do with lisp macros or readers.
 
+Xah Lee, automatic line wrapping isn't the point. The point is that a whole block of code is dumped into a single chunk of text, a single visual paragraph. Nesting, indentation, etc, are entirely impossible, and I'm sure you know how hard entirely unindented code is to read. As for Mathematica's nested comments without which everything is unreadable, well, I can't see any in your example (which is unreadable). You can do nested comments in lots of languages, but that doesn't mean that packing everything onto one line is remotely a good idea! (I'm starting to wonder if you've ever maintained any code written by anyone else... it seems not, or you wouldn't be claiming as wonderful a whole bunch of things that everyone thinks is great until they have to maintain code written by someone else with the same habits.)

As for the compact/expand thing, I thought you meant that expansion would expand all macros, and compact would compactify them again: saying 'oh, lisp macros suck' is a bizarre response in that case. If that wasn't what you meant, what on earth did you mean? What are you 'expanding'?

(And it would be hard for me to implement something that I just suggested would be impossible to implement until I'd figured out the solution to a rather tricky problem.)
Xah Lee
+
1
2
1
 
+Nick Alcock your first paragraph, on how one giant line of code is hard to read. I agree. But again, maybe not as much as other average industry coder would think how difficult it is. I tend to think, if this huge one line is written in good functional style, in a Lang with syntax that fits the style, it's not so hard to read. I think APL is a excellent example. Also, partly i think it has a lot to do with habit. Am getting off topic, but in recently years i realized lots of hard/difficult perceptions is strongly influenced by habit. e.g. chinese vs english grammar/morphology. Another example, if most programers grew up with functional programing, then they probably would find C etc procedural stype hard, not the other way as current industrial coder's thought.
Xah Lee
+
1
2
1
 
+Nick Alcock your second paragraph, about using lisp macros. Yes, sorry, i was tired and ranty yesterday and jumped the gun. I actually wasn't sure what you mean. But yes, i mean compact/expand text as in emacs auto-fill.
Xah Lee
 
PS if you want to see huge incomprehensible one-line block of Mathematica, look at Michael Trott's 3 volumes book http://www.mathematicaguidebooks.org/ 
Trott's is perhaps the top 100 expert of M. Nah, maybe top 10.
The book has tons of code, and most or all of his code is in that style.
To most people, even those who coded M for years, it's incomprehensible.
And this incomprehensibility most lies in the fact his code is all functional application chaining constructed on the spot, in one line, forming pages of it.
 
Ah. i.e. something like automatically wrapping a region in a block and then indenting it? I suspect expand-region has something that might vaguely help here...
Add a comment...