\chapter{S-Lang 2 Interpreter NEWS} \sect{What's new for \slang 2.1} The next section describes the features that were added to version 2.0. This section is devoted to what's new in version 2.1. For a much more complete and detailed list of changes, see the \file{changes.txt} file that is distributed with the library. \begin{itemize} \item Short circuiting boolean operators \exmp{||} and \exmp{&&} have been added to the languange. The use of \exmp{orelse} and \exmp{andelse} constructs are nolonger necessary nor encouraged. \item \em{Qualifiers} have been added to the language as a convenient and powerful mechanism to pass optional information to functions. \item Structure definitions allow embeded assignemnts, e.g, #v+ s = struct {foo = 3, bar = "hello" }; #v- \item Comparison expressions such as \exmp{a 1}. Instead, \exmp{str} will now become a \exmp{Char_Type[nread]} object. In order to read a specified number of bytes from a file in the form of a string, use the \ifun{fread_bytes} function: #v+ #if (_slang_version >= 20000) nread = fread_bytes (&str, num_wanted, fp); #else nread = fread (&str, Char_Type, num_wanted, fp) #endif #v- The above will work with both versions of the interpreter. \tag{strtrans} The \ifun{strtrans} function has been changed to support Unicode. One ramification of this is that when mapping from one range of characters to another, the length of the ranges must now be equal. \tag{str_delete_chars} This function was changed to support unicode character classes. Code such as #v+ y = str_delete_chars (x, "\\a"); #v- is now implies the deletion of all alphabetic characters from \exmp{x}. Previously it meant to delete the backslashes and \exmp{a}s from from \exmp{x}. Use #v+ y = str_delete_chars (x, "\\\\a"); #v- to achieve the latter. \tag{substr, is_substr, strsub} These functions use character-semantics and not byte-semantics. The distinction is important in UTF-8 mode. If you use array indexing in conjunction with these functions, then read on. \end{descrip}