NEWS.TXT    /* REFAL-5 */

VERSION-PZ/Version ПѮ 11.09.2025
*****************************************************************************
  -- A number of errors have been rectified.
  -- Despite this version of the system Refal-5 has been developed by means of
     porting Version ПѮ 20.12.2023 from OS Linux into 
     OS Windows x86_64 (Microsoft Windows [Version 10.0.26100.4946])
     it is a bit extended as compared with the Version ПѮ 20.12.2023
     but still is not ported back to OS Linux.

The main CONTRIBUTOR of this Version ПѮ is 
 
       Mikhail Terjukha (Михаил Терюха).
 
   -- A number of errors were corrected. 
      We are grateful to Alexandr Konovalov and Antonina Nepeivoda for very fruitful 
      discussions on development and implementation of this version of the Refal-5 system.
      Alexandr Konovalov also provided a number of very important hints for future users.
      The tips were inserted in the pdf-informal documentation.  
      
   -- The Refal-5 system is a console application. 
      The active code page of the console should be set as 65001, i.e. the utf-8 encoding.

      При условии правильной установки кодовой страницы вашей консоли, чтобы (пока) некоторые Рефал программы общались 
      с пользователем по-русски, вторая строка языковых установок вашей операционной системы 
      должна отождествляться с образцом: 'ru-' s.R s.U ' ' e.info.
      Список строк установленных языковых настроек можно посмотреть с помощью команды
      Windows_cmd> PowerShell -Command "& {Get-InstalledLanguage}"
      Первой строкой, обычно, в этом списке идет строка начинающаяся с приставки: en-US
      Если при запуске компилятора refc приходит сообщение Version ПѮ, то это означает, что все языковые настройки установлены правильно,
      иначе refc сообщит о Version PZ. (См. также pdf-версию документации о возможных проблемах, связанных с шрифтом консоли.)
      
   -- All Refal-5 program sources should be written using the utf-8 encoding.
      In particular, make sure that both Refal-5 sources using unicode symbols and input to the utilities -- crefal.ref, prefal.ref and so on 
      are written in the utf-8 encoding.
 
                --- A short documentation on this Refal-5 version is distributed in a separate pdf-file.
                    The pdf-documentation extends the one given in the txt-file that is now reading by users.
                --- The list of basic encodings has been extended with utf-16le and utf-16be,
                    which can be used by the corresponding built-in functions for reading/writing from/to streams,
                    excluding the standard streams: stdin, stdout, stderr and so on.
                --- The file-system concepts that are presented in OS Windows by means of the utf-16le encoding are to be seen
                    by users developing a Refal-5 program as standard strings including unicode symbols given in the utf8 encoding.
                    The concepts include paths, file names, values of environment variables and arguments of the cmd commands called from
                    the console used.
                --- The preprocessor refpp.ref has been extended. Now users may write any natural number, using the decimal system.
                    I.e. the lengths of the numbers are not uniformly bounded. 
                    Given such a number written in a file, the preprocessor transforms it to the corresponding sequence of macro-digits.
                    For example, the following decimal digit sequence 
                    #/0012345678901234567890123456789012345678901234567890/ will be transformed to the following macro-digit sequence
                    36280689513 12319663444204090490 17926562471779175122 represented the decimal description in the 2^64-base system.
                    The pair of the "brackets" #/ and / above embracing the digit sequence to be transformed by the preprocessor.
                    Many thanks to Alexandr Konovalov who proposed such an extension of refpp.ref!
                    
      In the case the locale in the operating system Windows x86_64 was installed as following,
      the installed languages are described with a list of strings produced by the console command
      Windows_cmd> PowerShell -Command "& {Get-InstalledLanguage}"
      and the second line in the list may be matched with the partten: 'ru-' s.R s.U ' ' e.info,
      the first line, as a rule, starts with the prefix: en-US,
      (while the active console code-page is set as 65001, i.e. utf-8 encoding),
      then the Refal-5 version is specified as Version ПѮ and some of programs included 
      in the distributive will contact to users, using Russian.

  
