From eweitz at common-lisp.net Thu Aug 10 15:36:48 2006 From: eweitz at common-lisp.net (eweitz) Date: Thu, 10 Aug 2006 11:36:48 -0400 (EDT) Subject: [rdnzl-cvs] CVS RDNZL Message-ID: <20060810153648.2B45F3D003@common-lisp.net> Update of /project/rdnzl/cvsroot/RDNZL In directory clnet:/tmp/cvs-serv18676 Modified Files: CHANGELOG.txt adapter.lisp arrays.lisp container.lisp direct.lisp ffi.lisp import.lisp load.lisp packages.lisp port-acl.lisp port-ccl.lisp port-clisp.lisp port-ecl.lisp port-lw.lisp port-sbcl.lisp rdnzl.asd reader.lisp specials.lisp util.lisp Log Message: Sync with 10.1.2 --- /project/rdnzl/cvsroot/RDNZL/CHANGELOG.txt 2006/06/12 08:47:10 1.9 +++ /project/rdnzl/cvsroot/RDNZL/CHANGELOG.txt 2006/08/10 15:36:47 1.10 @@ -1,3 +1,11 @@ +Version 0.10.2 +2006-08-10 +More DSPEC definitions for LispWorks + +Version 0.10.1 +2006-08-10 +DSPEC definitions for LispWorks + Version 0.10.0 2006-06-12 ECL port (provided by Michael Goffioul) --- /project/rdnzl/cvsroot/RDNZL/adapter.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/adapter.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/adapter.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/adapter.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/arrays.lisp 2006/06/12 08:47:10 1.6 +++ /project/rdnzl/cvsroot/RDNZL/arrays.lisp 2006/08/10 15:36:47 1.7 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/arrays.lisp,v 1.6 2006/06/12 08:47:10 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/arrays.lisp,v 1.7 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/container.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/container.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/container.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/container.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/direct.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/direct.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/direct.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/direct.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. @@ -186,6 +186,10 @@ (or type-name (second (first args))) (loop for (arg-name nil) in args collect arg-name)))) + #+:lispworks + ;; record location of definition for IDE + (dspec:record-definition '(define-rdnzl-call ,lisp-name) + (dspec:location)) ',lisp-name)) (defun create-direct-call (lisp-name other-args) --- /project/rdnzl/cvsroot/RDNZL/ffi.lisp 2006/02/18 22:26:12 1.6 +++ /project/rdnzl/cvsroot/RDNZL/ffi.lisp 2006/08/10 15:36:47 1.7 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/ffi.lisp,v 1.6 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/ffi.lisp,v 1.7 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. @@ -39,9 +39,7 @@ "Like FFI-DEFINE-FUNCTION* but automatically creates the Lisp name from the C name. A name like \"invokeMethod\" is mapped to \"%INVOKE-METHOD\"." - `(ffi-define-function* (,(intern - (concatenate 'string "%" (mangle-name c-name)) - :rdnzl) + `(ffi-define-function* (,(make-lisp-name c-name) ,c-name) ,arg-list ,result-type)) --- /project/rdnzl/cvsroot/RDNZL/import.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/import.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/import.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/import.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/load.lisp 2006/06/12 08:47:10 1.6 +++ /project/rdnzl/cvsroot/RDNZL/load.lisp 2006/08/10 15:36:47 1.7 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/load.lisp,v 1.6 2006/06/12 08:47:10 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/load.lisp,v 1.7 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/packages.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/packages.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/packages.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/packages.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/port-acl.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/port-acl.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-acl.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-acl.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Charles A. Cox, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/port-ccl.lisp 2006/06/12 08:47:10 1.7 +++ /project/rdnzl/cvsroot/RDNZL/port-ccl.lisp 2006/08/10 15:36:47 1.8 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-ccl.lisp,v 1.7 2006/06/12 08:47:10 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-ccl.lisp,v 1.8 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/port-clisp.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/port-clisp.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-clisp.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-clisp.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Vasilis Margioulas, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/port-ecl.lisp 2006/06/12 08:47:10 1.1 +++ /project/rdnzl/cvsroot/RDNZL/port-ecl.lisp 2006/08/10 15:36:47 1.2 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-ecl.lisp,v 1.1 2006/06/12 08:47:10 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-ecl.lisp,v 1.2 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Vasilis Margioulas, Michael Goffioul, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/port-lw.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/port-lw.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-lw.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-lw.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. @@ -99,14 +99,14 @@ "Defines a Lisp function which can be called from C. ARG-LIST is a list of \(NAME TYPE) pairs. All types are supposed to be symbols mappable by FFI-MAP-TYPE above." -`(fli:define-foreign-callable - (,(symbol-name c-name) :result-type ,(ffi-map-type result-type) - :calling-convention :cdecl) - ,(mapcar (lambda (name-and-type) - (destructuring-bind (name type) name-and-type - (list name (ffi-map-type type)))) - arg-list) - , at body)) + `(fli:define-foreign-callable + (,(symbol-name c-name) :result-type ,(ffi-map-type result-type) + :calling-convention :cdecl) + ,(mapcar (lambda (name-and-type) + (destructuring-bind (name type) name-and-type + (list name (ffi-map-type type)))) + arg-list) + , at body)) (defmacro ffi-get-call-by-ref-string (function object length-function) "Calls the foreign function FUNCTION. FUNCTION is supposed to call @@ -211,3 +211,16 @@ (defun full-gc () "Invokes a full garbage collection." (hcl:mark-and-sweep 3)) + +;; help the LispWorks IDE to find definitions +(dspec:define-form-parser ffi-define-function (c-name) + `(,ffi-define-function ,(make-lisp-name c-name))) + +(dspec:define-dspec-alias ffi-define-function (name) + `(fli:define-foreign-function ,name)) + +(dspec:define-form-parser define-rdnzl-call (name) + `(,define-rdnzl-call ,name)) + +(dspec:define-dspec-alias define-rdnzl-call (name) + `(defun ,name)) --- /project/rdnzl/cvsroot/RDNZL/port-sbcl.lisp 2006/06/12 08:47:10 1.5 +++ /project/rdnzl/cvsroot/RDNZL/port-sbcl.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-sbcl.lisp,v 1.5 2006/06/12 08:47:10 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/port-sbcl.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/rdnzl.asd 2006/06/12 08:47:10 1.8 +++ /project/rdnzl/cvsroot/RDNZL/rdnzl.asd 2006/08/10 15:36:47 1.9 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/rdnzl.asd,v 1.8 2006/06/12 08:47:10 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/rdnzl.asd,v 1.9 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004, Dr. Edmund Weitz. All rights reserved. @@ -39,7 +39,7 @@ (defsystem #:rdnzl :serial t - :version "0.9.5" + :version "0.10.2" :components ((:file "packages") (:file "specials") (:file "util") --- /project/rdnzl/cvsroot/RDNZL/reader.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/reader.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/reader.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/reader.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. --- /project/rdnzl/cvsroot/RDNZL/specials.lisp 2006/02/18 22:26:12 1.5 +++ /project/rdnzl/cvsroot/RDNZL/specials.lisp 2006/08/10 15:36:47 1.6 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/specials.lisp,v 1.5 2006/02/18 22:26:12 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/specials.lisp,v 1.6 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. @@ -95,6 +95,7 @@ ;; stuff for Nikodemus Siivola's HYPERDOC ;; see ;; and +;; also used by LW-ADD-ONS (defvar *hyperdoc-base-uri* "http://weitz.de/rdnzl/") --- /project/rdnzl/cvsroot/RDNZL/util.lisp 2006/05/24 21:49:09 1.6 +++ /project/rdnzl/cvsroot/RDNZL/util.lisp 2006/08/10 15:36:47 1.7 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/util.lisp,v 1.6 2006/05/24 21:49:09 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/util.lisp,v 1.7 2006/08/10 15:36:47 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. @@ -165,6 +165,10 @@ do (write-char #\- out) do (write-char (char-downcase char) out)))))) +(defun make-lisp-name (c-name) + "Makes a Lisp name \(a symbol in the RDNZL package) from a C name." + (intern (concatenate 'string "%" (mangle-name c-name)) :rdnzl)) + (defun unmangle-name* (string) "STRING is assumed to be a string consisting solely of single-case letters and hyphens. This function will return a From eweitz at common-lisp.net Thu Aug 10 15:36:48 2006 From: eweitz at common-lisp.net (eweitz) Date: Thu, 10 Aug 2006 11:36:48 -0400 (EDT) Subject: [rdnzl-cvs] CVS RDNZL/doc Message-ID: <20060810153648.6459C3E002@common-lisp.net> Update of /project/rdnzl/cvsroot/RDNZL/doc In directory clnet:/tmp/cvs-serv18676/doc Modified Files: index.html Log Message: Sync with 10.1.2 --- /project/rdnzl/cvsroot/RDNZL/doc/index.html 2006/06/12 09:45:17 1.10 +++ /project/rdnzl/cvsroot/RDNZL/doc/index.html 2006/08/10 15:36:48 1.11 @@ -372,7 +372,7 @@
 

