Function | Package: net.jlinker | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## jnew

Arguments: class-ref &rest args

This function calls a Java constructor with the given arguments.

If the first (class-ref) argument is a string, a symbol or a class reference, we look for a constructor with the number of arguments given. If a unique constructor can be selected, then that constructor is called. Otherwise a continuable error is signaled to allow an appropriate constructor to be selected.

Otherwise, the class-ref argument is assumed to be a constructor reference. The constructor is called with the given arguments.

The value returned by calling any constructor is always a remote reference. This is the case even for `java.lang.String` instances which are normally represented by their Lisp equivalent. The following call may be used to extract the string representation of a String instance:

    (jcall "concat" x "")

The compiler macro associated with the function allows compile-time collection of java class names and method signatures. This information is used to generate a file of class and method definitions that may be loaded to initialize an application, and avoid the class and method lookup overhead in the body of the application (see jlookup).

See jlinker.htm for more information on the jLinker facility.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version