VERSION-PZ/Version ПѮ 20.12.2023
*****************************************************************************
  -- A couple of errors have been rectified.
  -- Благодарим Михаила Шигорина за представление доступа на ЭВМ Эльбрус,
     который позволил убедиться в том, что версия Рефал-5-ПѮ собирается и 
     работает в операционной среде Alt/Linux_64 ЭВМ Эльбрус-16С. 
     Все модули *.rsl из дистрибутива версии Рефал-5-ПѮ работают 
     (без перекодировок) в среде ЭВМ Эльбрус.

VERSION-PZ/Version ПѮ 18.09.2023
*****************************************************************************
The main CONTRIBUTOR of the Version ПѮ is
 
       Mikhail Terjukha,
 
 a student of Bauman Moscow  State Technical University,
 originally named "Московское Императорское техническое училище", 
 later - МВТУ (в СССР), founded in 1868.
 
   -- A number of old errors were corrected. Many thanks to Alexandr V. Konovalov for the bug tests!
     What is more, he had corrected one of the errors by himself. Thanks once again!
     We are grateful to Alexandr Konovalov and Antonina Nepeivoda for very fruitful 
     discussions on development and implementation
     these versions of both the Refal-5 language and the Refal-5 system.  

  -- This version was ported to the environment of the operating system Linux x86_64, it is, 
      for the moment, not supported under Windows.
 
  -- Syntax of Refal-5 has been extended with the unicode characters that is:
                    -- the unicode character set is now a subset of the Refal-5 data;
                    -- the program syntax is extended as well;
                    -- the domains of some of built-in functions are extended;
                    -- the domains of some of Refal library functions are extended (see reflib.ref);
                    -- a number of new both built-in and library functions were created.
                --- A short documentation on the extensions is prepared in a separate pdf-file.

     Это означает, что синтаксис данных поддерживает не только Кириллицу, но и глаголицу, и китайские иероглифы, и арабскую вязь, и т.д.
     Все это при условии правильной установки локали в вашей операционной системе, а именно, по-умолчанию должна использоваться
     кодировка utf-8; кроме того, чтобы (пока) некоторые Рефал программы общались с пользователем по-русски по-умолчанию
     значение переменной окружения LANG должно отождествляться с образцом: 'ru_' s.R s.U '.UTF-8'.
     Если при запуске компилятора refc приходит сообщение Version ПѮ, то это означает, что все параметры локали установлены правильно,
     иначе refc сообщит о Version PZ.


     In the case the local in the operating system Linux x86_64 was installed as following,
     the environment variable LANG is 'ru_' s.R s.U '.UTF-8' (i.e. Russian and utf-8 encoding),
     then the Refal-5 version is specified as Version ПѮ and some of programs included 
     in the distributive will contact to users, using Russian.
                   
  -- A number of new switches/options to run both the Refal-5 compiler ( refc ) 
     and the interpreter Refal-5 ( refgo ) are present.
     See the options with launching
     linux> refc --help
     linux> refgo --help
     
  -- A number of other students of the same University took part in further development of the Refal-5 system.
 
     Many thanks to both the students and their university instructors!
     The university instructors are Alexandr V. Konovalov and Antonina N. Nepejvoda.
     
     We hope the further development done by the students will be soon incorporated in the Refal-5 system as well.


VERSION-PZ 12.22.2008
*****************************************************************************
  -- A number of errors were corrected.

  -- New switch to run the Refal-5 compiler ( refc ) is present:
            ---  '-h' : print a help on start switches of the Refal-5 interpreter.


