swig/SWIG/Examples/chicken/overload/test-overload.scm
Jonah Beckford 3def239916 Changed module technique from <module_name>- to <module_name>: which
conforms with chicken "egg" standard.  Got rid of ##csi#run for
relinking the Scheme interpreter as no longer needed.  Changed all
documentation to reflect both changes.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4411 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-02-27 02:00:15 +00:00

46 lines
1.2 KiB
Scheme

;; This file demonstrates the overloading capabilities of SWIG
;; Low level
;; ---------
(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)
")
(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)
;; 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
(-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")
(+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)