All Manuals > Release Notes and Installation Guide > 12 Release Notes

12.7 More new features

For details of these, see the documentation in the LispWorks® User Guide and Reference Manual, unless a manual is referenced explicitly.

12.7.1 Package-local nicknames

LispWorks now supports package-local nicknames, with the same interface as other Common Lisp implementations. This includes the new functions hcl:add-package-local-nickname, hcl:package-local-nicknames, hcl:package-locally-nicknamed-by-list, hcl:remove-package-local-nickname and the defpackage option :local-nicknames.

12.7.2 Support for pinning objects while in foreign code

The new macro hcl:with-pinned-objects can be used to prevent certain types of object from being moved by the garbage collector while in foreign code.

The value of the allocation keyword argument to cl:make-array can be :pinnable to make an array that can be pinned using hcl:with-pinned-objects.

The function system:make-typed-aref-vector takes a new keyword argument allocation which gives you control of where the new vector is allocated.

12.7.3 Specialized complex number array representations

LispWorks now supports a specialized array representation for (complex single-float) and (complex double-float).

12.7.4 Double-float complex number optimization in the compiler

The compiler now optimizes arithmetic for values of type (complex double-float).

12.7.5 The console now supports external formats on non-Windows platforms

Characters read and written via the console (*terminal-io*) are now encoded in an external format that is determined by the operating environment. See 27.16 The console external format in the LispWorks® User Guide and Reference Manual.

The new function hcl:set-console-external-format can be used to override this.

12.7.6 Encoding file names on non-Windows platforms based on locale

LispWorks now checks the POSIX locale variables to determine the external format in which file names should be encoded. See 27.14.1 Encoding of file names and strings in OS interface functions in the LispWorks® User Guide and Reference Manual for details.

12.7.7 Operating system interfaces on non-Windows based on locale

The values in the function lispworks:environment-variable and the command line arguments and environment variables in the functions system:call-system, system:call-system-showing-output, system:open-pipe and system:run-shell-command are now encoded using the same external format as file names, as described in 27.14.1 Encoding of file names and strings in OS interface functions in the LispWorks® User Guide and Reference Manual.

The command line arguments of LispWorks (see 27.4 The Command Line in the LispWorks® User Guide and Reference Manual) are decoded using the same external format.

This change should not affect arguments and values that contain only ASCII characters.

12.7.8 system:open-pipe and system:run-shell-command work with external formats

The functions system:open-pipe and system:run-shell-command have a new keyword argument, external-format, which is the external format to use. On non-Windows platforms, when neither the external-format nor the element-type are supplied, the external format defaults to the format specified by the POSIX environemnt variables LC_ALL, LC_CTYPE or LANG. If you use system:open-pipe in previous versions of LispWorks without supplying element-type and you want it to continue to not process the data using an external format, then supply element-type with base-char if you want code to work on all versions of LispWorks.

12.7.9 Specifying a timeout for system:pipe-exit-status

The function system:pipe-exit-status has a new keyword argument, timeout, which gives the maximum time to wait for the exit status. This overrides the wait argument, which is deprecated now.

12.7.10 system:run-shell-command can now return a signal number

On non-Windows platforms, the function system:run-shell-command with non-nil value for wait now returns a second value indicating the signal number that terminated the command if any.

12.7.11 Support for the GB18030 character encoding

LispWorks now supports the GB18030 character encoding with by the :gb18030 external-format. See 26.6 External Formats to translate Lisp characters from/to external encodings in the LispWorks® User Guide and Reference Manual.

12.7.12 Configurable named services for remote debugging

The ports used for remote debugging can now be controlled by registering named service. See 3.7.6 TCP port usage in remote debugging in the LispWorks® User Guide and Reference Manual for more details.

12.7.13 Error handling and callbacks when starting remote debugging

The functions dbg:start-ide-remote-debugging-server and dbg:start-client-remote-debugging-server now have keyword arguments announce and error like comm:start-up-server.

The function dbg:start-ide-remote-debugging-server also has a connection-callback which is called with arguments to indicate if the connection was successful.

12.7.14 Using SSL for remote debugging

