Changes between Version 15 and Version 16 of JavaFfi


Ignore:
Timestamp:
07/25/14 21:00:43 (7 years ago)
Author:
Robert Goldman
Comment:

Added docs for JCOERCE.

Legend:

Unmodified
Added
Removed
Modified
  • JavaFfi

    v15 v16  
    219219
    220220`(jconstructor "java.util.LinkedList" "java.util.Collection") => #<java.lang.reflect.Constructor public java.util.LinkedList(java... {35EE49}>`
     221
     222=== Function JCOERCE ===
     223
     224''Syntax:'''
     225
     226'''jcoerce''' ''value intended-class''
     227
     228'''Arguments and Values:'''
     229
     230`value` -- an arbitrary Common Lisp data item
     231
     232`intended-class` -- string naming a kind of `java-object`
     233
     234'''Description:'''
     235
     236Returns `java-object` of the appropriate type, if it can.  Otherwise raises a `TYPE-ERROR`.  A primary purpose of this function is to translate lisp data items into Java primitives so that Java methods with primitive type arguments can be used.
     237
     238'''Examples:'''
     239
     240`(jcoerce 1.0d0 "double") => #<java.lang.Double 1.0 {13424219}>`
     241
     242` (multiple-value-list (ignore-errors (jcoerce 1.0d0 "int"))) => (NIL #<TYPE-ERROR {236312F7}>)`
    221243
    222244