1NEWS for version 2.3.x -*-text-*- 2 324 bit color support (new for version 2.3.1) 4============================================ 5 6 The SLtt interface has been modified to support 24 bit (true) 7 colors. Until the next major release (version 3), this feature is 8 available for 64 bit Unix/VMS systems to keep binary compatibility. 9 Support for 32 bit systems will be added in version 3. 10 11 Since not all terminals support true color, and it is not supported 12 by terminfo, 24 bit color is disabled by default. A list of 13 terminals that support true color may be found at 14 <https://gist.github.com/XVilka/8346728>. 15 16 To indicate that a terminal supports true color, set the value of 17 the environment variable COLORTERM to either "24bit" or "truecolor", 18 e.g., 19 20 export COLORTERM=truecolor 21 22 Then to use 24 bit color in applications such as jed and slrn, use a 23 24bit RGB value in the form "#RRGGBB" as the name of the color. 24 For example, to set the color of the status line in jed to AliceBlue 25 (#F0F8FF) on a SlateGray (#708090) background, use 26 27 set_color ("status", "#F0F8FF", "#708090"); 28 29 in the .jedrc file. In slrn, to set the color of the author name to 30 the above colors use 31 32 color author "#F0F8FF" "#708090" 33 34 in the .slrnrc file. Also note other character attributes may be 35 specified, e.g., "#F0F8FF;italics;underline". 36 37New Modules 38=========== 39 40 1. base64: A base64 encoder/decoder module 41 2. chksum: A module for computing various checksums (currently md5 42 and sha1) 43 3. stats: A statistics module 44 4. histogram: A histogram module 45 5. json: Encode/decode json structures 46 47Module Updates 48============== 49 50 stats-module: Added Anderson-Darling normality and 51 k-sample tests (version 2.3.1) 52 53Intrinsic Functions 54=================== 55 56 The following intrinsic functions have been added for 2.3.x: 57 58 sincos : returns both sin and cos in one function call 59 60 get/setitimer: get/set an interval timer 61 62 wherefirstmin/max, wherelastmin/max: returns index for first/last 63 min/max values of an array 64 65 wherefirst_eq/ne/gt/lt/ge/le, where_last_eq/ne/gt/lt/ge/le: 66 returns first/last index of an array where the array value is 67 eq/ne/gt/lt/ge/le of a specified value. (version 2.3.1) 68 69 wherediff: returns indices where adjacient elements of an array 70 differ. 71 72 bstrjoin, bstrcat: like strjoin/strcat but for binary strings. 73 74 get_environ: returns an array of currently defined environment variables. 75 76 getrusage: Get resource usage 77 78 lchown: Change ownership of a symbolic link 79 80 get/set_printable_bstring_size: Get/set the length of the 81 printable representation of binary strings. (version 2.3.1) 82 83 statvfs: Intrinsic that wraps statvfs POSIX function that returns 84 file system statistics. (version 2.3.1) 85 86 _ftime: returns the number of (wallclock) seconds since an epoch 87 (version 2.3.1) 88 89 wchars_to_string/string_to_wchars: Convert a UTF-8 encoded string 90 to and from an array of Unicode characters. (version 2.3.1) 91 92 _array_byteswap: used to convert the values of an array from one 93 endianness to another (version 2.3.2) 94 95 The following functions have been enhanced: 96 97 array_map modified to support multiple return values. 98 99 is_substrbytes: Added support for an optional offset into the 100 string. 101 102 _push_struct_field_values: An optional argument may be used to 103 specify the fields to be pushed. (version 2.3.1) 104 105Interpreter Syntax 106================== 107 108 The step parameter was made optional for the _for statement. 109 110 Struct field names may be an arbitrary string: 111 112 X = struct {"some-field", some_other_field }; 113 X.some_other_field = 3; 114 X."some-field" = 4; 115 116 String literals now support \uABCD to specify a 32 bit unicode 117 character. Previously, the braces were required (\u{ABCD}). 118 (version 2.3.1) 119 120 A reserved word may be used for a struct field name without quoting 121 it (version 2.3.2) 122 123 124slsh library (used by conforming slang apps such as jed, slrn, ...) 125=================================================================== 126 127 fswalk.sl: Functions that facilitate walking the filesystem. 128 129 listfuns.sl: Set of functions dealing with lists and list-based 130 structures (e.g., heaps). 131 132 rearrange: Performs an in-place arrangement of values in an array 133 or list (defined in arrayfuns.sl). 134 135 136slsh 137==== 138 139 Using "who" at the slsh> prompt will list the names/values of 140 variables and functions defined at the prompt. 141 142API News 143======== 144 145 Note: The slang 2.3.x API is backward binary compatible with slang 146 2.y.z. 147 148 Font attributes (italics, bold, underline, ...) may be enabled for 149 terminals that support them by using a color name with a qualifier: 150 151 SLtt_set_color ("menu", "white;italics", "blue"); 152 SLtt_set_color ("comment", "black;underline;italics", "cyan"); 153 154 SLang_init_tty: if flow control parameter is negative, the 155 terminal's flow control setting will not be changed. 156 157 New functions: 158 159 Functions for dealing with qualifiers passed to intrinsic 160 functions: 161 SLang_qualifier_exists; 162 SLang_get_int_qualifier; 163 SLang_get_long_qualifier; 164 SLang_get_double_qualifier; 165 SLang_get_string_qualifier; 166 167 Callback functions that allow an app additional hooks into the 168 slang readline functions: 169 170 SLrline_set_free_update_cb; 171 SLrline_set_update_clear_cb; 172 SLrline_set_update_preread_cb; 173 SLrline_set_update_postread_cb; 174 SLrline_set_update_width_cb; 175 SLrline_get_update_client_data; 176 177 Functions for dealing with interpreter associative arrays: 178 179 SLang_create_assoc; 180 SLang_push_assoc; 181 SLang_pop_assoc; 182 SLang_free_assoc; 183 SLang_assoc_put; 184 SLang_assoc_get; 185 SLang_assoc_key_exists; 186 187 Functions for dealing with interpreter list objects: 188 189 SLang_create_list; 190 SLang_list_append; 191 SLang_list_insert; 192 SLang_push_list; 193 SLang_pop_list; 194 SLang_free_list; 195 196 Functions for dealing with interpreter structures: 197 198 SLang_create_struct; 199 SLang_push_struct_field; 200 SLang_pop_struct_field; 201 SLang_pop_struct_fields; 202 203 Miscellaneous Functions: 204 205 SLstack_exch; 206 SLcompute_string_hash; 207 SLpath_getcwd; 208 209Unicode Support 210=============== 211 212 Unicode tables were updated to version 10.0.0 (version 2.3.2) 213 214Miscellaneous 215============= 216 217 Support was added to support 32-bit terminfo database 218 entries introduced by ncurses 6.1 (version 2.3.2) 219 220=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x= 221 222NEWS for version 2.2.x -*-text-*- 223 224Interpreter Enhancements 225======================== 226 227 1. The ternary expression was added: 228 229 expression = condition ? val1 : val2 230 231 If condition is non-zero, then expression = val1, 232 otherwise expression = val2 233 234 2. The break and condition statements support an optional integer 235 that indicates how many loop levels the statement affects, e.g., 236 the break statement in 237 238 while (1) 239 { 240 loop (10) 241 { 242 break 2; 243 } 244 } 245 246 will cause both loops to be terminated. 247 248 3. Multiline strings have been added: 249 250 "This is a \ 251 multiline \ 252 string" 253 254 `This is 255 another multiline 256 string that 257 does not require 258 a \ for continuation` 259 260 4. List_Type objects may be indexed using an array of indices 261 instead of just a single scalar index. 262 263 5. (v2.2.3) Binary literal integers of the form 0bxx...x are supported. 264 Here, x is 0 or 1. The printf "%B" format specifier was added 265 to format integers as binary. 266 267 6. (v2.2.3) The dereference operator (@) may be used in a structure 268 definition to include the fields from the dereferenced 269 structure, e.g., 270 271 space = struct {x, y, z}; 272 spacetime = struct {@space, t}; 273 274 7. (v2.2.3) Dereferencing a scalar or vector class type now 275 results in duplication of the object, e.g, @7 will produce 7. 276 277 8. (v2.2.3) Mergesort was made the default sorting algorithm. See the 278 array_sort for details. 279 280Modules 281======= 282 283 1. zlib: A module that wraps the popular z compression library. 284 285 2. fork: A module that wraps the fork, exec*, and waitpid functions. 286 287 slsh/lib/process.sl utilizes this module to allow an 288 application to easily create subprocesses and pipelines. 289 290 3. sysconf: Module that implements interfaces to the posix 291 sysconf, pathconf, etc. functions. 292 293 4. (2.2.3) csv: A module that supports the reading and writing of 294 so-called Comma Separated Values files. 295 296Intrinsic Functions 297=================== 298 299 The following intrinsic functions have been added for 2.2.x: 300 301 sumsq 302 equivalent to sum(x*x) 303 304 expm1 305 More accurate version of exp(x)-1 for x near 0. 306 307 log1p 308 More accurate version of log(1+x) for x near 0 309 310 list_to_array 311 Creates an array from a list. 312 313 string_matches 314 A convenient alternative to string_match and string_match_nth 315 functions. 316 317 strskipbytes (v2.2.3) 318 Skip a range of bytes in a byte string. 319 320 is_substrbytes (v2.2.3) 321 Like is_substr except this works with binary strings 322 containing embedded null characters. 323 324 strskipchar, strbskipchar (v2.2.3) 325 Analogous to C ch=*p++ and ch=*p-- for UTF-8 encoded strings. 326 327 _close 328 Close an integer descriptor 329 _fileno 330 Returns the descriptor as an integer 331 332 dup2, getsid, killpg, getpriority/setpriority 333 Wraps the corresponding system functions. 334 335 utime (v2.2.3) 336 Change a file's last access and modification time. 337 338 ldexp, frexp: 339 If x == a*2^b, where 0.5<=a<1.0 then (a,b)=frexp(x), 340 and x=ldexp(a,b). 341 342 islower, isupper, isxdigit, isalnum, isalpha, iscntrl, isprint, 343 isgraph, ispunct, isblank, isascii, isspace (v2.2.3): 344 Character classification functions. 345 346 list_append, list_join (v2.2.3) 347 Functions for merging two lists together. 348 349 ttyname (v2.2.3) 350 Get the name of the terminal 351 352 timegm (v2.2.3) 353 Inverse of gmtime 354 355 The following functions have been enhanced: 356 357 hypot 358 If given a single array argument, it returns the equivalent 359 of sqrt(sum(X*X)). 360 361 Support for N arrays added for e.g., the Euclidean norm in 362 an N dimensional space (v2.2.3) 363 364 _min, _max: (v2.2.3) 365 Added support for more than two elements. 366 367 polynom 368 The calling interface to this function was changed and 369 support added for arrays. 370 371 strjoin (v2.2.3) 372 delimiter made optional 373 374 strreplace (v2.2.3) 375 New usage designed to facilitate the most common case where 376 one wants to replace all the substrings. 377 378 strtrans (v2.2.3) 379 Additional character classes added (see documentation). 380 381 string_match, string_matches (v2.2.3) 382 The position argument made optional 383 384 The following string functions have been vectorized to act upon 385 arrays of strings (v2.2.3): 386 387 is_substr 388 str_delete_chars 389 strbytelen 390 strcharlen 391 strcmp 392 strcompress 393 strlen 394 strlow 395 strnbytecmp 396 strncharcmp 397 strncmp 398 strtrans 399 strtrim 400 strtrim_beg 401 strtrim_end 402 strup 403 404 405slsh 406==== 407 slang readline enhancements: 408 New functions: 409 rline_up/down_hist 410 Behaves similar to zsh up/down-line-or-search functions (v2.2.3). 411 412 rline_call_editor 413 rline_edit_history 414 rline_edit_line 415 Call external editor for line/history editing. (v2.2.3) 416 417 Structure field completion. (v2.2.3) 418 419 Instead of scrolling horizontally when editing a line, 420 attempt to wrap the line. (v2.2.3) 421 422 setfuns.sl: Various set functions: unique, intersection, 423 complement,union (v2.2.3) 424 425Misc 426==== 427 428 Unicode tables updated to version 5.1. 429 430=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x=x 431 432NEWS for version 2.1 433 434Building the library 435==================== 436 437 `make install' installs the shared version of the library. 438 Previously `make install' installed just the static version and a 439 separate step (`make install-elf') was required to install the 440 shared version. Now, `make install-static' is necessary to install 441 the static one. 442 443Interpreter News 444================= 445 446Syntax enhancements: 447-------------------- 448 449 1. Short circuiting boolean operators: 450 451 if ((x == y) || (y == 3) && (x != 4)) ... 452 453 (orelse and andelse are deprecated) 454 455 2. Structure definitions allow embdedded assignment expressions: 456 457 s = struct {x = 3, name="foo", a = [1:10]}; 458 459 3. Qualifiers (aka "keywords") added to the language: 460 461 save_file ("foo.c"; overwrite=1); 462 plot_points ([1:10], sin([1:10]); color="red", style="solid"); 463 464 3. Expressions such as (a < b < c) now interpreted to mean 465 (a<b)and(b<c). 466 467 4. New keywords: ifnot, then 468 469 ifnot may be used instead of !if, which has been deprecated. 470 For "then" see the next item. 471 472 5. Looping constructs support a "then" clause that will get 473 executed if the loop runs to completion, e.g., 474 475 loop (20) 476 { 477 if (this ()) 478 break; % The then clause will NOT get executed 479 } 480 then do_that (); 481 482 6. A floating point array of exactly N elements may be created 483 using the form [a:b:#N], where the elements are uniformly 484 spaced and run from a to b, inclusive. 485 486 7. References to array elements and structure fields are 487 supported, e.g., &A[3], &s.foo. 488 489 8. An exception may be rethrown by calling "throw" without any 490 arguments: 491 492 try { something (); } 493 catch AnyError: { do_this (); throw; } 494 495New Intrinsic Functions: 496------------------------ 497 498 wherenot(x) : 499 Equivalent to where (not(x)) 500 501 _$(str) : 502 Evaluates strings with embedded "dollar" variables, e.g., 503 _$("$TERM"); 504 505 __push_list/__pop_list : 506 Push list items onto the stack 507 508 prod(x) : 509 Computes the product of an array a[0]*a[1]*... 510 511 minabs(x), maxabs(x): 512 Equivalent to min(abs(x)) and max(abs(x)) 513 514 getpgrp,setgid, getpgid: 515 Get and set the process group (Unix) 516 setsid : 517 Create a new session 518 519API News 520======== 521 522 Although not new I feel that this point should be stressed now 523 because it was not emphasized earlier: The SLarray_* functions that 524 deal with indices or sizes use `SLindex_Type' instead of `int'. 525 Currently, `SLindex_Type' is typedefed to be an `int', but this will 526 change in a future version. So for future compatibility, use 527 `SLindex_Type' instead of `int' in functions that deal with slang 528 arrays. Similarly, instead of using SLang_pop_int for obtaining an 529 array index, use SLang_pop_array_index. See the array-specific 530 examples in the documentation for more information. 531 532 There have been significant enhancements to the slang readline 533 interface. The interface has been opened up to the interpreter 534 allowing for such features as completion and a persistent history 535 mechanism. Applications wishing to take advantage of these features 536 should use the new function `SLrline_open2' instead of 537 `SLrline_open'. For an example, see how this function is used in 538 slsh/src/readline.c. 539 540 SLclass_patch_intrin_fun_table was added to facilitiate the patching 541 of intrinsic tables during runtime. If you have created dynamically 542 loaded modules, then you may have a good idea what this function is 543 for. 544 545 The SLang_Traceback variable is now interpreted as a bitmapped 546 integer providing greater flexibility and control over traceback 547 messages. 548 549 SLerr_throw was added to permit applications to mimic the semantics 550 of the `throw' statement. 551 552 SLang_verror_va was added to support calling the error routines with 553 a va_list argument. 554 555slsh enhancements 556================= 557 558 When configured to use slang's readline routines, new features 559 include filename completion and persistent history. 560 561 The profiler was rewritten to be much more friendly, flexible, and 562 more accurate. 563 564 struct_filter and struct_combine defined in structfuns.sl have been 565 made more flxible. See their documentation for more information. 566 567 A new function called readascii may be used for reading 568 non-binary (or so-called "ascii") data files. 569 570New modules 571=========== 572 573 The following modules have been added: 574 575 iconv: Performs character-set conversion using the iconv library. 576 onig: A regular expression module using oniguruma RE library. 577 rand: A random number module 578 579