seed7-users Mailing List for Seed7 (Page 6)
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(9) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
|
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2011 |
Jan
(2) |
Feb
|
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(2) |
Aug
(6) |
Sep
(7) |
Oct
(3) |
Nov
(10) |
Dec
(4) |
2013 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2016 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(3) |
Dec
(3) |
2021 |
Jan
(2) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(12) |
Oct
(4) |
Nov
(17) |
Dec
(3) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(2) |
May
|
Jun
(17) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(12) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Thomas M. <tho...@gm...> - 2016-03-03 09:56:29
|
Hi Arnel, I was able to install MSYS2 and gcc 5.3 from mingw64. So I could test Seed7 with MSYS2 and gcc 5.3. In the latest release of Seed7 (2016-02-29) I fixed the error with the floating point compare function. The other floating point error (Sci operator for float with many digits does not work correct.) does not show up. Maybe it was fixed in a previous Seed7 release. Please update to the newest Seed7 release. With that no errors should show up. If the tests still fail please tell me. There is another issue with the MSYS2 console. Programs that want to read single key presses without echo (e.g. kbd.sd7) do not work. AFAIK this is a bug in the MSYS2 console (I found hints for that by googling). The programs that have problems in the MSYS2 console work without any problem in the windows console. Just start kbd.sd7 in both consoles to see the difference. In the windows console kbd.sd7 is terminated with ! and in the MSYS2 console it must be terminated with CTRL-C (since it just hangs). I found out that the function getch() (from conio.h) does cause the hang up in the MSYS2 console. So the MSYS2 console should be fixed or there should be special code in Seed7 to circumvent this error. Maybe you have an idea. Regards Thomas Mertes |
From: Arnel L. <jal...@gm...> - 2016-02-23 16:07:15
|
Hi Thomas, On Tue, 23 Feb 2016 12:20:57 +0100, "Thomas Mertes" <tho...@gm...> wrote: > To reproduce this problem I installed MSYS2 on a a 64-bit Windows 8.1 machine. > I was able to install gcc 4.9.2 but you used 5.3.0 > Please tell me the detailed commands to install gcc 5.3.0 After installing MSYS2, I ran the following commands: pacman -Syu # updates the package lists pacman -S mingw64/mingw-w64-x86_64-gcc If I search for 'gcc' by running 'pacman -Ss gcc', I usually get the mingw64 one near the top of the list, and I usually install that, but it does list near the bottom 'msys/gcc 4.9.2-6'. I'll try that and see if I get the same problem. > Did you use the "makefile" or some "mk_*" variant? > I proceeded with "makefile" (although it is intended for Linux) and gcc 4.9.2. > Then it failed because X11 is missing in my default MSYS2 installation. > Please tell me the detailed commands to install X11. > When I have gcc 5.3.0 and X11 on my machine I can proceed to search for the error. I followed your instructions of copying 'mk_msys.mak' as 'makefile' and proceeded from there. Ran 'make' then 'make test'. I did not get asked for X11 or anything else. > >From the logs you provided it seems that float comparisons with NaN (Not a Number) > do not work correctly. The program chkccomp.c checks the behaviour of NaN > (and other things) and writes the result to version.h > Your version file contains a definition for NAN_COMPARISON_OKAY. > Depending on the value of NAN_COMPARISON_OKAY the function fltCmp (in flt_rtl.c) > uses different code to compute the compare function. > Please send me your version.h file. It contains helpful information about your > compiler and your C runtime library. Here's the contents of the 'version.h' file: #define PATH_DELIMITER 92 /* backslash (ASCII) */ #define USE_DIRENT #define SEARCH_PATH_DELIMITER ';' #define CTRL_C_SENDS_EOF #define WITH_SQL #define CONSOLE_WCHAR #define OS_STRI_WCHAR #define os_chdir _wchdir #define os_getcwd _wgetcwd #define os_mkdir(path,mode) _wmkdir(path) #define os_rmdir _wrmdir #define os_opendir _wopendir #define os_readdir _wreaddir #define os_closedir _wclosedir #define os_DIR _WDIR #define os_dirent_struct struct _wdirent #define os_fstat _fstati64 #define os_lstat _wstati64 #define os_stat _wstati64 #define os_stat_struct struct _stati64 #define os_chown(name,uid,gid) #define os_chmod _wchmod #define os_utime _wutime #define os_utimbuf_struct struct _utimbuf #define os_remove _wremove #define os_rename _wrename #define os_system _wsystem #define os_pclose _pclose #define os_popen _wpopen #define os_fopen _wfopen #define os_fseek fseeko64 #define os_ftell ftello64 #define os_off_t off64_t #define os_environ _wenviron #define os_getenv _wgetenv #define os_putenv _wputenv #define os_getch _getwch #define QUOTE_WHOLE_SHELL_COMMAND #define USE_WINSOCK #define USE_BIG_RTL_LIBRARY #define OBJECT_FILE_EXTENSION ".o" #define LIBRARY_FILE_EXTENSION ".a" #define EXECUTABLE_FILE_EXTENSION ".exe" #define C_COMPILER "gcc" #define GET_CC_VERSION_INFO "gcc --version >" #define CC_OPT_DEBUG_INFO "-g" #define CC_OPT_NO_WARNINGS "-w" #define CC_FLAGS "-ffunction-sections -fdata-sections" #define REDIRECT_C_ERRORS "2>" #define LINKER_OPT_NO_DEBUG_INFO "-Wl,--strip-debug" #define LINKER_OPT_OUTPUT_FILE "-o " #define LINKER_FLAGS "-Wl,--gc-sections,--stack,8388608" #define SYSTEM_LIBS "-lm -lws2_32" #define SYSTEM_CONSOLE_LIBS "" #define SYSTEM_DRAW_LIBS "-lgdi32" #define C_COMPILER_VERSION "gcc (Rev2, Built by MSYS2 project) 5.3.0" #define UNISTD_H_PRESENT #define HAS_SIGNAL 1 #define HAS_SIGACTION 0 #define makeDir(path,mode) mkdir(path) #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) #define NORETURN __attribute__ ((noreturn)) #define MACRO_DEFS "#define likely(x) __builtin_expect((x),1)\n#define unlikely(x) __builtin_expect((x),0)\n#define NORETURN __attribute__ ((noreturn))\n" #define HAS_POPEN 1 #define POPEN_SUPPORTS_BINARY_MODE 1 #define POPEN_SUPPORTS_TEXT_MODE 1 #define FTELL_SUCCEEDS_FOR_PIPE 1 #define STDOUT_IS_IN_TEXT_MODE 1 #define FILENO_WORKS_FOR_NULL 1 #define FSEEK_SUCCEEDS_FOR_STDIN 1 #define FOPEN_OPENS_DIRECTORIES 0 #define FWRITE_WRONG_FOR_READ_ONLY_FILES 0 #define REMOVE_FAILS_FOR_EMPTY_DIRS 1 #define OS_PATH_HAS_DRIVE_LETTERS 1 #define HOME_DIR_ENV_VAR {'U', 'S', 'E', 'R', 'P', 'R', 'O', 'F', 'I', 'L', 'E', 0} #define USE_ALTERNATE_UTIME #define os_utime_orig _wutime #undef os_utime #define os_utime alternate_utime #define EXDEV_IS_DEFINED #define USE_EACCES_INSTEAD_OF_EXDEV #define RENAME_BEFORE_REMOVE #define SHORT_SIZE 16 #define INT_SIZE 32 #define LONG_SIZE 32 #define LONG_LONG_SIZE 64 #define POINTER_SIZE 64 #define FLOAT_SIZE 32 #define DOUBLE_SIZE 64 #define WCHAR_T_SIZE 16 #define OS_OFF_T_SIZE 64 #define TIME_T_SIZE 64 #define TIME_T_SIGNED 1 #define SIZE_T_SIGNED 0 #define BOOLTYPE _Bool #define BOOLTYPE_STRI "_Bool" #define INT8TYPE signed char #define INT8TYPE_STRI "signed char" #define UINT8TYPE unsigned char #define UINT8TYPE_STRI "unsigned char" #define INT16TYPE short int #define INT16TYPE_STRI "short int" #define UINT16TYPE unsigned short int #define UINT16TYPE_STRI "unsigned short int" #define INT32TYPE int #define INT32TYPE_STRI "int" #define UINT32TYPE unsigned int #define UINT32TYPE_STRI "unsigned int" #define INT32_SUFFIX(num) num #define UINT32_SUFFIX(num) num ## U #define INT32TYPE_LITERAL_SUFFIX "" #define INT32TYPE_FORMAT "" #define INT64TYPE long long #define INT64TYPE_STRI "long long" #define UINT64TYPE unsigned long long #define UINT64TYPE_STRI "unsigned long long" #define INT64_SUFFIX(num) num ## LL #define UINT64_SUFFIX(num) num ## ULL #define INT64TYPE_LITERAL_SUFFIX "LL" #define INT64TYPE_FORMAT "ll" #define INT128TYPE __int128 #define INT128TYPE_STRI "__int128" #define UINT128TYPE unsigned __int128 #define UINT128TYPE_STRI "unsigned __int128" #define RSHIFT_DOES_SIGN_EXTEND 1 #define TWOS_COMPLEMENT_INTTYPE 1 #define ONES_COMPLEMENT_INTTYPE 0 #define LITTLE_ENDIAN_INTTYPE 1 #define BIG_ENDIAN_INTTYPE 0 #define DO_SIGFPE_WITH_DIV_BY_ZERO #define CHECK_INT_DIV_BY_ZERO 0 #define CHECK_INT_REM_BY_ZERO 0 #define CHECK_INT_REM_ZERO_BY_ZERO 1 #define OVERFLOW_SIGNAL "" #define ROUND_HALF_AWAY_FROM_ZERO #define PRINTF_SUPPORTS_VARIABLE_FORMATS 1 #define DOUBLE_MIN_EXP10 -308 #define DOUBLE_MAX_EXP10 308 #define MIN_PRINTED_EXPONENT_DIGITS 3 #define MAX_PRINTED_EXPONENT_DIGITS 3 #define FLOAT_STR_FORMAT "%1.5e" #define FLOAT_STR_LARGE_NUMBER 1.0e6 #define DOUBLE_STR_FORMAT "%1.14e" #define DOUBLE_STR_LARGE_NUMBER 1.0e15 #define CAST_INT_TO_FLOAT_OKAY 1 #define HAS_LOG2 1 #define HAS_CBRT 1 #define CHECK_FLOAT_DIV_BY_ZERO 0 #define USE_NEGATIVE_ZERO_BITPATTERN 0 #define os_isnan isnan #define OS_ISNAN_DEFINITION "#define os_isnan isnan\n" #define HAS_EXP 1 #define HAS_EXP2 1 #define HAS_EXP10 0 #define FLOAT_ZERO_TIMES_INFINITE_OKAY 1 #define NAN_COMPARISON_OKAY 1 #define NAN_MULTIPLICATION_OKAY 1 #define NAN_DIVISION_OKAY 1 #define MAX_ODD_FLOAT 16777215.0 #define MAX_ODD_DOUBLE 9007199254740991.0 #define POW_OF_NAN_OKAY 1 #define POW_OF_ZERO_OKAY 1 #define POW_OF_ONE_OKAY 1 #define POW_EXP_NAN_OKAY 1 #define POW_EXP_MINUS_INFINITY_OKAY 1 #define POW_UNDERFLOW_WITH_SIGN 1 #define PRINTS_NEGATIVE_ZERO 1 #define os_isinf isinf #define FLOAT_TO_INT_OVERFLOW_SATURATES #define INT_RANGE_IN_FLOAT_MAX 16777216 #define FLOAT_MANTISSA_FACTOR 16777216.0 #define FLOAT_MANTISSA_SHIFT 24 #define INT_RANGE_IN_DOUBLE_MAX 9007199254740992 #define DOUBLE_MANTISSA_FACTOR 9007199254740992.0 #define DOUBLE_MANTISSA_SHIFT 53 #define PRINTF_FMT_F_MAXIMUM_FLOAT_PRECISION 512 #define STRTOD_ACCEPTS_HEX_NUMBERS 1 #define ATOF_ACCEPTS_HEX_NUMBERS 0 #define STRTOD_ACCEPTS_DENORMAL_NUMBERS 1 #define ATOF_ACCEPTS_DENORMAL_NUMBERS 1 #define MALLOC_ALIGNMENT 4 #define UNALIGNED_MEMORY_ACCESS_OKAY 1 #define CASTING_GETS_A_UNION_ELEMENT 1 #define TRIGRAPH_SEQUENCES_ARE_REPLACED 0 #define STACK_GROWS_DOWNWARD #define STACK_SIZE 0x1000000 #define USE_LOCALTIME_S #define LOCALTIME_WORKS_SIGNED 0 #define DECLARE_OS_ENVIRON 0 #define USE_GET_ENVIRONMENT 0 #define INITIALIZE_OS_ENVIRON 1 #define HAS_GETRLIMIT 0 #define HAS_WMEMCMP 1 #define HAS_WMEMCHR 1 #define HAS_WMEMSET 1 #define HAS_SETJMP 1 #define HAS_SIGSETJMP 0 #define HAS_SYMBOLIC_LINKS 0 #define HAS_READLINK 0 #define HAS_FIFO_FILES 0 #define HAS_POLL 0 #define MYSQL_INCLUDE "db_my.h" #define MYSQL_DLL "libmariadb.dll", "libmysql.dll", #define SQLITE_INCLUDE "db_lite.h" #define SQLITE_DLL "sqlite3.dll", #define POSTGRESQL_INCLUDE "db_post.h" #define POSTGRESQL_DLL "libpq.dll", #define WINDOWS_ODBC #define ODBC_INCLUDE_SQLEXT #define ODBC_INCLUDE "sql.h" #define OCI_INCLUDE "db_oci.h" #define OCI_DLL "oci.dll", #define INCLUDE_OPTIONS "" #define SYSTEM_DB_LIBS "-lodbc32" #define read_buffer_empty(fp) ((fp)->_cnt <= 0) #define SEED7_LIB "seed7_05.a" #define CONSOLE_LIB "s7_con.a" #define DRAW_LIB "s7_draw.a" #define COMP_DATA_LIB "s7_data.a" #define COMPILER_LIB "s7_comp.a" #define S7_LIB_DIR "/d/projs/s7/src/bin" #define SEED7_LIBRARY "/d/projs/s7/src/lib" > Regards > Thomas Mertes ---- Thanks, Arnel |
From: Thomas M. <tho...@gm...> - 2016-02-23 11:21:10
|
Hi Arnel, To reproduce this problem I installed MSYS2 on a a 64-bit Windows 8.1 machine. I was able to install gcc 4.9.2 but you used 5.3.0 Please tell me the detailed commands to install gcc 5.3.0 Did you use the "makefile" or some "mk_*" variant? I proceeded with "makefile" (although it is intended for Linux) and gcc 4.9.2. Then it failed because X11 is missing in my default MSYS2 installation. Please tell me the detailed commands to install X11. When I have gcc 5.3.0 and X11 on my machine I can proceed to search for the error. >From the logs you provided it seems that float comparisons with NaN (Not a Number) do not work correctly. The program chkccomp.c checks the behaviour of NaN (and other things) and writes the result to version.h Your version file contains a definition for NAN_COMPARISON_OKAY. Depending on the value of NAN_COMPARISON_OKAY the function fltCmp (in flt_rtl.c) uses different code to compute the compare function. Please send me your version.h file. It contains helpful information about your compiler and your C runtime library. Regards Thomas Mertes |
From: Arnel L. <jal...@gm...> - 2016-02-16 13:10:37
|
Hi, After running 'make test' on the recently available Seed7 source using GCC 5.3.0 using MSYS2 (https://msys2.github.io/) on a 64-bit Windows 8.1 machine, I'm getting the following failure for the 'chkflt' part: ../bin/s7.exe -l ../lib ../prg/chk_all build SEED7 INTERPRETER Version 5.0.7542 Copyright (c) 1990-2016 Thomas Mertes checking for presence of ../bin/s7c.exe - okay chkint ........... okay chkovf ........... okay chkflt *** The interpreted chkflt does not work okay: Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. *** The compiled chkflt does not work okay: Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. *** The interpreted compiler and the compiled compiler do not produce the same output. *** The program chkflt does not work okay, when it is compiled with the compiled compiler. Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. The error happened with the option *** The compiled chkflt does not work okay: Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. *** The interpreted compiler and the compiled compiler do not produce the same output. *** The program chkflt does not work okay, when it is compiled with the compiled compiler. Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. The error happened with the option -oc0 *** The compiled chkflt does not work okay: Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. *** The interpreted compiler and the compiled compiler do not produce the same output. *** The program chkflt does not work okay, when it is compiled with the compiled compiler. Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. The error happened with the option -oc1 *** The compiled chkflt does not work okay: Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. *** The interpreted compiler and the compiled compiler do not produce the same output. *** The program chkflt does not work okay, when it is compiled with the compiled compiler. Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. The error happened with the option -oc2 *** The compiled chkflt does not work okay: Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. *** The interpreted compiler and the compiled compiler do not produce the same output. *** The program chkflt does not work okay, when it is compiled with the compiled compiler. Comparison of float values works correct. ***** Compare for float values does not work correct. ***** Compare of float values does not work correct. ***** Sci operator for float with many digits does not work correct. ***** Decimal conversion of float does not work correct. Conversion from integer to float works correct. Truncation of float works correct. Addition works correct for selected values. Division works correct for selected values. A ** B works correct for selected values. A ** B with integer B works correct for selected values. Negative zero does work correct. Infinity works correct for selected values. NaN works correct for selected values. The error happened with the option -oc3 chkchr ........... okay chkstr ........... okay chkprc ........... okay chkbig ........... okay chkbool ........... okay chkset ........... okay chkhsh ........... okay chkexc ........... okay makefile:119: recipe for target 'test' failed I've trawled the mailing list on Sourceforge and the Seed7 FAQ for answers and/or workarounds, but I have not found any. Any advice or suggestions? ---- Thanks, Arnel --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus |
From: Thomas M. <tho...@gm...> - 2015-11-30 15:11:41
|
Hello Bob, Seed7 has specific makefiles for Mac OS X: mk_osx.mak for compiling with gcc and mk_osxcl.mak for compiling with clang. Are you using one of these Mac OS X makefiles? If not: Use one of them. You can either do A or B: A) Use the option -f every time you call make, to specify the source file. B: Copy the desired mk_osx*.mak to makefile and use the normal make commands. Do you have XQuartz (the X11 support of OS X) intalled? If not: Install XQuartz. I cannot remember the details of installing XQuartz. If there are several possibilites you need the development version (which contains *.h header files). The cause for "library not found for -lX11": The place of the X11 library may be different on your computer. Maybe the place of the library can be found somewhere in the documentation of XQuartz. The linker option -lX11 searches for files like libX11.a or libX11.dylib (maybelibX11.so) in directories like /lib /usr/lib /usr/local/lib, etc. On my Mac OS X machine (and on the computers of several others) the X11 library is found in /usr/X11R6/lib. You can search for the X11 library on your computer with: find / -name "libX11*" -print When you found the X11 library (e.g. libX11.a) in e.g. /strangeDir/lib you need to change the makefile (e.g. mk_osx.mak) the line LDFLAGS = -L/usr/X11R6/lib to LDFLAGS = -L/strangeDir/lib If that does not work you can also change SYSTEM_DRAW_LIBS = -lX11 to SYSTEM_DRAW_LIBS =/strangeDir/liblibX11.a Hope that helps. Ich you have more questions just ask. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. |
From: Thomas M. <tho...@gm...> - 2015-11-24 10:59:14
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hello Bob,</div> <div> </div> <div>Seed7 has specific makefiles for Mac OS X:</div> <div>mk_osx.mak for compiling with gcc and</div> <div>mk_osxcl.mak for compiling with clang.</div> <div> </div> <div>Are you using one of these Mac OS X makefiles?</div> <div> If not: Use one of them. You can either do A or B:</div> <div> A) Use the option -f every time you call make, to specify the source file.</div> <div> B: Copy the desired mk_osx*.mak to makefile and use the normal make</div> <div> commands.</div> <div> </div> <div>Do you have XQuartz (the X11 support of OS X) intalled?</div> <div> If not: Install XQuartz. I cannot remember the details of</div> <div> installing XQuartz. If there are several possibilites you need the</div> <div> development version (which contains *.h header files).</div> <div> </div> <div>The cause for "library not found for -lX11":</div> <div>The place of the X11 library may be different on your computer. Maybe the place</div> <div>of the library can be found somewhere in the documentation of XQuartz. The</div> <div>linker option -lX11 searches for files like libX11.a or libX11.dylib (maybelibX11.so)</div> <div>in directories like /lib /usr/lib /usr/local/lib, etc. On my Mac OS X machine (and</div> <div>on the computers of several others) the X11 library is found in /usr/X11R6/lib.</div> <div>You can search for the X11 library on your computer with:</div> <div> </div> <div> find / -name "libX11*" -print</div> <div> </div> <div>When you found the X11 library (e.g. libX11.a) in e.g. /strangeDir/lib you need to</div> <div>change the makefile (e.g. mk_osx.mak) the line</div> <div> </div> <div>LDFLAGS = -L/usr/X11R6/lib</div> <div> </div> <div>to</div> <div> </div> <div>LDFLAGS = -L/strangeDir/lib</div> <div> </div> <div>If that does not work you can also change</div> <div> </div> <div>SYSTEM_DRAW_LIBS = -lX11</div> <div> </div> <div>to</div> <div> </div> <div>SYSTEM_DRAW_LIBS =/strangeDir/liblibX11.a</div> <div> </div> <div>Hope that helps.</div> <div>Ich you have more questions just ask.</div> <div> </div> <div> <pre>Regards, Thomas Mertes -- Seed7 Homepage: <a href="http://seed7.sourceforge.net" rel="nofollow">http://seed7.sourceforge.net</a> Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. </pre> <div> </div> </div> </div></div></body></html> |
From: Bob F. <bob...@gm...> - 2015-11-14 00:46:58
|
Both clang and gcc make fail because of -LX11 not found, e.g., src$ make gcc -L/usr/X11R6/lib s7.o ../bin/s7_comp.a ../bin/s7_data.a ../bin/s7_draw.a ../bin/s7_con.a ../bin/seed7_05.a -lX11 -lncurses -lm -ldl -lsqlite3 -lpq -liodbc -o ../bin/s7 ld: library not found for -lX11 Bob |
From: Stéphane G. <ste...@wa...> - 2015-05-27 00:54:11
|
Hello, There is a small technical error in the manual; at line 245 of the text version, a bit of HTML code remains: ============= <font color="orange"> Programming should be fun ============= (It seems it was introduced 3 years ago, in version 20120603.) Goodbye, Stéphane. |
From: Thomas M. <tho...@gm...> - 2015-05-17 14:16:34
|
Hi Arkady, You must distinguish between X11 runtime support, and X11 development support. X11 runtime support is present on most computers, but may be missing on some servers. X11 development support (header files such as X11/X.h) is often not installed on todays computers. I think that Seed7 should not be compiled from source on every computer. Instead packages (or ports) should be used and installed on a computer. The BSD people support Seed7 with ports: OpenBSD port: http://openports.se/lang/seed7 FreeBSD port: http://www.freshports.org/lang/seed7 There is also an openSUSE package for Seed7: https://build.opensuse.org/package/show?package=seed7&project=home%3Azhonghuaren Unfortunately the openSUSE package is not updated so often. You mention Debian GNU/Linux 7.8. I made a Debian package for Seed7 in 2013, but without "sponsor" I was not able to get it into the repository. You can find still some discussions about that. E.g.: http://comments.gmane.org/gmane.linux.debian.devel.mentors/60182 I have attached my debian stuff from 2013. Maybe you can update it to a current version. With that you should be able to install a Seed7 package on the server. For the graphics I plan to have a similar solution as for the databases. Function pointers and dynamic loading should allow that programs run on computers without X11 installed. On a server a Seed7 program would get an exception, when it tries to open a window. I am experimenting with a GL graphics driver also. I have not yet decided how X11 and GL graphics mix. There is also the file drw_dos.c which works like a dummy graphics library. You can change the makefile to use drw_dos.c instead of drw_x11.c, but this is not a good solution. A Debian package for Seed7 would be the best solution. Greetings, Thomas Mertes |
From: Arkadiy K. <ark...@ya...> - 2015-05-07 20:33:23
|
Hello Seed7 Users, Today I have tried to compile seed7 interpreter on a shared hosting which doesn't have X11 libraries installed. The system is Debian GNU/Linux 7.8 and I see the following error: drw_x11.o drw_x11.c drw_x11.c:41:19: fatal error: X11/X.h: No such file or directory compilation terminated. make: *** [drw_x11.o] Error 1 I understand it might be a common practice to have no X11 packages on servers and looking for a solution. Perhaps the graphic libraries can be made optional in the make file? The end goal would be to have a simple web interface for running seed7 programs behind a web server similar to http://codepad.org/ My intention is to start with a simple scenario, i.e. submit the form data to a CGI script which will call s7 and return the standard output back. Please advice if you have any suggestions Thank you, Arkady K |
From: Arkadiy K. <ark...@ya...> - 2015-03-13 14:35:42
|
Hi Seed7 Users, Recently I performed a brief search on extensible syntax features found in other systems as compared to seed7 and found interesting projects which have something in common but none of it has the goal of "programming should be fun". Fortress programming language was a research project at Sun Microsystems and then Oracle. It has an extensible syntax that uses mathematical symbols. https://software.intel.com/en-us/articles/first-impressions-of-the-fortress-language There is a paper describing the implementation of syntactic extensions (Growing a syntax) http://www.cs.cmu.edu/~aldrich/FOOL09/allen.pdf Sergey Dmitriev of JetBrains proposes a new Language Oriented Programming paradigm to enable the computer think more like the programmer. http://www.onboard.jetbrains.com/articles/04/10/lop/ MPS is a JetBrains product which is build upon this paradigm and provides an IDE for building various domain-specific languages https://www.jetbrains.com/mps/ Personally I am impressed by the Fortress language macro system. Best regards, Arkadiy K |
From: Arkadiy K. <ark...@ya...> - 2015-03-11 07:00:39
|
Hi Thomas, Thank you for integrating my changes to support these unicode properties on characters. I have noticed that you improved the lookup tables in chr_rtl.c so that it uses 64-bit words for packing data and takes into account LE byte order used in the generator program. Please take a moment to look at the improved generator program at https://github.com/arkadio/unicode-tools This tool also supports generation of tests for these properties. It is controlled by command-line arguments as described in README. Using the generator tool, I have produced a file chkchr.sd7 which contains new set of tests. It is attached. There are still some inconsistencies for width() function results between the generated tests and actual interpreter results so I had to manually update several code points. Now these tests pass but let me double check the implementation. Thanks and regards, Arkady |
From: Arkadiy K. <ark...@ya...> - 2015-02-09 05:54:59
|
Hi Seed7 Users, Here is an implementation of the Union-Find data structure (aka connected components) for the Seed7 runtime library. The program percolation.sd7 demonstrates how Union-Find can be used to quickly build connected components in a simulation. The problem is defined in this manner: given a composite systems comprised of randomly distributed insulating and metallic materials: what fraction of the materials need to be metallic so that the composite system is an electrical conductor? Given a porous landscape with water on the surface (or oil below) under what conditions will the water be able to drain through to the bottom? and so on. Thomas, please feel free to include the files in Seed7 code base if you find it useful. The files are licensed as LGPL and GPL respectively. Best regards, Arkadiy K |
From: Arkadiy K. <ark...@ya...> - 2015-02-07 08:14:54
|
Hi Thomas, Please find attached a new patch for the unicode identifiers and properties support. Just as you suggested I added two new actions CHR_IS_LETTER and CHR_WIDTH The bitmaps to store these properties and corresponding functions are placed in file chr_rtl.c Most of the unicode data was generated from scratch using Java version of ICU library. The utf-8 mode is controlled by "-cu" option for both interpreter and compiler. Also I did some refactoring of the trace calls is error.c to pass-through all UTF-8 symbols if such mode is enabled. I am facing a difficulty compiling the new test cases in file "chkuni.sd7" The interpreter works ok with it when "-cu" is specified but the compiler cannot find processing functions for the new actions. It seems that I followed instructions on adding compiler support for the new actions but may be missing something. Please advice if you see a problem with my code. The changes were tested with Ubuntu 14 (x64), OS X 10.8 and Windows 8.1 (x64) Thanks and regards, Arkadiy K > Date: Tue, 6 Jan 2015 22:06:33 +0100 > From: "Thomas Mertes" <tho...@gm...> > Subject: Re: [Seed7-users] Using UTF-8 characters in identifiers > To: see...@li... > Message-ID: > <trinity-f8ccdd62-e473-44df-9bad-ea3968d25cda-1420578392888@3capp-gmx-bs46> > > Content-Type: text/plain; charset=UTF-8 > > On 2014-Dec-29, 23:24, "<ark...@ya...> wrote: >> Dear Seed7 Users, >> >> Attached is an experimental patch that I used to enable UTF-8 multibyte characters in program identifiers. > > Thank you very much for your patch. > I would like to add your improvements to the Seed7 release, > but there are several steps to reach that goal. >> I think it may be useful for educational purposes/schools as an example. > > Yes, of course. When I taught my children programming they used > german identifiers for variables and functions. Obviously people who > use other alphabets do not have this possibility. I see it as > important that for educational purposes everybody can use the mother > tongue. > > On the other hand I have found program code in the internet with > (for me) unreadable variable and function identifiers. When I decided > to restrict Seed7 to ASCII identifiers I wanted to force people to > write code that is readable by professional software developers > all over the world. > > The Seed7 interpreter could work in two identifier modes: > - Identifiers with ASCII letters (default mode). > - Identifiers with Unicode letters. > There could be a interpreter option or a declaration statement in the > program that does select the mode. The operation in ASCII identifier > mode should not be slowed down by the fact that an Unicode letter > mode exists. >> Please let me know if you also see other potential uses of this feature. >> >> Most changes are in the scanner.c file. The identifier symbols continue to be stored as multibyte C strings. >> I also added portable wcwidth.c and c_ident.c files from "libutf8" library with reference to the original author. > > Under which license the original author released the "libutf8" > library? The Seed7 runtime library uses the LGPL. To use code from > "libutf8" it must be allowed to relicense it with the LGPL. >> All makefiles were modified to include these new files. Btw, is it the correct way? > > Yes, but it might not be necessary to introduce new files. > Concerning the functions in wcwidth.c and c_ident.c I have some > questions. Does the function is_c_identifier_part() return TRUE for a > letter and FALSE otherwise? In this case it would probably make sense > to make is_c_identifier_part available for Seed7 programs. The same > applies to the function wcwidth(). A Seed7 program might be > interested to know if a character is non-spacing or double-width. > > I saw that both is_c_identifier_part() and wcwidth() work only > for UTF-16. Seed7 uses UTF-32 so this functions will probably > fail for characters byond U+ffff. When is_c_identifier_part() and > wcwidth() are useful for Seed7 programs also they should be added > to the interpreter. I suggest to add them to chr_rtl.c. For > is_c_identifier_part() I suggest the C function name chrIsLetter and > the action "CHR_IS_LETTER". For wcwidth() I suggest the C function > name chrWidth and the action "CHR_WIDTH". The functions need to > work for UTF-32 and should have charType parameters. You can take a > look at the functions toLower() and toUpper() in str_rtl.c. This > functions are used by functions in str_rtl.c and chr_rtl.c. > > I consider the addition of this functions as first step. > There are other open questions with Unicode identifiers. > Does is_c_identifier_part allow variables names with chinese > characters, hieroglyphs, cuneiform or other scripts? > > I had only a brief look at your changes in scanner.c and literal.c, > but they seem to go into the right direction. >> For me this was easiest portable solution to use wcwidth and to quickly check if a unicode character can be part of identifier. >> >> The patch also includes a feature to automatically use utf8 files STD_UTF8_IN and STD_UTF8_OUT for IN and OUT variables. > > I consider this as a different thing that should be in a different > patch. I was considering to use STD_CONSOLE and maybe KEYBOARD > for that purpose. >> It introduces new primitive action "UT8_MODE_ON" for that and a new function in ut8lib.c to check if current locale uses UTF-8. >> http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate was used as one of the guides. >> I checked the changes and ran tests under Ubuntu 14 and Windows 8. >> Windows locale detection and console code page selection are not yet implemented. >> >> However one change in utf8.s7i causes the compiler s7c to fail. >> The change is in lines 242 - 259 and is commented out. >> >> ../lib/utf8.s7i: In function ?o_3135_SEL_STD_FILE_FROM?: >> ../lib/utf8.s7i:248:45: error: expected expression before ?;? token >> isUTF8 := utf8_mode_on; >> >> Please advice what could be the reason. > > You did not add code for the action UT8_MODE_ON to the compiler. The > file seed7/lib/comp/ut8_act.s7i handles UT8 actions. There is also > the file seed7/lib/comp/action.s7i which contains code that calls > functions in ut8_act.s7i and in other files. If you start s7c with > the option -g-debug_c the intermediate *.c file is not removed and > the C compiler refers its error message to the line numbers in the > intermediate *.c file. > > Regards, > Thomas Mertes |
From: Arkadiy k. <ark...@ya...> - 2015-01-12 09:00:07
|
On: Tue, 6 Jan 2015 22:06:33 +0100 >Thank you very much for your patch. >I would like to add your improvements to the Seed7 release, >but there are several steps to reach that goal. Great, I will continue to improve my chnages. >> I think it may be useful for educational purposes/schools as an example. >Yes, of course. When I taught my children programming they used >german identifiers for variables and functions. Obviously people who >use other alphabets do not have this possibility. I see it as >important that for educational purposes everybody can use the mother >tongue. Indeed, I also found that many people including myself try to match their native language constructs when learning to program. Online education is just one possible use case of supporting extended character set. An example of course that might be interested in using seed7 for teaching algorithms is based on "stepic" platform: https://stepic.org/course/%D0%90%D0%BB%D0%B3%D0%BE%D1%80%D0%B8%D1%82%D0%BC%D1%8B-%D0%B8-%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D1%8B-%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85-63 Also these changes might be useful for defining custom syntax for natural language queries in searching data sets. Usually, this is implemented using regular expressions or custom implementations based on DFA. And another use case is linguistic tools which might need to have routines for manipulating UTF-8 data. >On the other hand I have found program code in the internet with >(for me) unreadable variable and function identifiers. When I decided >to restrict Seed7 to ASCII identifiers I wanted to force people to >write code that is readable by professional software developers >all over the world. Actually, yes ASCII is still the standard for source code. Sometimes I see python source code that uses utf-8 but you still need to specify encoding. >The Seed7 interpreter could work in two identifier modes: >- Identifiers with ASCII letters (default mode). >- Identifiers with Unicode letters. >There could be a interpreter option or a declaration statement in the >program that does select the mode. The operation in ASCII identifier >mode should not be slowed down by the fact that an Unicode letter >mode exists. What about the "--enc=utf-8" option? It might also have value "--enc=ascii" (default) or "--enc=locale" to use LC_CTYPE encoding > Under which license the original author released the "libutf8" > library? The Seed7 runtime library uses the LGPL. To use code from > "libutf8" it must be allowed to relicense it with the LGPL. The version I found is licensed under LGPL https://code.google.com/p/ports2plan9/source/browse/GNU/libutf8/include/libutf8.h > Concerning the functions in wcwidth.c and c_ident.c I have some > questions. Does the function is_c_identifier_part() return TRUE for a > letter and FALSE otherwise? In this case it would probably make sense > to make is_c_identifier_part available for Seed7 programs. The same > applies to the function wcwidth(). A Seed7 program might be > interested to know if a character is non-spacing or double-width. > I saw that both is_c_identifier_part() and wcwidth() work only > for UTF-16. Seed7 uses UTF-32 so this functions will probably > fail for characters byond U+ffff. ... The lookup tables for unicode properties can be generated on demand. I am working on recreating the script which will produce tables for "ALPHABETIC" property on the entire UTF-32 code set. The same can be done for wcwidth. Please find Java code attached >I consider the addition of this functions as first step. >There are other open questions with Unicode identifiers. >Does is_c_identifier_part allow variables names with chinese >characters, hieroglyphs, cuneiform or other scripts? That is a good question. I guess UTF-16 already includes most East-Asian symbols but code points larger than 0xFFFF include Unified Han ideographs and some rarely used hieroglyphs, like Ancient Egyptian. Let me find out >> The patch also includes a feature to automatically use utf8 files STD_UTF8_IN and STD_UTF8_OUT for IN and OUT variables. >I consider this as a different thing that should be in a different >patch. I was considering to use STD_CONSOLE and maybe KEYBOARD >for that purpose. I agree that should be a separate patch. Can KEYBOARD have a different implementation for UTF-8? >Regards, >Thomas Mertes Kind regards, Arkadiy Kuleshov |
From: Thomas M. <tho...@gm...> - 2015-01-06 21:06:41
|
On 2014-Dec-29, 23:24, "Кулешов Аркадий" <ark...@ya...> wrote: > Dear Seed7 Users, > > Attached is an experimental patch that I used to enable UTF-8 multibyte characters in program identifiers. Thank you very much for your patch. I would like to add your improvements to the Seed7 release, but there are several steps to reach that goal. > I think it may be useful for educational purposes/schools as an example. Yes, of course. When I taught my children programming they used german identifiers for variables and functions. Obviously people who use other alphabets do not have this possibility. I see it as important that for educational purposes everybody can use the mother tongue. On the other hand I have found program code in the internet with (for me) unreadable variable and function identifiers. When I decided to restrict Seed7 to ASCII identifiers I wanted to force people to write code that is readable by professional software developers all over the world. The Seed7 interpreter could work in two identifier modes: - Identifiers with ASCII letters (default mode). - Identifiers with Unicode letters. There could be a interpreter option or a declaration statement in the program that does select the mode. The operation in ASCII identifier mode should not be slowed down by the fact that an Unicode letter mode exists. > Please let me know if you also see other potential uses of this feature. > > Most changes are in the scanner.c file. The identifier symbols continue to be stored as multibyte C strings. > I also added portable wcwidth.c and c_ident.c files from "libutf8" library with reference to the original author. Under which license the original author released the "libutf8" library? The Seed7 runtime library uses the LGPL. To use code from "libutf8" it must be allowed to relicense it with the LGPL. > All makefiles were modified to include these new files. Btw, is it the correct way? Yes, but it might not be necessary to introduce new files. Concerning the functions in wcwidth.c and c_ident.c I have some questions. Does the function is_c_identifier_part() return TRUE for a letter and FALSE otherwise? In this case it would probably make sense to make is_c_identifier_part available for Seed7 programs. The same applies to the function wcwidth(). A Seed7 program might be interested to know if a character is non-spacing or double-width. I saw that both is_c_identifier_part() and wcwidth() work only for UTF-16. Seed7 uses UTF-32 so this functions will probably fail for characters byond U+ffff. When is_c_identifier_part() and wcwidth() are useful for Seed7 programs also they should be added to the interpreter. I suggest to add them to chr_rtl.c. For is_c_identifier_part() I suggest the C function name chrIsLetter and the action "CHR_IS_LETTER". For wcwidth() I suggest the C function name chrWidth and the action "CHR_WIDTH". The functions need to work for UTF-32 and should have charType parameters. You can take a look at the functions toLower() and toUpper() in str_rtl.c. This functions are used by functions in str_rtl.c and chr_rtl.c. I consider the addition of this functions as first step. There are other open questions with Unicode identifiers. Does is_c_identifier_part allow variables names with chinese characters, hieroglyphs, cuneiform or other scripts? I had only a brief look at your changes in scanner.c and literal.c, but they seem to go into the right direction. > For me this was easiest portable solution to use wcwidth and to quickly check if a unicode character can be part of identifier. > > The patch also includes a feature to automatically use utf8 files STD_UTF8_IN and STD_UTF8_OUT for IN and OUT variables. I consider this as a different thing that should be in a different patch. I was considering to use STD_CONSOLE and maybe KEYBOARD for that purpose. > It introduces new primitive action "UT8_MODE_ON" for that and a new function in ut8lib.c to check if current locale uses UTF-8. > http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate was used as one of the guides. > I checked the changes and ran tests under Ubuntu 14 and Windows 8. > Windows locale detection and console code page selection are not yet implemented. > > However one change in utf8.s7i causes the compiler s7c to fail. > The change is in lines 242 - 259 and is commented out. > > ../lib/utf8.s7i: In function ‘o_3135_SEL_STD_FILE_FROM’: > ../lib/utf8.s7i:248:45: error: expected expression before ‘;’ token > isUTF8 := utf8_mode_on; > > Please advice what could be the reason. You did not add code for the action UT8_MODE_ON to the compiler. The file seed7/lib/comp/ut8_act.s7i handles UT8 actions. There is also the file seed7/lib/comp/action.s7i which contains code that calls functions in ut8_act.s7i and in other files. If you start s7c with the option -g-debug_c the intermediate *.c file is not removed and the C compiler refers its error message to the line numbers in the intermediate *.c file. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. |
From: Кулешов А. <ark...@ya...> - 2014-12-29 22:24:41
|
Dear Seed7 Users, Attached is an experimental patch that I used to enable UTF-8 multibyte characters in program identifiers. I think it may be useful for educational purposes/schools as an example. Please let me know if you also see other potential uses of this feature. Most changes are in the scanner.c file. The identifier symbols continue to be stored as multibyte C strings. I also added portable wcwidth.c and c_ident.c files from "libutf8" library with reference to the original author. All makefiles were modified to include these new files. Btw, is it the correct way? For me this was easiest portable solution to use wcwidth and to quickly check if a unicode character can be part of identifier. The patch also includes a feature to automatically use utf8 files STD_UTF8_IN and STD_UTF8_OUT for IN and OUT variables. It introduces new primitive action "UT8_MODE_ON" for that and a new function in ut8lib.c to check if current locale uses UTF-8. http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate was used as one of the guides. I checked the changes and ran tests under Ubuntu 14 and Windows 8. Windows locale detection and console code page selection are not yet implemented. However one change in utf8.s7i causes the compiler s7c to fail. The change is in lines 242 - 259 and is commented out. ../lib/utf8.s7i: In function ‘o_3135_SEL_STD_FILE_FROM’: ../lib/utf8.s7i:248:45: error: expected expression before ‘;’ token isUTF8 := utf8_mode_on; Please advice what could be the reason. Regards and Merry Christmas, Arkady Kuleshov |
From: Arkadiy K. <ark...@ya...> - 2014-11-19 23:13:28
|
Hi Thomas. Sorry for a long delay. I am actually busy with my day job and also trying to complete a Functional Programming course right now. At the same time I just revisited Seed7 examples that we discussed. > > 1. When using pointers, is the syntax ^ to dereference still supported? It is mentioned in the manual. > > I consider pointers as the goto of data. ... A priority queue > is currently mising in Seed7. Can you license your include files > with LGPL and your program with GPL? That way it can be added > to the Seed7 release? > I am attaching a working example of the same files implementing MST algorithms but using interface types this time. The license texts are present now. It looks like interface concept in seed7 is very robust and also very verbose. I had to spend a lot of time to get it right. You can also find an alternate implementation of one DYNAMIC method "exch" which caused segmenation fault. Please look at the files minpq.s7i line 41 and prims.sd7 line 47 and uncomment these two implementations to reproduce. If you see no problems with my implementation, I am happy to release these files to the project. > This happens when I call prims: > tm@... ~/Downloads $ s7 prims graph1.txt > SEED7 INTERPRETER Version 5.0.5687 Copyright (c) 1990-2014 Thomas Mertes > graph1.txt > ... > Cost of MST with size 5 is 2624 > Is that correct? yes, the correct answer for graph1.txt is 2624 and the answer for mst_edges.txt is -3612829 > Hopefully my answers are helpful. Of course, you helped me a lot to get started with Seed7 language. > Regards, > Thomas Mertes Best regards, Arkadiy |
From: Thomas M. <tho...@gm...> - 2014-10-05 08:39:32
|
On Sat, Oct 04, 2014 at 17:26 "Arkadiy Kuleshov" <ark...@ya...> wrote: > Hello Seed7 Users. > > Let me express my thanks to Thomas for creating such a fantastic language! You're welcome! > Flexbility of the language is something I want to explore. Right now I am still at the beginning > of mastering seed7 and using my own syntax may be next step. > > Please find attached a Prim's minimum spanning tree implementation as described at this link: > http://algs4.cs.princeton.edu/43mst/ > This is my first complete program in Seed7 and I am asking for a brief code review from anyone. > Basically there are separate files for heap operations and minimum priority queue operations. Thank you very much for your example. Currently I am very busy, but I will have a look at your example later. > Here are some questions. > > 1. When using pointers, is the syntax ^ to dereference still supported? It is mentioned in the manual. In the early days of Seed7 I introduced pointers with the ^ symbol to deference. But I never introduced a concept to allow a struct that can contain a pointer that points to itself. I recognized that I can do all the things needed without pointers. Instead of pointer lists and trees I use containes like arrays and hash tables. As a consequence the example programs do not use pointers (except for wiz.sd7, but I plan to remove it from wiz.sd7 also). Pointers can be replaced with OO methods: http://seed7.sourceforge.net/manual/objects.htm#replacing_pointers I consider pointers as the goto of data. Like structured programming avoids goto statements with structured statements (if, case, while, repeat, for, etc.) it should be possible to avoid pointers with structured data (struct, array, hash, set, etc.). A priority queue is currently mising in Seed7. Can you license your include files with LGPL and your program with GPL? That way it can be added to the Seed7 release? > Also, if I need to create an array of structures and later use pointers to them, what is the best way to do so: > create a normal array of values and then create a pointer to each element using & syntax, or > create an array of pointers and use varalloc to create each element? > What is the difference between varalloc and xalloc? Varalloc and xalloc have been temporary solutions and I have replaced most uses with the function toInterface (see its usage in external_file.s7i). If you really need something similar to pointers use interface and implementation types (see: http://seed7.sourceforge.net/manual/objects.htm). Hopefully it is possible to avoid pointers in an priority queue implementation (Since I am busy with the database drivers now I did not have the time too look into your code). > 2. Can I use template functions to declare new structures and functions on them, such as > described here? http://seed7.sourceforge.net/examples/for_decl.htm > My intention was to declare a generic "new struct" using the same approach but it didn't work > and the error message had "declared twice" information. Structs are already defined as template (generic type) in the file struct.s7i. Maybe you can introduce a template (e.g.: EXTEND_STRUCT with a struct type as parameter) to add functionality to the current struct implementation. > 3. Why do I get the following message when using "in" parameter (probably instead of a "var") > *** minpq.s7i(135):52: Variable expected in {SCT_SELECT({pq . count }) decr } found expression ({pq . count }) of type func integer > decr(pq.count); An 'in' parameter behaves like a constant and the function 'decr' trys to change it. If you use an 'in var' parameter instead it can be changed with 'decr' but the change does not effect the actual parameter (it just happens in the function). I you use an 'inout' parameter instead of an 'in' parameter the function 'decr' can change it and the change takes effect inside and outside the function (the actual parameter is changed also). > 4. The manual mentions that you can implement "doMap" function without lambda expressions. > http://seed7.sourceforge.net/examples/map.htm > But the syntax > > doMap([](1, 2, 4, 6, 10, 12, 16), x, x + 1) > > looks very much like a lambda expression. A lamda encodes parameter name(s) and expression together. Without lamda it is necessary that doMap gets parameter name(s) and expression as saparate parameters. > Could you give more examples on programming using "map", "reduce", "filter", etc? I assume that filter keeps elements that fulfill a condition: const func array integer: doFilter (in array integer: anArray, inout integer: aVariable, ref func boolean: aCondition) is func result var array integer: mappedArray is 0 times 0; begin for aVariable range anArray do if aCondition then mappedArray &:= aVariable; end if; end for; end func; I could be used with: doFilter([](1, 2, 4, 6, 10, 12, 16), x, x < 10) which returns [](1, 2, 4, 6) > Is it possible to apply functions to other data types in addition to arrays? There is no supertype for all containers (that has array as subtype). If such a supertype existed it would be possible. > 5. Attached file minpq_err.s7i causes interpreter to emit segmentation fault when included from any other file. > I think it is because same identifier "item" is used for both a variable name and type name. That could be. But since the variable "item" is local it should not make problems. I will look at this when I have more time. > Instructions: > > Place all attached files into seed7/prg or your programs folder. > Copy the text in the P.S. into graph1.txt > > Run "./s7 prims.sd7 graph1.txt" This happens when I call prims: tm@penguin ~/Downloads $ s7 prims graph1.txt SEED7 INTERPRETER Version 5.0.5687 Copyright (c) 1990-2014 Thomas Mertes graph1.txt No. of vertices is 6 No. of edges is 7 Got edge # 1 (1,2) with weight 2474 Got edge # 2 (2,4) with weight -246 Got edge # 3 (4,3) with weight 640 Got edge # 4 (4,5) with weight 2088 Got edge # 5 (3,6) with weight 4586 Got edge # 6 (6,5) with weight 3966 Got edge # 7 (5,1) with weight -3824 Read graph with 6 vertices and 7 edges Running Prim's MST algorithm pop (1, 0) add (2, 2474) add (5, -3824) Heap (6) is 5:-3824, 2:2474, 3:2147483647, 4:2147483647, 1:2147483647, 6:2147483647 ... pop (5, -3824) add (4, 2088) add (6, 3966) Heap (5) is 4:2088, 2:2474, 3:2147483647, 1:2147483647, 6:3966 ... pop (4, 2088) add (2, -246) add (3, 640) Heap (4) is 2:-246, 6:3966, 3:640, 1:2147483647 ... pop (2, -246) Heap (3) is 3:640, 6:3966, 1:2147483647 ... pop (3, 640) Heap (2) is 6:3966, 1:2147483647 ... pop (6, 3966) Heap (1) is 1:2147483647 ... Cost of MST with size 5 is 2624 -------------------------------------------------------- Is that correct? Hopefully my answers are helpful. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under Linux/Unix/Windows. |
From: Arkadiy K. <ark...@ya...> - 2014-10-04 15:26:32
|
Hello Seed7 Users. Let me express my thanks to Thomas for creating such a fantastic language! Flexbility of the language is something I want to explore. Right now I am still at the beginning of mastering seed7 and using my own syntax may be next step. Please find attached a Prim's minimum spanning tree implementation as described at this link: http://algs4.cs.princeton.edu/43mst/ This is my first complete program in Seed7 and I am asking for a brief code review from anyone. Basically there are separate files for heap operations and minimum priority queue operations. This is an updated message as I am finding correct email format for the list. All mentioned attachments are available by these links: graphs.s7i http://sourceforge.net/p/seed7/mailman/attachment/1073401412422352%40web10o.yandex.ru/2/ heapfunc.s7i http://sourceforge.net/p/seed7/mailman/attachment/1073401412422352%40web10o.yandex.ru/3/ minpq.s7i http://sourceforge.net/p/seed7/mailman/attachment/1073401412422352%40web10o.yandex.ru/4/ prims.sd7 http://sourceforge.net/p/seed7/mailman/attachment/1073401412422352%40web10o.yandex.ru/6/ minpq_err.s7i http://sourceforge.net/p/seed7/mailman/attachment/1073401412422352%40web10o.yandex.ru/5/ Here are some questions. 1. When using pointers, is the syntax ^ to dereference still supported? It is mentioned in the manual. Also, if I need to create an array of structures and later use pointers to them, what is the best way to do so: create a normal array of values and then create a pointer to each element using & syntax, or create an array of pointers and use varalloc to create each element? What is the difference between varalloc and xalloc? 2. Can I use template functions to declare new structures and functions on them, such as described here? http://seed7.sourceforge.net/examples/for_decl.htm My intention was to declare a generic "new struct" using the same approach but it didn't work and the error message had "declared twice" information. 3. Why do I get the following message when using "in" parameter (probably instead of a "var") *** minpq.s7i(135):52: Variable expected in {SCT_SELECT({pq . count }) decr } found expression ({pq . count }) of type func integer decr(pq.count); 4. The manual mentions that you can implement "doMap" function without lambda expressions. http://seed7.sourceforge.net/examples/map.htm But the syntax doMap([](1, 2, 4, 6, 10, 12, 16), x, x + 1) looks very much like a lambda expression. Could you give more examples on programming using "map", "reduce", "filter", etc? Is it possible to apply functions to other data types in addition to arrays? 5. Attached file minpq_err.s7i causes interpreter to emit segmentation fault when included from any other file. I think it is because same identifier "item" is used for both a variable name and type name. Instructions: Place all attached files into seed7/prg or your programs folder. Copy the text in the P.S. into graph1.txt Run "./s7 prims.sd7 graph1.txt" The cost of MST and some trace information should be printed. Graph file(s) have the format [number_of_nodes] [number_of_edges] [one_node_of_edge_1] [other_node_of_edge_1] [edge_1_cost] [one_node_of_edge_2] [other_node_of_edge_2] [edge_2_cost] ... For example, the third line of the file is "2 3 -8874", indicating that there is an edge connecting vertex #2 and vertex #3 that has cost -8874. Thank you, Arkadiy Kuleshov P.S. Not sure if this list processes attachments correctly ===== Begin graph1.txt ====== 6 7 1 2 2474 2 4 -246 4 3 640 4 5 2088 3 6 4586 6 5 3966 5 1 -3824 ===== End graph1.txt ======= |
From: Arkadiy K. <ark...@ya...> - 2014-10-04 13:29:59
|
<div>Hello Seed7 fans.<br /> <br />Let me express my thanks to Thomas for creating such a fantastic language!<br />Flexble of the language is impressing, and one can create and test custom syntax very quickly.<br />I am still at the beginning of mastering seed7 and using my own syntax may be next step.</div><div> </div><div>This is a re-send of my original message to improve readability.</div><div>The attachments are already available at this link: <a href="http://sourceforge.net/p/seed7/mailman/message/32896596/">http://sourceforge.net/p/seed7/mailman/message/32896596/</a><br /> <br />Please find attached a Prim's minimum spanning tree implementation as described at this link:<br />http://algs4.cs.princeton.edu/43mst/<br />This is my first complete program in Seed7 and I am asking for a brief code review from anyone.<br />Basically there are separate files for heap operations and minimum priority queue operations.<br /> <br />Here are some questions.<br /> <br />1. When using pointers, is the syntax ^ to dereference still supported? It is mentioned in the manual.<br />Also, if I need to create an array of structures and later use pointers to them, what is the best way to do so:<br />create a normal array of values and then create a pointer to each element using & syntax, or<br />create an array of pointers and use varalloc to create each element?<br />What is the difference between varalloc and xalloc?<br /> <br />2. Can I use template functions to declare new structures and functions on them, such as<br />described here? http://seed7.sourceforge.net/examples/for_decl.htm<br />My intention was to declare a generic "new struct" using the same approach but it didn't work<br />and the error message had "declared twice" information.<br /> <br />3. Why do I get the following message when using "in" parameter (probably instead of a "var")<br />*** minpq.s7i(135):52: Variable expected in {SCT_SELECT({pq . count }) decr } found expression ({pq . count }) of type func integer<br /> decr(pq.count);<br /> <br />4. The manual mentions that you can implement "doMap" function without lambda expressions.<br />http://seed7.sourceforge.net/examples/map.htm<br />But the syntax <br /><br />doMap([](1, 2, 4, 6, 10, 12, 16), x, x + 1)<br /><br />looks very much like a lambda expression. Could you give more examples on programming using "map", "reduce", "filter", etc?<br />Is it possible to apply functions to other data types in addition to arrays?<br /> <br />5. Attached file minpq_err.s7i causes interpreter to emit segmentation fault when included from any other file.<br />I think it is because same identifier "item" is used for both a variable name and type name.</div><div> </div><div>Instructions:<br /> <br />place all files into seed7/prg or your programs folder.<br />Run "./s7 prims.sd7 graph1.txt"<br /> <br />The cost of MST and some trace information should be printed.<br />Graph file(s) have the format<br /><br />[number_of_nodes] [number_of_edges]<br />[one_node_of_edge_1] [other_node_of_edge_1] [edge_1_cost]<br />[one_node_of_edge_2] [other_node_of_edge_2] [edge_2_cost]<br />...<br />For example, the third line of the file is "2 3 -8874", indicating that there is an edge connecting vertex #2 and vertex #3 that has cost -8874.<br /> <br />Thank you,<br />Arkadiy Kuleshov</div><div> </div><div>PS: By the way, what is the best way to send program code: as an attachment or inline?</div> |
From: Кулешов А. <ark...@ya...> - 2014-10-04 11:55:29
|
6 7 1 2 2474 2 4 -246 4 3 640 4 5 2088 3 6 4586 6 5 3966 5 1 -3824 |
From: Rugxulo <ru...@gm...> - 2014-05-18 21:10:30
|
Hi, sorry for delay, On Sun, May 11, 2014 at 6:10 AM, Thomas Mertes <tho...@gm...> wrote: > > I just checked the source of chk_all.sd7. It writes a dot (.) > for every successful test. Since there is no dot no test > succeeded. Now I follow the idea that there must be a failure > in chk_all.sd7. > > This can be verified by starting chk_all.sd7 in the debugger. > Please go to the directory seed7/prg and start the debugger with: > > gdb s7.exe > > and use the command > > run chk_all > > to start chk_all. With some luck the debugger catches the signal > SEGV. Then you can use the command > > bt > > to create a backtrace. Afterwards you can leave the debugger > with > > q > > When you send me this backtrace I might be able to detect the > cause of the error. ================================================ ... This GDB was configured as "--host=i786-pc-msdosdjgpp --target=djgpp". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from c:/tmp/seed7/prg/s7.exe...done. (gdb) run chk_all Starting program: c:/tmp/seed7/prg/s7.exe chk_all SEED7 INTERPRETER Version 5.0.4494 Copyright (c) 1990-2014 Thomas Mertes compiling the compiler Program received signal SIGSEGV, Segmentation fault. 0x00091b58 in __stricmp () (gdb) bt #0 0x00091b58 in __stricmp () #1 0x00088df5 in find_eq_filename () #2 0x00088d99 in __clear_fd_properties () #3 0x0008d35d in _close () #4 0x00079c58 in fclose () #5 0x00000000 in ?? () (gdb) q ================================================ |
From: Thomas M. <tho...@gm...> - 2014-05-11 11:27:25
|
The function drwGetImage has been added to drw_dos.c in version 2014-01-19. Many thanks for pointing out, that it was missing. Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under Linux/Unix/Windows. |
From: Thomas M. <tho...@gm...> - 2014-05-11 11:18:23
|
Hello Ian, Are you asking if Seed7 can be used to rewrite your program? Currently Seed7 has no support for regular expressions. The reasons for that are explained in the FAQ (see http://seed7.sourceforge.net/faq.htm#regular_expressions ). So you can either add regular expression support to Seed7 or consider using scanner functions. Since I consider regular expressions as hard to the maintain I suggest you use scanner functions. But without detailed knowledge of your application it is not possible to decide. How many lines of code does this program have? How many regular expressions are used in this programs? Regards, Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under Linux/Unix/Windows. |