The functions dbg:ide-connect-remote-debugging, dbg:start-ide-remote-debugging-server, dbg:configure-remote-debugging-spec and dbg:start-client-remote-debugging-server and the macro dbg:with-remote-debugging-spec now have a :ssl keyword that allows SSL to be used for remote debugging connections.

12.7.15 Using IPv6 for remote debugging

The functions dbg:ide-connect-remote-debugging, dbg:start-ide-remote-debugging-server, dbg:configure-remote-debugging-spec and dbg:start-client-remote-debugging-server and the macro dbg:with-remote-debugging-spec now have a :ipv6 keyword that allows IPv6 to be used for remote debugging connections.

12.7.16 Identifying object allocation in the profiler

The new function hcl:profiler-tree-to-allocation-functions prints a tree of function calls where the roots are allocation functions, making it easier to see where allocation happens.

12.7.17 Ignoring time in the garbage collector during profiling

The gc argument to the function hcl:set-up-profiler has new value :exclude which causes the profiler to ignore samples that are taken GC operation is in progress.

12.7.18 Version checking in compile-file-if-needed

hcl:compile-file-if-needed now checks that the version of the fasl file matches the version of the image and recompile if it does not match.

12.7.19 OpenSSL version defaults to 1.1 on Windows

The default OpenSSL DLL names in LispWorks for Windows are now those from OpenSSL 1.1.

12.7.20 Support for SSL using Apple Security Framework

LispWorks now supports (and defaults to) using the Apple Security Framework to implement SSL on macOS and iOS.

To allow the choice of SSL implementation to be made at run time and to allow code to specify configuration options that work with either implementation, a new concept called SSL Abtract Contexts has been added. The new system class comm:ssl-abstract-context represents these contexts, which can be created by the new functions comm:create-ssl-server-context and comm:create-ssl-client-context. The new function reset-ssl-abstract-context can be used to clear any cached information in a comm:ssl-abstract-context.

The new accessor comm:ssl-default-implementation can be used to control which SSL implementation is used and the new function comm:ssl-implementation-available-p can be used to check if an implementation is available.

The function comm:ensure-ssl can been extended to take an :implementation keyword, which specifies the implementation to initialize.

The functions comm:open-tcp-stream, comm:attach-ssl, comm:create-async-io-state-and-connected-tcp-socket, comm:socket-stream and comm:accept-tcp-connections-creating-async-io-states have been extended to take a comm:ssl-abstract-context as the :ssl-ctx argument.

The new FLI type comm:ssl-context-ref represents Apple Security Framework contexts.

The function comm:set-verification-mode has been extended to take a comm:ssl-context-ref as the ssl-ctx argument.

12.7.21 Specifying and accessing SSL certificates

The new function comm:ssl-connection-read-certificates specifies certificates for a SSL conection (a comm:socket-stream or a comm:async-io-state) by reading them from a file.

The new function comm:ssl-connection-get-peer-certificates-data can be used to get data about the certificate from a SSL connection.

The new functions comm:ssl-connection-copy-peer-certificates, comm:release-certificates-vector, comm:release-certificate, comm:get-certificate-data, comm:get-certificate-common-name and comm:get-certificate-serial-number can be used by experts to access certificates directly. These certificates are foreign pointers of type comm:sec-certificate-ref in the Apple Security Framework and comm:x509-pointer in OpenSSL.

12.7.22 SSL certificate generalized time API

The new type comm:generalized-time and new functions comm:generalized-time-p, comm:make-generalized-time, comm:generalized-time-pprint, comm:generalized-time-string and comm:parse-printed-generalized-time can be used to manipulate generalized times, as used in SSL certificates.

12.7.23 Reading DH parameters from a file

The new function comm:ssl-connection-read-dh-params-file reads a DH parameters file.

12.7.24 Detecting the SSL protocol version

The new function comm:ssl-connection-protocol-version returns the SSL protocol version that is being used by a connection.

12.7.25 comm:open-tcp-stream now returns information about errors

When the function comm:open-tcp-stream returns nil due to an error making the TCP connection, it now also returns a second value, which is a condition that gives information about the error.

12.7.26 Listen on the same port with more than one socket

