Changes between Initial Version and Version 1 of Ticket #3653


Ignore:
Timestamp:
2016-01-28T13:59:26Z (9 years ago)
Author:
Henning Kiel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3653

    • Property Summary Evaluation of listsEvaluation of lists (stringReal looses type?)
  • Ticket #3653 – Description

    initial v1  
    22{{{
    33package Main
     4
    45public function main
    56  input list<String> args;
     
    910  list<String> s_arr;
    1011algorithm
    11     r_arr := list(stringReal(s) for s in args);
    12     s_arr := list(String(r) for r in {1,2,3,4,5});
    13     out := listAppend(args,s_arr);
     12  r_arr := list(stringReal(s) for s in args);
     13  s_arr := list(String(r) for r in r_arr);
     14  out := listAppend(args,s_arr);
    1415end main;
    1516
     
    2122loadFile("Main.mo");
    2223getErrorString();
    23 Main.main({"2","3","4","5","6","7","8"});
     24Main.main({"1","2","3","4","5","6","7","8"});
     25getErrorString();
    2426}}}
    25 and get the following error (seems to try to open a file with the name of the first argument):
     27and get the following error:
    2628{{{
    2729true
    2830""
    29 File does not exist: 2
    30 # Error encountered! Exiting...
    31 # Please check the error message and the flags.
    3231
    33 fail()
     32"Error: Error building simulator. Build log: clang -I"/Users/henning/src/OpenModelica/build/include/omc/c"  -g  -O0 -march=native   -c -o Main_main.o Main_main.c
     33/Users/henning/src/OpenModelica/mmc/Main.mo:11:16: warning: implicit declaration of function 'modelica_metatype_to_modelica_string' is invalid in C99 [-Wimplicit-function-declaration]
     34        tmp4 = modelica_metatype_to_modelica_string(_r, ((modelica_integer) 0), 1);
     35               ^
     36/Users/henning/src/OpenModelica/mmc/Main.mo:11:14: warning: incompatible integer to pointer conversion assigning to 'modelica_string' (aka 'void *') from 'int' [-Wint-conversion]
     37        tmp4 = modelica_metatype_to_modelica_string(_r, ((modelica_integer) 0), 1);
     38             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     392 warnings generated.
     40clang -I"/Users/henning/src/OpenModelica/build/include/omc/c"  -g  -O0 -march=native   -c -o Main_main_records.o Main_main_records.c
     41clang -single_module -dynamiclib -flat_namespace -o Main_main.dylib Main_main.o Main_main_records.o  -I"/Users/henning/src/OpenModelica/build/include/omc/c"  -g  -O0 -march=native   -L"/Users/henning/src/OpenModelica/build/lib/x86_64-darwin15.3.0/omc" -Wl,-rpath,'/Users/henning/src/OpenModelica/build/lib/x86_64-darwin15.3.0/omc'    -lOpenModelicaRuntimeC -llapack -lblas -lm -lm
     42Undefined symbols for architecture x86_64:
     43  "_modelica_metatype_to_modelica_string", referenced from:
     44      _omc_Main_main in Main_main.o
     45ld: symbol(s) not found for architecture x86_64
     46clang: error: linker command failed with exit code 1 (use -v to see invocation)
     47make: *** [Main_main] Error 1
     48"
    3449}}}
    3550
    36 
    37 
    38 Another thing is that I cannot use list() in the script:
    39 {{{
    40 Main.main(list("1","2","3","4","5","6","7","8"));
    41 }}}
    42 leads to
    43 {{{
    44 "[Main.mos:3:1-3:49:writable] Error: Class list not found in scope <global scope> (looking for a function or record).
    45 "
    46 }}}
     51So, list(stringReal(...)...) seems to loose information of element type (should be modelica_real, but is modelica_metatype).