Download and installation

RDNZL together with this documentation can be downloaded from -http://weitz.de/files/RDNZL.tar.gz, the current version is 0.10.0. It +http://weitz.de/files/RDNZL.tar.gz, the current version is 0.10.2. It doesn't depend on any other Lisp libraries. The C++ source for the shared library RDNZL.dll can be downloaded separately from Visual C++ 2005 (Express Edition) is available from http://weitz.de/files/RDNZL-cpp-0.5-vc8.tar.bz2. +href="http://weitz.de/files/RDNZL-cpp-0.5-vc8.tar.bz2">http://weitz.de/files/RDNZL-cpp-0.5-vc8.tar.bz2.)

Before you load RDNZL make sure you have the .NET framework installed. @@ -1108,7 +1108,7 @@ port. Thanks to Franz Inc. (and particularly Jans Aasman) for supporting the development of RDNZL.

-$Header: /project/rdnzl/cvsroot/RDNZL/doc/index.html,v 1.10 2006/06/12 09:45:17 eweitz Exp $ +$Header: /project/rdnzl/cvsroot/RDNZL/doc/index.html,v 1.11 2006/08/10 15:36:48 eweitz Exp $

BACK TO MY HOMEPAGE From eweitz at common-lisp.net Fri Aug 25 09:45:27 2006 From: eweitz at common-lisp.net (eweitz) Date: Fri, 25 Aug 2006 05:45:27 -0400 (EDT) Subject: [rdnzl-cvs] CVS RDNZL Message-ID: <20060825094527.E287C2E1B6@common-lisp.net> Update of /project/rdnzl/cvsroot/RDNZL In directory clnet:/tmp/cvs-serv12875 Modified Files: arrays.lisp rdnzl.asd Log Message: sync with 0.10.3 --- /project/rdnzl/cvsroot/RDNZL/arrays.lisp 2006/08/10 15:36:47 1.7 +++ /project/rdnzl/cvsroot/RDNZL/arrays.lisp 2006/08/25 09:45:27 1.8 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/arrays.lisp,v 1.7 2006/08/10 15:36:47 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/arrays.lisp,v 1.8 2006/08/25 09:45:27 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. @@ -54,7 +54,8 @@ subscripts SUBSCRIPTS. Similar to AREF." (let* ((element-type [%AssemblyQualifiedName [GetElementType [GetType array]]]) (value (apply #`GetValue array subscripts))) - (unbox (cast* value element-type)))) + ;; VALUE might be NULL pointer, so check for NIL before unboxing + (and value (unbox (cast* value element-type))))) (defun (setf aref*) (new-value array &rest subscripts) "Sets the element of the .NET array ARRAY \(a CONTAINER) with the --- /project/rdnzl/cvsroot/RDNZL/rdnzl.asd 2006/08/10 15:36:47 1.9 +++ /project/rdnzl/cvsroot/RDNZL/rdnzl.asd 2006/08/25 09:45:27 1.10 @@ -1,5 +1,5 @@ ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- -;;; $Header: /project/rdnzl/cvsroot/RDNZL/rdnzl.asd,v 1.9 2006/08/10 15:36:47 eweitz Exp $ +;;; $Header: /project/rdnzl/cvsroot/RDNZL/rdnzl.asd,v 1.10 2006/08/25 09:45:27 eweitz Exp $ ;;; Copyright (c) 2004, Dr. Edmund Weitz. All rights reserved. @@ -29,17 +29,9 @@ ;;; System definition for ASDF - see -(in-package :cl-user) - -(defpackage #:rdnzl.system - (:use #:cl - #:asdf)) - -(in-package #:rdnzl.system) - -(defsystem #:rdnzl +(asdf:defsystem :rdnzl :serial t - :version "0.10.2" + :version "0.10.3" :components ((:file "packages") (:file "specials") (:file "util") From eweitz at common-lisp.net Fri Aug 25 09:45:28 2006 From: eweitz at common-lisp.net (eweitz) Date: Fri, 25 Aug 2006 05:45:28 -0400 (EDT) Subject: [rdnzl-cvs] CVS RDNZL/doc Message-ID: <20060825094528.25A562E1B6@common-lisp.net> Update of /project/rdnzl/cvsroot/RDNZL/doc In directory clnet:/tmp/cvs-serv12875/doc Modified Files: index.html Log Message: sync with 0.10.3 --- /project/rdnzl/cvsroot/RDNZL/doc/index.html 2006/08/10 15:36:48 1.11 +++ /project/rdnzl/cvsroot/RDNZL/doc/index.html 2006/08/25 09:45:28 1.12 @@ -117,7 +117,7 @@ Here's a short example session (using AllegroCL):

-The Message BoxCL-USER(1): (load "/home/lisp/RDNZL/load.lisp")
+The Message BoxCL-USER 1 > (load "/home/lisp/RDNZL/load.lisp")
 ; Loading C:\home\lisp\RDNZL\load.lisp
 ;   Fast loading C:\home\lisp\RDNZL\packages.fasl
 ;   Fast loading C:\home\lisp\RDNZL\specials.fasl
@@ -133,23 +133,23 @@
 ;   Fast loading C:\home\lisp\RDNZL\adapter.fasl
 ;   Fast loading C:\home\lisp\RDNZL\import.fasl
 T
-CL-USER(2): (in-package :rdnzl-user)
+CL-USER 2 > (in-package :rdnzl-user)
 #<The RDNZL-USER package>
-RDNZL-USER(3): (enable-rdnzl-syntax)
-RDNZL-USER(4): (import-types "System.Windows.Forms"
+RDNZL-USER 3 > (enable-rdnzl-syntax)
+RDNZL-USER 4 > (import-types "System.Windows.Forms"
                              "MessageBox" "MessageBoxButtons" "DialogResult")
 NIL
-RDNZL-USER(5): (use-namespace "System.Windows.Forms")
-RDNZL-USER(6): (defun message-box (text &optional (caption "RDNZL"))
+RDNZL-USER 5 > (use-namespace "System.Windows.Forms")
+RDNZL-USER 6 > (defun message-box (text &optional (caption "RDNZL"))
                  ;; check if the "OK" button was pressed
                  [Equals [MessageBox.Show text caption
                                           ;; we want the message box to have "OK" and "Cancel" buttons
                                           [$MessageBoxButtons.OKCancel]]
                          [$DialogResult.OK]])
 MESSAGE-BOX
-RDNZL-USER(7): (message-box "Hello World!") ;; user presses "OK" button
+RDNZL-USER 7 > (message-box "Hello World!") ;; user presses "OK" button
 T
-RDNZL-USER(8): (message-box "Hello World!") ;; user presses "Cancel" button
+RDNZL-USER 8 > (message-box "Hello World!") ;; user presses "Cancel" button
 NIL
 
@@ -271,7 +271,7 @@ (let (message-shown) (defun fill-list-box (object event) (when (char= [%KeyChar event] #\Return) - (cast object "TextBox") + (cast object "TextBox") (let* ((input-string [%Text object]) (input-length (length input-string))) (when (plusp input-length) @@ -313,18 +313,18 @@ (mp:process-run-function "apropos" #+:lispworks nil #'run-apropos-form) -The last example shows how easy it is to access web pages using the +The next example shows how easy it is to access web pages using the .NET standard library:
-RDNZL-USER(9): (import-types "System" "Net.WebClient")
+RDNZL-USER 9 > (import-types "System" "Net.WebClient")
 NIL
-RDNZL-USER(10): (defun download-url (url)
+RDNZL-USER 10 > (defun download-url (url)
                   (let ((web-client (new "System.Net.WebClient")))
                     [GetString (new "System.Text.ASCIIEncoding")
                                [DownloadData web-client url]]))
 DOWNLOAD-URL
-RDNZL-USER(11): (download-url "http://nanook.agharta.de/")
+RDNZL-USER 11 > (download-url "http://nanook.agharta.de/")
 "<HTML>
 <HEAD>
 <META HTTP-EQUIV=\"refresh\" CONTENT=\"5;URL=http://www.weitz.de/\">
@@ -347,10 +347,10 @@
 A bit more evolved:
 
 
-RDNZL-USER(12): (import-types "System" "Net.WebException")
+RDNZL-USER 12 > (import-types "System" "Net.WebException")
 NIL
-RDNZL-USER(13): (use-namespace "System.Net")
-RDNZL-USER(14): (defun download-url (url)
+RDNZL-USER 13 > (use-namespace "System.Net")
+RDNZL-USER 14 > (defun download-url (url)
                   (rdnzl-handler-case
                      (let ((web-client (new "WebClient")))
                        [GetString (new "System.Text.ASCIIEncoding")
@@ -359,20 +359,73 @@
                       (warn "Ooops, probably a typo: ~A" [%Message e])
                       nil)))
 DOWNLOAD-URL
-RDNZL-USER(15): (download-url "http://nanook.aharta.de/")
+RDNZL-USER 15 > (download-url "http://nanook.aharta.de/")
 Warning: Ooops, probably a typo:
          The underlying connection was closed: The remote name could not be resolved.
 NIL
 
This'll also work with https URLs. +

+The last example +shows Microsoft Office +automation - it extracts values from an Excel spreadsheet. (You'll +obviously need to have a copy of Office on your machine if you want to +try this yourself.) + +

+RDNZL-USER 16 > (import-types "Microsoft.Office.Interop.Excel" "ApplicationClass" "WorkbookClass" "Worksheet")
+NIL
 
+RDNZL-USER 17 > (use-namespace "Microsoft.Office.Interop.Excel")
+
+RDNZL-USER 18 > (defconstant +missing+ [$System.Reflection.Missing.Value])
++MISSING+
+
+RDNZL-USER 19 > (defun get-excel-range (file-name range)
+                  (let* ((app (new "ApplicationClass"))
+                         (workbooks [%Workbooks app])
+                         (workbook (cast [Open workbooks file-name
+                                               +missing+ nil +missing+
+                                               +missing+ +missing+ +missing+
+                                               +missing+ +missing+ +missing+
+                                               +missing+ +missing+ +missing+
+                                               +missing+ +missing+]
+                                         "WorkbookClass"))
+                         (worksheets [%Worksheets workbook])
+                         (sheet (cast [get_Item worksheets 1] "Worksheet"))
+                         (range [get_Range sheet range +missing+]))
+                    (cast [%Value2 [%Cells range]] "System.Array")))
+GET-EXCEL-RANGE
+
+RDNZL-USER 20 > (defun convert-range-array-to-lists (range-array)
+                  (loop for row from 1 to [GetLength range-array 0]
+                        collect (loop for col from 1 to [GetLength range-array 1]
+                                      collect [ToString (aref* range-array row col)])))
+CONVERT-RANGE-ARRAY-TO-LISTS
+
+RDNZL-USER 21 > (defun range-contents (&key (range "A1:C4")
+                                            ;; see "examples" folder for a definition of PROMPT-FOR-FILE
+                                            (file-name (prompt-for-file "Select an Excel file")))
+                  (convert-range-array-to-lists
+                   (get-excel-range file-name range)))
+RANGE-CONTENTS
+
+RDNZL-USER 22 > (pprint
+                 (range-contents :file-name "c:\\home\\lisp\\RDNZL\\examples\\example.xls"))
+
+(("Last name" "First name" "Superhero")
+ ("Kent" "Clark" "Superman")
+ ("Wayne" "Bruce" "Batman")
+ ("Parker" "Peter" "Spiderman"))
+
+(This is an adapted version of a C# example from Michael Gold.)
 

Download and installation

RDNZL together with this documentation can be downloaded from -http://weitz.de/files/RDNZL.tar.gz, the current version is 0.10.2. It +http://weitz.de/files/RDNZL.tar.gz, the current version is 0.10.3. It doesn't depend on any other Lisp libraries. The C++ source for the shared library RDNZL.dll can be downloaded separately from ASDF if you like - RDNZL comes with a system definition for ASDF.)

-Oh, and - for the moment - don't use SLIME together with -LispWorks when loading RDNZL - see this message for an explanation. +Oh, and - for the moment - don't +use SLIME together +with LispWorks when loading RDNZL - +see this +message for an explanation.
 

Support and mailing lists

@@ -1108,7 +1164,7 @@ port. Thanks to Franz Inc. (and particularly Jans Aasman) for supporting the development of RDNZL.

-$Header: /project/rdnzl/cvsroot/RDNZL/doc/index.html,v 1.11 2006/08/10 15:36:48 eweitz Exp $ +$Header: /project/rdnzl/cvsroot/RDNZL/doc/index.html,v 1.12 2006/08/25 09:45:28 eweitz Exp $

BACK TO MY HOMEPAGE From eweitz at common-lisp.net Fri Aug 25 09:45:28 2006 From: eweitz at common-lisp.net (eweitz) Date: Fri, 25 Aug 2006 05:45:28 -0400 (EDT) Subject: [rdnzl-cvs] CVS RDNZL/examples Message-ID: <20060825094528.5D0E72E1BA@common-lisp.net> Update of /project/rdnzl/cvsroot/RDNZL/examples In directory clnet:/tmp/cvs-serv12875/examples Added Files: example.xls excel.lisp Log Message: sync with 0.10.3 --- /project/rdnzl/cvsroot/RDNZL/examples/example.xls 2006/08/25 09:45:28 NONE +++ /project/rdnzl/cvsroot/RDNZL/examples/example.xls 2006/08/25 09:45:28 1.1 ??????>?? ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? a???????\p Edi Weitz B?a?=???=xx;T$8X@?"??1????Arial1????Arial1????Arial1????Arial"$"#,##0_);\("$"#,##0\)!"$"#,##0_);[Red]\("$"#,##0\)""$"#,##0.00_);\("$"#,##0.00\)'""$"#,##0.00_);[Red]\("$"#,##0.00\)7*2_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_).))_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)?,:_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)6+1_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)??? ? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ??? ?? ? ? ?+?? ?? ?)?? ?? ?,?? ?? ?*?? ?? ? ?? ?? ??????????????????`?4Sheet1?GSheet2?N Sheet3????8?} Superhero Last name First nameKentClarkSupermanWayneBruceBatmanParkerPeter Spiderman?? ?[ccb a??? ?  d????MbP?_*+??%??????"?????U????? ? ? ? ? ? ? ? ? ?  ?  ?  ? ?<***>?@?7 a??? ?  d????MbP?_*+??%??????"?????U>?@?7 a???   d????MbP?_*+??%??????"?????U>?@?7 ???????Oh??+'??0?@HTh ? ??? Edi WeitzMicrosoft Excel@??(??@Q=????????.??+,??0? PXd lt|? ? ??d Sheet1Sheet2Sheet3  Worksheets???? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Root Entry???????? ?F@??'??????Workbook????????????SummaryInformation(????DocumentSummaryInformation8????????????--- /project/rdnzl/cvsroot/RDNZL/examples/excel.lisp 2006/08/25 09:45:28 NONE +++ /project/rdnzl/cvsroot/RDNZL/examples/excel.lisp 2006/08/25 09:45:28 1.1 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: RDNZL; Base: 10 -*- ;;; $Header: /project/rdnzl/cvsroot/RDNZL/examples/excel.lisp,v 1.1 2006/08/25 09:45:28 eweitz Exp $ ;;; Copyright (c) 2004-2006, Dr. Edmund Weitz. All rights reserved. ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; * Redistributions in binary form must reproduce the above ;;; copyright notice, this list of conditions and the following ;;; disclaimer in the documentation and/or other materials ;;; provided with the distribution. ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; This example is an adapted version of the code found at ;;; . ;;; It was tested with Microsoft Office 2003. (in-package :rdnzl-user) (enable-rdnzl-syntax) (import-types "System.Windows.Forms" "DialogResult" "OpenFileDialog") (import-types "Microsoft.Office.Interop.Excel" "ApplicationClass" "WorkbookClass" "Worksheet") (use-namespace "Microsoft.Office.Interop.Excel") (use-namespace "System.Windows.Forms") (defconstant +missing+ [$System.Reflection.Missing.Value] "Represents missing arguments.") (defconstant +dialog-ok+ [$DialogResult.OK] "Returned by `OpenFileDialog' if the user confirmed the dialog.") (defconstant +initial-directory+ (load-time-value (namestring (make-pathname :name nil :type nil :defaults +pathname-defaults+)))) (defconstant +initial-filename+ (load-time-value (namestring (make-pathname :name "example" :type "xls" :defaults +pathname-defaults+)))) (defun prompt-for-file (title) (let ((dialog (new "OpenFileDialog"))) (setf [%InitialDirectory dialog] +initial-directory+ [%Filter dialog] "Microsoft Excel files (*.xls)|*.xls|All files (*.*)|*.*" [%FileName dialog] +initial-filename+ [%Title dialog] title) (and [Equals [ShowDialog dialog] +dialog-ok+] [%FileName dialog]))) (defun get-excel-range (file-name range) (let* ((app (new "ApplicationClass")) (workbooks [%Workbooks app]) (workbook (cast [Open workbooks file-name +missing+ nil +missing+ +missing+ +missing+ +missing+ +missing+ +missing+ +missing+ +missing+ +missing+ +missing+ +missing+ +missing+] "WorkbookClass")) (worksheets [%Worksheets workbook]) (sheet (cast [get_Item worksheets 1] "Worksheet")) (range [get_Range sheet range +missing+])) (prog1 (cast [%Value2 [%Cells range]] "System.Array") [Quit app]))) (defun convert-range-array-to-lists (range-array) (loop for row from 1 to [GetLength range-array 0] collect (loop for col from 1 to [GetLength range-array 1] collect [ToString (aref* range-array row col)]))) (defun range-contents (&key (file-name (prompt-for-file "Select an Excel file")) (range "A1:C4")) (convert-range-array-to-lists (get-excel-range file-name range))) (disable-rdnzl-syntax)