The functions comm:start-up-server and comm:accept-tcp-connections-creating-async-io-states have a new keyword reuseport, which allows you to listen on the same port by multiple sockets, by using the socket option SO_REUSEPORT.

12.7.27 New function to close a socket handle

The new function comm:close-socket-handle can be used to close a native socket handle.

12.7.28 Newly documented customization for socket I/O error signaling

The function comm:socket-error existed in previous versions of LispWorks but is now documented. You can implement methods specialized on your own subclasses comm:socket-stream to customize signalling for socket I/O errors.

12.7.29 New condition classes in the socket interface

Errors relating to certain problems when using sockets are now signaled with the new condition classes comm:socket-io-error, comm:socket-create-error, comm:ssl-verification-failure and comm:ssl-handshake-timeout.

12.7.30 New condition classes in the Java interface

The Java interface can now signal two new condition classes lw-ji:jobject-call-method-error and lw-ji:java-program-error.

12.7.31 Calling static or non-static methods in the Java interface

The new function lw-ji:jobject-call-method can be used to call a non-static Java method and the new function lw-ji:call-java-static-method can be used to call a static Java method. These functions are useful when a static and non-static method with the same name exist in a class, because lw-ji:call-java-method (which also calls the non-static method in this case) would be ambiguous.

The macro lw-ji:define-java-caller and the function lw-ji:setup-java-caller have a new keyword argument static-p that controls the same thing.

12.7.32 Making a non-virtual call to a method in the Java interface

The macro lw-ji:define-java-caller and the function lw-ji:setup-java-caller have a new keyword argument non-virtual-p that makes the call non-virtual. Note that this is not normal Java behaviour, and may lead to surprising effects.

The new function lw-ji:call-java-non-virtual-method can also be used for this.

12.7.33 lw-ji:define-java-caller and lw-ji:setup-java-caller can now return lw-ji:jobject

The macro lw-ji:define-java-caller and the function lw-ji:setup-java-caller have a new keyword argument return-jobject that controls whether to return a Lisp object or a lw-ji:jobject when the method signature return value type is java.lang.String or java.lang.Object.

12.7.34 Specifying a Java class loader for Lisp proxy objects

The functions lw-ji:make-lisp-proxy and lw-ji:make-lisp-proxy-with-overrides have a new keyword argument class-loader to override the ClassLoader to pass as the first argument to the Java method Proxy.newProxyInstance when making the Lisp proxy.

12.7.35 Access to JNI jvalue objects

The new FLI type descriptor lw-ji:jvalue corresponds to the JNI C type jvalue. The new functions lw-ji:jvalue-store-jboolean, lw-ji:jvalue-store-jbyte, lw-ji:jvalue-store-jchar, lw-ji:jvalue-store-jshort, lw-ji:jvalue-store-jint, lw-ji:jvalue-store-jlong, lw-ji:jvalue-store-jfloat, lw-ji:jvalue-store-jdouble and lw-ji:jvalue-store-jobject can be used to set values in a lw-ji:jvalue. In typical usage of the Java interface, you will not need to use lw-ji:jvalue at all.

12.7.36 Getting a backtrace from a Java throwable object

The new function lw-ji:get-throwable-backtrace-strings can be used to get the backtrace from a Java throwable object.

12.7.37 lw-ji:create-instance-jobject-list is now exported from lw-ji

The function lw-ji:create-instance-jobject-list that was documented in previous releases is now exported from the lw-ji package. It was missing due to a bug.

12.7.38 Controlling aspects of LispWorks initialization on Android

The new Java methods com.lispworks.Manager.setRuntimeLispHeapDir, com.lispworks.Manager.setLispTempDir and com.lispworks.Manager.setClassLoader can be used to control aspects of how LispWorks initializes on Android. You should consult LispWorks support if you believe you need to use these.

12.7.39 New error codes from the InitLispWorks C function

The C function InitLispWorks has two new error codes, -1408 and -1409.

12.7.40 Stricter meaning of the :link-transparency argument to cl:directory

In LispWorks 8.0 and newer, if the file-namestring of its pathname argument is a symbolic link pointing to a directory and its link-transparency argument is nil, then directory returns it as a file. In previous versions of LispWorks, it was returned as a directory. Calling file-directory-p on such a link still returns true, so if you need to check if it is a directory or not, then you need to check first. The simplest way is to check that file-namestring returns nil.

