1. [std lib] question about read_lines() return value
- Posted by Jason Gade <jaygade at yah??.com> Apr 28, 2008
- 562 views
Jeremy, regarding your documentation for the read_lines() function, you have it returning {{"line_1"}, {"line_2"}, {"line_3"}}. Aren't the extra braces redundant? Shouldn't the function return {"line_1", "line_2", "line_3"}? Basically it seems to be returning one extra level of indirection. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.
2. Re: [std lib] question about read_lines() return value
- Posted by Jeremy Cowgar <jeremy at co?g?r.com> Apr 28, 2008
- 567 views
Jason Gade wrote: > > Jeremy, regarding your documentation for the read_lines() function, you have > it returning {{"line_1"}, {"line_2"}, {"line_3"}}. > > Aren't the extra braces redundant? Shouldn't the function return {"line_1", > "line_2", "line_3"}? Ops. That's a problem in the documentation. I looked at the unit tests and confirmed as well with a test program:
include file.e include misc.e sequence l l = read_lines("test.e") pretty_print(1, l, {2})
The output is: $ exu test.e { "include file.e", "include misc.e", "", "sequence l", "l = read_lines("test.e")", "pretty_print(1, l, {2})" } -- Jeremy Cowgar http://jeremy.cowgar.com