newLISPtm v.8.8.0 Release Notes February 20th, 2006

Highlights

This release improves in the Internet area with more control in functions get-url and post-url. A new function net-ping, offers a batch-ping mode to ping multiple hosts quickly. New base-train and bayes-query can be used to perform fast Bayesian training and analysis like text classification with only two statements. The function parse got a big speed improvement when used on large text files. Large file support up to 999 terabytes.
Programming with contexts is more intuitive to use after a complete rework.
Additional options have been added to existing functions and various bugs have been fixed.
This is a mayor release prompting potential source code changes wherever the functions context, eval-string, load, net-eval and sym are used. See the paragraph at the bottom of these release notes for details.


New or changed functionality

Description

version

net-ping

For this new function newLISP must run in superuser mode or using the Unix sudo command. The function contains a batch-mode and can use wild card characters to send ICMP packets quickly over one socket. This function is not available on Win32.

v.8.7.2

dup

Now can take an optional true flag to force list returns on string elements instead of string concatenation.

v.8.7.2

get-url

A “list” flag permits capturing both, the HTTP header and HTML content of a page in a list.

v.8.7.3

Get-url, post-url, put-url

In all three functions custom request-header options can be specified for cookies, user-agents and other options part of the HTTP request protocol.

v.8.7.3

context

Has expanded functionality to create and set symbols. Using the new functionality of context is more convenient in many situations than using the sym function.

v.8.7.4

context?

An expanded form of this function can be used to check for the existence of symbols.

v.8.7.4

time

takes an additional parameter for the number of times the expression should be evaluated for timing.

v.8.7.4

console mode

The terminating character from an expression returned in the console has been changed from a space to a line feed. This change may effect GUI front ends or other programs interfacing with newLISP via standard I/O.

v.8.7.4

process

On UNIX this function can take an additional pipe handle to specify a channel for standard error. By default std-error is redirected to std-out.

v.8.7.5

directory

Now can take and additional regular expression pattern to filter files.

v.8.7.7

number?

This new function tests if an expression evaluates to an integer or float.

v.8.7.7

apply

Now can be used on parameter lists of unlimited length. Previously apply was limited by newLISP's internal stack.

v.8.7.8

bayes-train, bayes-query

These new functions facilitate Bayesian probabilistic training and analysis. Both: Chain Bayesian and Fishers Chi2 modes of compounding probabilities are supported.

v.8.7.7-8

context

Calling into a context now changes the current runtime context to the context the target function was written in. See paragraph at the bottom of this page for a more detailed discussion of these changes.

v.8.7.8

load

This function now will never change the current runtime context, regardless what of context switches inside the loaded file. If no context switch is specified in the loaded file or as an additional parameter in load, it will be loaded/compiled into the MAIN context.

v.8.7.9

v.8.8.0-p2

log

Can specify an additional parameter for the log-base. By default log works as a natural log.

v.8.7.9

parse

Has a big speedup on large file when using regular expressions. Now the function scales linearly allowing big text files to be tokenized in one statement.

v.8.7.9

eval-string

Can now specify the context under which the string should be evaluated.

v.8.7.9

find, replace, search

Now can handle binary text and files containing 0 (zero) characters in both, regular expression and non-regular expression modes. Key, patterns, string buffer and replacement strings can all contain zero characters.

v.8.7.10

string

Has been speed optimized when handling arguments which are strings already.

v.8.7.11

reset

Adds an additional parameter for restarting newLISP with same command line parameters with fresh memory in a new process space.

v.8.7.11

seek

File positions can be given in floats for up to 999999999999999.0 (999 terabytes)

v.88.0-p3

Bug fixes



time

No safe when crossing midnight

v.8.7.2

Sys-error

Was reset after readline() always

v.8.7.2

transpose

Crashed on empty lists

v.8.7.2

case

Did not handle default clause correctly when assembled from evaluated true

v.8.7.6

parse

When ending with \ (backslash) had the potential to overrun end of string.

v.8.7.6

get-url

Memory error fix for chunked pages

v.8.7.7

trim

Was worked destructive in UTF-8 version.

v.8.7.10

net-eval

Text buffers returned with more than 2048 characters and containing zero characters where throwing a “string too long” error.

v.8.8.0-p1


The versions newLISP 8.7.2 to newLISP 8.7.11 where released as development versions.


Context behavior changes

Calling into a context now changes the current run-time context:

(context 'FOO)
(define (foo) (context))
(context MAIN)

(FOO:foo) => MAIN ; old behavior
(FOO:foo) => FOO ; new behavior

The new behavior is more intuitive and most programmers expect it. Only applications using eval-string or sym (w/o specifying a context) and very few usages of net-eval (containing symbols in results) are affected. From all applications published by newlisp.org (blog, wiki, ide) only the file cgi.lsp packaged with these applications is affected and should be changed to the new cgi.lsp v.1.9.

Users should check all applications using eval-string and sym (or the deprecated symbol). Before eval-string and sym worked with the runtime context being MAIN, the context where the program was started. Now both functions work with the context they are part of:

context 'FOO)

(set 'x 999)
(define (foo s) (eval-string s))

(define (bar s) (eval (sym s)))

(context MAIN)

(set 'x 123)

(FOO:foo "x") => 123 ; old behavior
(FOO:bar "x") => 123 ; old behavior

(FOO:foo "x") => 999 ; new behavior
(FOO:bar "x") => 999 ; new behavior

New versions of code should specify the context under which eval-string evaluates its string in an additional parameter.

Changes to old source code

Replace the file cgi.lsp in newlisp-ide, newlisp-blog and newlisp-wiki applications. The replacement will also work with newLISP versions previous to 8.7.8.

Change old applications by preceding the eval-string statement with (context MAIN) or other required context change. Most of the time it's MAIN, the context where the whole program was started.

Change old applications adding explicitly the desired context in sym as a second parameter, i.e. (sym s 'MAIN) or (sym s ctx) where ctx is a context variable.

The new behavior is more intuitive and will make OO based programming based with contexts easier, it also increases isolation of contexts because the current run-time context is not dependent from where the program was started originally, but only on the situation internal to that context.

Changes in the load function behavior

load will never cause the runtime context changed, but the same run-time context that was valid before the call to 'load' will be valid when load returns.

load switches to context MAIN when loading file except if different context is specified in file, on return 'load' switches back to caller context. If loaded code does not have a context switch but should be loaded into the current context do:

(load “myfile” (current))
; or
(load “myfile” 'MyCTX)

To load into a specific context.

Like changes in context behavior, the changes in load emphasize isolation of contexts loaded and make the behavior of code in the file loaded independent of the loading context.

Most older code forced the new behavior described already and code changes are usually not necessary.

+++