VERSION-PZ-New 28.10.2004
*****************************************************************************
  -- A number of errors were corrected.

  -- New switches to run the Refal-5 interpreter ( refgo ) is present:
            ---  '-e' : upon internal error stop do not use interactive mode.
                        The interactive mode asks the user
                        "Do you want to print view-field? [Yn]".
                        The switch turn the answer to the question
                        into [n] as default. The switch allows remove 
                        interactive mode when "Recognition Impossible" takes place.
            ---  '-h' : print a help on start switches of the Refal-5 interpreter.

  -- New built-in functions were created: 
     Random, RandomDigit, GetPID, GetPPID (this function just for Linux/Unix), 
     Write, ListOfBuiltin, SizeOf.

     <Random e.macro-digit> :: e.integer
      e.macro-digit ::= s.macro-digit | '+' s.macro-digit 
      e.integer ::= s.macro-digit ...
      The function takes a macrodigit as an argument and
      returns a nonnegative random integer number. The number of macrodigits 
      of the random number is lesser or equal than e.macro-digit.

     <RandomDigit e.macro-digit> :: s.macro-digit
      e.macro-digit ::= s.macro-digit | '+' s.macro-digit 
      The function takes a macrodigit as an argument and returns a random macrodigit.
      The the random macrodigit is lesser or equal than e.macro-digit.
 
     <GetPID> :: s.macro-digit  ( by A.A. Vladimirov )
      The function returns the identity number corresponding to the process
      of the current Refal-5 interpreter running under an operating system.

     <GetPPID> :: s.macro-digit ( by A.A. Vladimirov )
      The function returns the identity number corresponding to the parent 
      process of the current Refal-5 interpreter running under 
      the operating system Linux (Unix). This function is undefined under
      the operating system Widows. (In fact, <GetPPID> == <GetPID> under Windows.)

     <Write s.file-descriptor e.expression> :: e.empty
      The function is similar to the Putout built-in function.
      There is just one difference between the functions:
      the Write function does not add a new line character after
      output of the expression, while the Putout function does that.

     <ListOfBuiltin> :: e.built-in-functions-info
      e.built-in-functions-info ::= (s.fnumber s.built-in-function-name s.ftype) ...
      s.ftype ::= regular | special
      s.fnumber ::= s.macro-digit ,
      where s.fnumber is the system number of the built-in function.
      
     <SizeOf s.char> :: s.macro-digit
      Just a system built-in function.

  -- Input format of built-in function Open was extended:
     <Open s.Mode s.Descriptor e.File-name>
     Now the mode can be a character or a compound symbol as well.
     So a file may be open for any mode supported in C.
     For example, "wb" may be used for binary writing.

  -- A number of Refal-5 interpreter system limits were raised:
        RI_MEMORY_LIMIT (4 with 16),
        DEFAULT_STACK_SIZE (256 with 512),
        DEFAULT_TABLE_SIZE (512 with 1024),
        FILE_LIMIT (20 with 40).

  -- A new file "copyright.txt" was created.


VERSION-PZ-New 20.09.2000
*****************************************************************************
  -- A number of errors were corrected.

  -- Automatic addition a built-in function can be done.
     New built-in function is created by CGRC4 ( by Alexandr Konyshev ).
     CGRC4 is a compiler of Refal-graph ( a result of the Scp4 ) to C-language.

  -- A new switch to run the Refal-5 tracer ( reftr ) is present:
            ---  -f_file_name_ ( or -f _file_name_ ) 
                 when this switch is ON, then Refal-5 tracer doubles all
                 stdin output to the _file_name_  file.

  -- Two standart function were created ( REFLIB.REF ):
            --- PairArg s.number> 
                 pairs '(' and ')' into structure brackets from <Arg s.number>
            --- <InputArg s.number>
                 inputs Refal expressions, program style code from <Arg s.number>

