Mercurial > octave-nkf
comparison libinterp/corefcn/data.cc @ 19435:9035a36736af
maint: Periodic merge of gui-release to default.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 15 Dec 2014 21:01:45 -0800 |
parents | c3611856cdd4 9887a930465f |
children | 03067dab10ca |
comparison
equal
deleted
inserted
replaced
19432:9e5b64b3c1fe | 19435:9035a36736af |
---|---|
1928 retval = args(0); | 1928 retval = args(0); |
1929 else if (n_args > 1) | 1929 else if (n_args > 1) |
1930 { | 1930 { |
1931 std::string result_type; | 1931 std::string result_type; |
1932 | 1932 |
1933 bool all_strings_p = true; | |
1933 bool all_sq_strings_p = true; | 1934 bool all_sq_strings_p = true; |
1934 bool all_dq_strings_p = true; | 1935 bool all_dq_strings_p = true; |
1935 bool all_real_p = true; | 1936 bool all_real_p = true; |
1936 bool all_cmplx_p = true; | 1937 bool all_cmplx_p = true; |
1937 bool any_sparse_p = false; | 1938 bool any_sparse_p = false; |
1949 first_elem_is_struct = args(i).is_map (); | 1950 first_elem_is_struct = args(i).is_map (); |
1950 } | 1951 } |
1951 else | 1952 else |
1952 result_type = get_concat_class (result_type, args(i).class_name ()); | 1953 result_type = get_concat_class (result_type, args(i).class_name ()); |
1953 | 1954 |
1955 if (all_strings_p && ! args(i).is_string ()) | |
1956 all_strings_p = false; | |
1954 if (all_sq_strings_p && ! args(i).is_sq_string ()) | 1957 if (all_sq_strings_p && ! args(i).is_sq_string ()) |
1955 all_sq_strings_p = false; | 1958 all_sq_strings_p = false; |
1956 if (all_dq_strings_p && ! args(i).is_dq_string ()) | 1959 if (all_dq_strings_p && ! args(i).is_dq_string ()) |
1957 all_dq_strings_p = false; | 1960 all_dq_strings_p = false; |
1958 if (all_real_p && ! args(i).is_real_type ()) | 1961 if (all_real_p && ! args(i).is_real_type ()) |
2007 } | 2010 } |
2008 else if (result_type == "char") | 2011 else if (result_type == "char") |
2009 { | 2012 { |
2010 char type = all_dq_strings_p ? '"' : '\''; | 2013 char type = all_dq_strings_p ? '"' : '\''; |
2011 | 2014 |
2012 maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p); | 2015 if (! all_strings_p) |
2013 | 2016 gripe_implicit_conversion ("Octave:num-to-str", |
2014 charNDArray result = do_single_type_concat<charNDArray> (args, dim); | 2017 "numeric", result_type); |
2018 else | |
2019 maybe_warn_string_concat (all_dq_strings_p, all_sq_strings_p); | |
2020 | |
2021 charNDArray result = do_single_type_concat<charNDArray> (args, dim); | |
2015 | 2022 |
2016 retval = octave_value (result, type); | 2023 retval = octave_value (result, type); |
2017 } | 2024 } |
2018 else if (result_type == "logical") | 2025 else if (result_type == "logical") |
2019 { | 2026 { |