Re: [Seed7-users] Templates issue
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2024-08-07 09:55:23
|
Hi Simon, Thank you very much for reporting this error. This gives me the opportunity to fix it. You triggered an error in the declaration processing for functions with parameters. The original parameter list was changed and the second declaration of myPrintArray used the same array type (array integer) as the first one. This triggered the error; Redeclaration of "myPrintArray (ref TEST_1: the_array)" I have fixed this error with the GitHub commit "Leave original_name_list (with parameters) unchanged when objects are declared". I plan a new Seed7 release (which includes this fix) next week. As soon as the release is out you can use the installer to download and compile it. How to use Seed7 from GitHub with the gcc from the installer is described here: https://thomasmertes.github.io/Seed7Home/build.htm#COMPILING_UNDER_WINDOWS_WITH_GCC_FROM_THE_INSTALLER With the fix the test program -------------------------------------------------- $ include "seed7_05.s7i"; const proc: DECLARE_MY_PRINT_ARRAY(in type: aType) is func begin const proc: myPrintArray(in array aType: the_array) is func local var aType: element is aType.value; begin writeln("starting..."); for element range the_array do writeln(element); end for; end func; end func; DECLARE_MY_PRINT_ARRAY(integer); DECLARE_MY_PRINT_ARRAY(string); const proc: main is func local var array integer: an_array is [] (10, 20, 30, 40); var array string: some_array is [] ("car", "truck", "boat", "plane"); begin myPrintArray(an_array); myPrintArray(some_array); end func; -------------------------------------------------- writes: SEED7 INTERPRETER Version 5.2.156 Copyright (c) 1990-2024 Thomas Mertes starting... 10 20 30 40 starting... car truck boat plane Best regards Thomas |