VERSION-PZ-New 28.08.2000
*****************************************************************************
  -- A number of errors were corrected.

  -- THIS VERSION IS NOT SUPPORTED UNDER MS-DOS.

  -- SYNTAX OF REFAL-5 WAS CHANGED. So you have to CORRECT your Refal-5 
     sources to use the new version of Refal-5.

     The canges in brief informal description:
             --- semantics of the "-double quotes was changes:
                   A compound symbol is a sequence of arbitrary characters 
                   enclosed in double quotes, e.g. "a+B-c". As with strings, 
                   an escape character may enter a compound symbol only as its 
                   escape sequence. Unlike a single-quoted  string, a compound 
                   symbol is handled as a whole: exactly one symbol.
                   "" is a compound symbol with the empty name.

                   An identifier is a sequence of characters which begins with 
                   a letter and  may include letters, digits, and characters dash  - ,
                   and underscore _  . An identifier may be enclosed in double quotes,
                   then it can be seen as a special case of a compound symbol. 
                   This operation does not alter it: "abc" is the same as abc. 
                   As in a compound symbol, the case of the letters in an identifier 
                   is significant: abc is not the same as Abc. 

                   A function name is an identifier.
  
                   Characters inside names of compound symbols are case-sensitive.

             --- semantics of the '-quotes was corrected:

                   '' is an empty sequence of characters, id est an empty expression.

                  A number of characters have to be escaped (with '\') inside quotes
                  as well as inside double quotes. 
                  The characters are ' , " , \ , n (NEW LINE), r (CARRIAGE RETURN ) ,
                  t (HORIZONTAL TAB), 
                  xHH ( character-byte whose code is HH, where each H is an arbitrary
                        hexadecimal digit )

             --- A variable is a type indicator followed by a dot, followed by an index.

             --- Built-in function Type was modified:

                  <Type e.Expr> :: s.Type s.Subtype e.Expr 
                     where e.Expr is unchanged and s.Type and s.Subtype 
                     depend on the type of the first element of e.Expr . 

                     s.Type  s.subtype e.Expr starts with 
                     'L'  s.subtype Latin letter 
                          'Lu'   capital Latin letter
                          'Ll'   lower Latin letter 
                     'D'   0   decimal digit  
                     'W'  s.subtype   word ( compound symbol ) 
                          'Wi'  identifier 
                          'Wq'  other word 
                     'N'    0  macrodigit 
                     'P'   s.subtype    printable character
                          'Pu'      character belongs to upper case.
                          'Pl'      character belongs to lower case.
                     'O'   s.subtype   any other symbol 
                          'Ou'      character belongs to upper case.
                          'Ol'      character belongs to lower case.
                     'B'   0 left parenthesis 
                     '*'   0  e.Expr  is empty 

              --- There are other changes.
 
  -- New built-in functions were created: 
     TimeElapsed, XMLParse (just Windows NT/98/95), DeSysfun

     <TimeElapsed e.init> :: e.char-digits '.' e.char-digits
      takes empty expression or macrodigit zero. It returns  elapsead system time. 
      The time is elapsed time from a last call to the same function with zero as 
      its argument. If there was no such call then the time is elapsed time from 
      start of loading of RSL-modules. The time is given in seconds.
      If the argument is something else, then "Recognition impossible" occurs. 
 
     <XMLParse e.file_name> :: e.expression
	takes characters (e.file_name) as a file name to be parsed. 
        Content of the file is consedered as a XML-document and parsed 
        in e.expression. At present this function just Windows NT/98/95.

     <DeSysfun e.file_name (s.number e.expression)> :: e.empty /* nothing */
	takes characters (e.file_name) as a file name where the e.expression
        should be deparsed. s.number is a maximal allowed length of lines 
        in the file. The function is inverse to Sysfun
        The next predicate is successful
            <DeSysfun e.file-name (s.number e.data)>: e.1, 
            <Sysfun e.file-name>: e.new-data, e.data : e.new-data

  -- Internal tracer's print was changes: 
        expression are encoded in the same fashion as in Refal-5 program.
  
VERSION-PZ 12.04.2000
*****************************************************************************
  -- A number of errors were corrected.

  -- FORMAT OF THE RSL-FILES WAS CHANGED AGAIN! So you have to RECOMPILE 
     your Refal-5 sources to use the new version of Refal-5.
  
  -- "Simultaneous" compilation a number of modules is possible:
     refc [<file_name1>[.ref] ... <file_nameN>[.ref]]
     The files are compiled step by step while a module with a syntax error will
     not found out. In the last case the process of compilation gives 1 as 
     a return cod otherwise the return cod is 0.


VERSION-PZ 31.01.2000
*****************************************************************************
  -- A number of errors were corrected.

  -- FORMAT OF THE RSL-FILES WAS CHANGED AGAIN! So you have to RECOMPILE 
     your Refal-5 sources to use the new version of Refal-5.

  -- A limit on lengths of variable's names was removed.

  -- A limit on lengths of function's names was removed.

  -- A limit on lengths of identifiers was removed.

  -- A number of new switches to run the Refal-5 interpreter are present:
        -cnnn (or --code_limit=nnn) 
                : rsl-module's size is limited with nnn Kb. By default 64Kb.
        -Vnn  (or --var_stack=nn  ) 
                : size of the element's table is limited 
                  with nn*(a BASE_SIZE_TABLE_OF_ELEMENT), 
                  We keep values of Refal-variables in the table.(e,s,t-variabbles)
                  (As well as other information for pattern matching).
                  We recommend the range of the counter from 1 to 10.
        -Cnn (or --call_stack=nn) 
                : size of stack of function call from left sides of Refal sentences is
                  is limited with nn*(a BASE_SIZE_STACK). 
                  We recommend the range of the counter from 1 to 10.
 

  -- New built-in functions were created: 
     ExistFile, GetCurrentDirectory, RemoveFile

     <ExistFile e.name> :: s.Boolean
	the characters (e.name) is a file name. This function checks wether  
	exist the file. Return a boolean value ("True"/"False") as 
	a refal-symbol.

     <GetCurrentDirectory> :: e.characters
	This function is called without arguments. It return a name of the current 
	directory, where the Refal-5 interpreter is running.

     <RemoveFile e.file_name> :: s.Boolean (e.Errors)
	takes characters (e.file_name), as a file name to be deleted. Return
	a boolean value s.Boolean ("True" or "False") as a refal-symbol and 
	a term - (e.Errors) . If the function cannot delete the file 
	(s.Boolean = False), then the value of e.Errors is a description of an error
        which is happend. Otherwise e.Errors is empty. The description is a sequence
        of characters.


VERSION-PZ 24.10.1999
*****************************************************************************
  -- A number of errors were corrected. 

  -- FORMAT OF THE RSL-FILES WAS CHANGED ! So you have to RECOMPILE 
     your Refal-5 sources to use the new version of Refal-5.

  -- The limit to lengths of names of Refal-5 modules was removed.
     At present, the length is restrected just a current operating system.

  -- New built-in functions were created: System, Exit, GetEnv.

     <System e.characters>
       takes characters and tries to interpret them as a shell's command of
     a current operating system. The string must not exceed 255 characters.
     If the value is a negative integer, then the function returns the value 
     as two terms: '-' and a macrodigit, otherwise it returns a macrodigit.
       If the argument is not a sequence of chracters, then "Recognition
     impossible" occures. 

    <Exit e.return-code>
      takes a macrodigit or two terms ( '-' s.macrodigit ) and interrupts
    a current Refal-process. The process returns the argument to 
    the current operating system as a return-code.   
      If the argument is something else, then "Recognition impossible" occures. 

    <GetEnv e.characters>
       takes characters and interprets it as an environment variable of
    the current operating system. The string must not exceed 120 characters.
    If the variable is undefined, then the function returns the empty 
    expression, otherwise it returns a value of the variable as an sequence 
    of chracters.  
       If the argument is not a sequence of chracters, then "Recognition
    impossible" occures. 

 -- REF5RSL-enviroment variable of the current operating system can be
    used. A value of the variable is interpreted as a sequence of paths
    to RSL-files. If the Refal-5 interpreter cannot find out a file.rsl 
    inside a current directory ( to load the file ), then the interpreter 
    looks for a first directory from the sequence where there exist a file
    with the same name and loads it. The paths in the sequence have to be
    devided with semicolons.

 -- The syntax of the Refal-5 loader was extended. Now a user can load
    RSL-files using a left distributive rule: catenation is used as 
    multiplication and each factor-path is added the subdirectory character 
    on the end.
    An example for UNIX: 

    refgo f1+path1(f2+path2(f4+path3(f6+f7)+f8))+path4(f9+f10)
       is equal to
    refgo f1+path1/f2+path1/path2/f4+path1/path2/path3/f6+path1/path2/path3/f7+path1/path2/f8+path4/f9+path4/f10

 -- The Refal-5 executable modules (refc, refgo and reftr) return 
    ( to the current operating system ) either 0 if it has just stoped normally,
    or another integer in the next cases:
          refc:  
                - syntax errors in a file which was compiled;
                - there exist not a file to be compiled;
          refgo, reftr:
                - "Recognition impossible" is happened;
                - a read/write operation is failed; 
                - there exist not a file to be loaded;
                - format of a file to be loaded is incorrect;
                 
**************************** The End *****************************************
