Many of the improvements and additions in version 9.0 come from ideas and requests by the community using newLISP. Many thanks to everybody involved! In spite of many new features and additions, newLISP has grown only by about 4-6% (depending on the platform) from version 8.9 to version 9.0. This release adds functionality and improvements in the following three areas:
All integer calculations using the integer operators +,-,*,/ and bit operations using >>,<<,~,^ are now performed using 64-bit integers. File positioning on files opened with open are now full 64 bit. Functions like dotimes, for, sequence and factor can now operate on a wider range of integers.
The functions append, first, last, rest, slice previously only working on lists now can also work on arrays. The matrix operations multiply, invert and transpose now also work on arrays.
The newLISP server mode started with newlisp -c -d <port> or the UNIX utilities inetd and xinetd and newlisp -c now can answer simple HTTP GET and PUT requests. The functions read-file, write-file, append-file, load and save now have a HTTP mode where a URL can be given for a file name. This way these functions can be used to access files on remote server nodes in a distributed computing environment.
New or changed functionality |
Description |
version |
newlisp -c, |
Command line modes with the -c option now understand simple HTTP GET and PUT requests. This means that get-url and put-url can be used on newLISP server nodes started with these command line options. |
8.9.1 |
load, |
Now can load and save newLISP code and data from and to remote newLISP or other httpd servers specifying URLs in the file specification. Not yet available for Win32 server nodes. |
8.9.1 |
find-all |
finds all regex-patterns in a string and returns a list of
matching strings: |
8.9.2 |
format |
Parameters after the format string can now also be given as a
list: |
|
define, |
Function and macro definitions can now take defaults for
parameters: |
8.9.3 |
newlisp -C |
The new mode with -C (capital C) forces the command line prompt in Editors like Emacs which communicate to other LISPs via pipes. |
8.9.4 |
starts-with, |
These functions now can take regular expressions when
specifying an options number. The old nil
option for case insensitivity is translated into the regex option
1 for compatibility with older code. The nil
option will be eliminated in the future. |
8.9.4 |
<<, >> |
(<< num) works like (<< num 1) and (>> num) works like (>> num 1) |
8.9.4 |
div |
(div num) works like (div 1 num) |
8.9.4 |
uuid |
Type 1 and type 4 Universal Unique ID as of RFC 4122 specification can now be created |
8.9.6 |
+,-,/,*,<<,>>,~ |
All arithmetic and bit operations on integers are now
64-bit. In float->integer conversions floats out of range oveflow to 64-bit min/max integers: -9223372036854775808, 9223372036854775807 and 18446744073709551615 for unsigned |
8.9.7 |
format |
The format function has new 64-bit formats, these are different on UNIX, Win32 and Tru64: "%lld", "%llu"
"%llx" ; on UNIX |
8.9.7 |
LFS |
Large file system support (LFS) has been extended to 64 bits (before 48 bits). |
8.9.7 |
(for |
Has floating point type in <var> only if <step> is specified, else <var> is integer. Formerly <var> was always floating point type. |
8.9.7 |
(sequence <from> <to> <step>) |
Produces floating point numbers only when <step> is specified, else generates integer type numbers, before always floats. |
8.9.7 |
(dotimes (i N)...) |
Always produces integers in i, before floats. |
8.9.7 |
net-close |
When using with optional true parameter (net-close sock true) shutdown() functionality is suppressed before the socket close. Without the extra parameter net-close always will shutdown without waiting for pending transmissions. |
8.9.7 |
gcd |
New function for greatest common divisor of a group of numbers: (gcd x y ...) |
8.9.7 |
pow |
(pow x) now defaults to (pow x 2) |
8.9.7 |
read-file, |
Now can take URLs for the file specifications. Internally they use the functions get-url and put-url to access files via remote newLISP server nodes or other remote httpd servers. Not yet available on Win32 newLISP server nodes. |
8.9.8 |
net-eval |
Now also evaluates node parameters inside the node list.
Before, constants where required for host name, port and command
string to evaluate. |
8.9.8 |
share |
On UNIX a shared memory address obtained with share
can now be unmapped using: |
8.9.8 |
invert, |
Matrix operations now can be performed on the array data type. |
8.9.9 |
det |
The new function det returns the determinant of a matrix. |
8.9.9 |
append, |
These list operations and their implicit indexing forms now also can be performed on arrays. |
8.9.10 |
local |
Works like let but initializes parameters to nil: (local (x y z) ...) |
8.9.13 |
swap |
This function has an additional syntax to swap the contents of two variables/symbols. |
8.9.14 |
“...” |
Additionally to specifying characters in a quoted string with a decimal code, a hex code can be used, i.e.: “AB+” equivalent to decimal “\065\066\043” equivalent to hex “\x41\x42\x2b”. |
8.9.15 |
ref-all |
Works similar to ref but returns a list of index vectors for all references of an expression (ref-all 'a '(a b c (d a f (a
h a)) (k a (m n a) (x)))) |
8.9.15 |
Added Files and Other Changes |
|
|
newlispdoc |
This newLISP documentation utility parses specially commented newLISP source files to generate autmatically HTML formatted documentation. |
|
Code Patterns in newLISP |
This is the renamed "Design Patterns in newLIS"P document reworked for version 9.0 and with an additional chapter for distributed computing. |
|
Bug Fixes |
|
|
rand |
In list mode returned one element too much. |
8.9.1 |
zero? |
Was broken for floats with fractional parts |
8.9.1 |
read-key |
Did not work on SUSE Linux |
8.9.2 |
set-nth, |
Using these functions an empty lists could corrupt the empty list. |
8.9.5 |
replace-assoc |
when replacing the first element in an association list with replace-assoc and an error occurred when evaluating the replacement expression, a segfault occurred. |
8.9.7 |
timer |
(timer even 0) did not stop the timer on Win32 |
8.9.10 |
join |
On wrong data type (list of strings required) would go in infinite loop, now gives error message. |
8.9.15 |
The versions newLISP 8.9.1 to newLISP 8.8.14 where released as development versions.
Most users have reported very little problems when moving from 32-bit to 64-bit arithmetic in newLISP. Most code will run without any changes necessary. In any case the following points should be reviewed in existing code:
All operations involving integer arithmetic should be reviewed as they have changed from 32-but t0 64-but precision. The data type in loop variables in dotimes and for and the data type of numbers generated in sequence have changed. In all casesi, only when a step size is specified, the data type is float, else 64-bit integers are generated. These changes are consistent with inc and dec, which always behaved this way.
When float to integer conversion takes place, as required by some functions, then the oveflow values are now 64-bit integers instead of 32-bit integers, this may cause different results in some cases.
The functions starts-with and ends-with, when used with the nil option, will now take take the nil as option number 1 for case insensitivity. This also means, that key strings are interpreted as regular expressions patterns rather than raw strings, when using the old nil option. The old nil option should be replaced with the option number 1 and key strings should be reviewed for characters interpreted different in regex patterns.
§