12.7.41 Checking whether a file is a symbolic link

The new function hcl:file-link-p can be used to check whether a file is a symbolic link.

12.7.42 Reading a file into an array of bytes

The new function hcl:file-binary-bytes can be used to create an array of bytes from the contents a file.

12.7.43 cl:read-sequence and cl:write-sequence now depend on cl:stream-element-type

The Common Lisp function cl:read-sequence and cl:write-sequence now use cl:stream-element-type to detect character and binary streams. Prior to LispWorks 8.0, there was specialized behaviour for fundamental-character-output-stream and fundamental-binary-output-stream that was used to choose between character and binary I/O.

12.7.44 Specializing cl:read-sequence and cl:write-sequence is now documented

The stream:stream-read-sequence and stream:stream-write-sequence are now documented as the methods called by cl:read-sequence and cl:write-sequence respectively. These methods existed prior to LispWorks 8.0 but were not documented and the supplied methods have changed as described in 12.7.43 cl:read-sequence and cl:write-sequence now depend on cl:stream-element-type.

12.7.45 New functions to compare strings without checking the length

The new function hcl:string=-limited and hcl:string-equal-limited simplify comparison of strings where you do not know the length of them.

12.7.46 Newly documented macro if-let

The macro lispworks:if-let if like cl:if but also binds a variable to the value of the test form. It is newly documented in LispWorks 8.0, but has been available since LispWorks 6.0.

12.7.47 Scheduling a repeating timer relative to the current time

If one of the functions mp:schedule-timer, mp:schedule-timer-relative, mp:schedule-timer-milliseconds and mp:schedule-timer-relative-milliseconds is called with a timer that is not scheduled or has already expired and the absolute-expiration-time or relative-expiration-time argument is nil and the repeat-time argument is non-nil, then the timer is scheduled to the current time plus repeat-time. In previous versions, this would have signaled an error.

12.7.48 hcl:get-temp-directory no longer returns a truename

The function hcl:get-temp-directory now returns a pathname with the name and type components set to nil. In previous releases, it returned a truename, with these components set to :unspecific.

12.7.49 Source location for macros that group other definition

The macro dspec:define-form-parser can now be used to define a form parser for a macro that acts like an implicit progn. Such macros (for example, eval-when) are used in a source file to wrap other definitions in the file, but do not have a name themselves.

12.7.50 The precompiled-regexp system class

The system class lispworks:precompiled-regexp and its predicate lispworks:precompiled-regexp-p have been added.

Instances of lispworks:precompiled-regexp represent a precompiled regular expression. They are produced by the function lispworks:precompile-regexp, and are used by the functions lispworks:find-regexp-in-string, lispworks:regexp-find-symbols, lispworks:count-regexp-occurrences and editor:regular-expression-search.

12.7.51 "Lax whitespace" regexp searching

The functions lispworks:find-regexp-in-string, lispworks:count-regexp-occurrences and lispworks:precompile-regexp takes a new keyword argument space-string.

When space-string is non-nil, then a "Lax whitespace" search is performed. That means that any sequence of space characters in the pattern are effectively replaced by the regexp specified by space-string. See the documentation for lispworks:find-regexp-in-string for more details.

12.7.52 New arguments to the parser function defined by defparser

The parser function defined by parsergen:defparser now takes two keyword arguments:

See 21.3 Functions defined by defparser in the LispWorks® User Guide and Reference Manual for details.

12.7.53 New system class gesture-spec

The new system class system:gesture-spec has been added. The concept of gesture specs existed prior to LispWorks 8.0, but system:gesture-spec was an internal undocumented symbol.

12.7.54 Limiting the number of splits in split-sequence

The functions lispworks:split-sequence, lispworks:split-sequence-if and lispworks:split-sequence-if-not have a new :count keyword which limits the number of times that the sequence is split.

12.7.55 Writing messages to system log files

The new functions hcl:write-to-system-log and hcl:format-to-system-log can be used to write messages to the operating system log files.


Release Notes and Installation Guide - 01 Dec 2021 19:38:49