newLISP 10.6.1 开发版发布了,此版本现已提供下载,主要就是 Bug 修复,同时还添加几个小方法,兼容 newLISP 10.6.0 版本。
新功能和改进
A new function (collect exp) reapeatedly evaluates exp and collects results in a list until evaluation yields nil.
Some PCRE regular expression options can now be given as either numbers or letters. Multiple letter optiosn can be combined in a string. This affects all functions using regular expressions. See the regexfunction for details.
The regex function now gives offset and length in number of UTF-8 characters when PCRE UTF8 option2048 or "u" is specified.
A second syntax pattern for copy allows copying a newLISP cell from a memory address. This is useful when interfacing with C-language code.
The get-string function now takes one or two additional optional parameters for two new syntax patterns. The new patterns allow creating string buffers from memory address locations limited by size or a limit string. Using special limit strings, UTF16 and UTF32 strings of unknown size can be copied. This is useful when interfacing with C-language code.
The macro? predicate now also can be used on symbols to test if a symbol was created using the macrofunction.
A wrong UDP option in net-connect or net-listen will now throw an error message. Previously wrong UDP options were ignored.
Bug 修复
rotate on a (copy str) expression corrupted memory.
The flt function now returns an unsigned integer on all platforms. Previusly on 32-bit versions a signed integer was returned.
The crc32 function will not sign-extend on 32-bit newLISP.
The protected? function did not recognize macro symbols as protected.
newLISP是一个类似Lisp语言的、用于一般用途的脚本语言。它具有 LISP 语言所有的魔力,但更容易学习和使用。 newLISP是友好的,快速和简小的。大部分您需要的功能都将已经内置。
下面是一段示例代码:
(command-event (fn (s)
(local (request)
(if (find "?" s) ; is this a query
(begin
(set 'request (first (parse s "?")))
; discover illegal extension in queries
(if (ends-with request ".exe")
(set 'request "GET /errorpage.html")
(set 'request s)))
(set 'request s))
request)
))