digitalmars.D.learn - Why map return [] ?
- Suliman (7/7) Apr 14 2017 auto x = MySQLTablesRange.map!(a=>a);
- cym13 (2/9) Apr 14 2017 What library is that supposed to be?
- Suliman (2/15) Apr 14 2017 http://code.dlang.org/packages/mysql-native
- Suliman (3/19) Apr 14 2017 I found problem! ResultRange should be converted to array before
- Rene Zwanenburg (2/4) Apr 14 2017 That shouldn't be necessary. Can you post your complete code?
- Suliman (9/13) Apr 14 2017 ResultRange MySQLTablesRange = mysqlconnection.query(`SELECT
auto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return data line by line. Why?
Apr 14 2017
On Friday, 14 April 2017 at 15:29:33 UTC, Suliman wrote:auto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return data line by line. Why?What library is that supposed to be?
Apr 14 2017
On Friday, 14 April 2017 at 15:35:15 UTC, cym13 wrote:On Friday, 14 April 2017 at 15:29:33 UTC, Suliman wrote:http://code.dlang.org/packages/mysql-nativeauto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return data line by line. Why?What library is that supposed to be?
Apr 14 2017
On Friday, 14 April 2017 at 15:38:19 UTC, Suliman wrote:On Friday, 14 April 2017 at 15:35:15 UTC, cym13 wrote:I found problem! ResultRange should be converted to array before it can be `map`edOn Friday, 14 April 2017 at 15:29:33 UTC, Suliman wrote:http://code.dlang.org/packages/mysql-nativeauto x = MySQLTablesRange.map!(a=>a); writeln(x); return: [] while next code: MySQLTablesRange.each!(a=>a.writeln); return data line by line. Why?What library is that supposed to be?
Apr 14 2017
On Friday, 14 April 2017 at 15:49:00 UTC, Suliman wrote:I found problem! ResultRange should be converted to array before it can be `map`edThat shouldn't be necessary. Can you post your complete code?
Apr 14 2017
On Friday, 14 April 2017 at 15:55:13 UTC, Rene Zwanenburg wrote:On Friday, 14 April 2017 at 15:49:00 UTC, Suliman wrote:ResultRange MySQLTablesRange = mysqlconnection.query(`SELECT table_name FROM information_schema.tables;`); auto x = MySQLTablesRange.map!(a=>a[0].coerce!string.split("_")[1]); writeln(x); output: [] while: MySQLTablesRange.array.map!... output resultI found problem! ResultRange should be converted to array before it can be `map`edThat shouldn't be necessary. Can you post your complete code?
Apr 14 2017