More work on the chicken module. The test suite, zlib, and overload examples are still broken.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6610 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2004-11-02 02:50:30 +00:00
commit 2cdf91de5d
17 changed files with 305 additions and 181 deletions

View file

@ -5,7 +5,7 @@ SRCS =
CXXSRCS = example.cxx
TARGET = overload
INCLUDE =
SWIGOPT =
SWIGOPT = -proxy -unhideprimitive
CFLAGS =
VARIANT =
@ -23,8 +23,8 @@ $(TARGET): $(INTERFACE) $(SRCS)
clean::
$(MAKE) -f $(TOP)/Makefile chicken_clean
rm -f example.scm example-generic.scm example-clos.scm
rm -f example.scm
rm -f $(TARGET)
check::
csi -batch $(TARGET).so test-overload.scm
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH csi test-overload.scm

View file

@ -1,5 +1,6 @@
;; This file demonstrates the overloading capabilities of SWIG
(load-library 'example "overload.so")
(declare (uses example))
(declare (uses tinyclos))
@ -8,42 +9,39 @@
(display "
Trying low level code ...
(example:foo 1)
(example:foo \"some string\")
(define A-FOO (example:new-Foo))
(define ANOTHER-FOO (example:new-Foo A-FOO)) ;; copy constructor
(example:Foo-bar A-FOO 2)
(example:Foo-bar ANOTHER-FOO \"another string\" 3)
(foo 1)
(foo \"some string\")
(define A-FOO (new-Foo))
(define ANOTHER-FOO (new-Foo A-FOO)) ;; copy constructor
(Foo-bar A-FOO 2)
(Foo-bar ANOTHER-FOO \"another string\" 3)
")
(example:foo 1)
(example:foo "some string")
(define A-FOO (example:new-Foo))
(define ANOTHER-FOO (example:new-Foo A-FOO)) ;; copy constructor
(example:Foo-bar A-FOO 2)
(example:Foo-bar ANOTHER-FOO "another string" 3)
(primitive:foo 1)
(primitive:foo "some string")
(define A-FOO (slot-ref (primitive:new-Foo) 'swig-this))
(define ANOTHER-FOO (slot-ref (primitive:new-Foo A-FOO) 'swig-this)) ;; copy constructor
(primitive:Foo-bar A-FOO 2)
(primitive:Foo-bar ANOTHER-FOO "another string" 3)
;; TinyCLOS
;; --------
(display "
Trying TinyCLOS code ...
(+example:foo+ 1)
(+example:foo+ \"some string\")
(define A-FOO (make <example:Foo>))
(define ANOTHER-FOO (make <example:Foo> A-FOO)) ;; copy constructor
(+foo+ 1)
(+foo+ \"some string\")
(define A-FOO (make <Foo>))
(define ANOTHER-FOO (make <Foo> A-FOO)) ;; copy constructor
(-bar- A-FOO 2)
(-bar- ANOTHER-FOO \"another string\" 3)
")
;; ALL generic methods must be included first
(include "example-generic")
;; After generic methods are defined, can include TinyCLOS code
(include "example-clos")
(foo 1)
(foo "some string")
(define A-FOO (make <Foo>))
(define ANOTHER-FOO (make <Foo> (slot-ref A-FOO 'swig-this))) ;; copy constructor
(bar A-FOO 2)
(bar ANOTHER-FOO "another string" 3)
(+example:foo+ 1)
(+example:foo+ "some string")
(define A-FOO (make <example:Foo>))
(define ANOTHER-FOO (make <example:Foo> A-FOO)) ;; copy constructor
(-bar- A-FOO 2)
(-bar- ANOTHER-FOO "another string" 3)
(exit)