I'm sure there is a good reason for this, but I'm unclear as to what to search for in order to find an answer. The code I'm talking about is as follows:
[ [String1]++[String2] || String1<-"ABCDEFGHIJKLMNOPQRSTUVWXYZ", String2<-"ABCDEFGHIJKLMNOPQRSTUVWXYZ"].
which produces:
["AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK",
"AL","AM","AN","AO","AP","AQ","AR","AS","AT","AU","AV","AW",
"AX","AY","AZ","BA","BB",
[...]|...]
I'm sure it is just trying to save some horrendous output, but what if for some un-Godly reason I needed it all, how do I turn those [...]'s into more values?
Anyway, just thought this was interesting.
2 comments:
In case you haven't found your answer yet, the thing you wanted to search for was "pretty printing", and the specific function you're most likely interested in is rp/1:
rp(lists:seq(1, 1000000)).
will actually print all 1m elements to the shell. You can get the same effect with an io:format/2.
Ulf Wiger has a nice list of other pretty printing methods.
Yea, I stopped being lazy and dug into it. Thanks for the link though, that seems much nicer than writing some more "verbose" code.
Post a Comment