PageRenderTime 18ms CodeModel.GetById 16ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Examples/chicken/overload/test-overload.scm

#
Lisp | 45 lines | 32 code | 8 blank | 5 comment | 0 complexity | f72bbca964ad0f98730b11749b975b82 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1;; This file demonstrates the overloading capabilities of SWIG
 2
 3(load-library 'example "overload.so")
 4
 5;; Low level
 6;; ---------
 7
 8(display "
 9Trying low level code ...
10  (foo 1)
11  (foo \"some string\")
12  (define A-FOO (new-Foo))
13  (define ANOTHER-FOO (new-Foo A-FOO)) ;; copy constructor
14  (Foo-bar A-FOO 2)
15  (Foo-bar ANOTHER-FOO \"another string\" 3)
16")
17
18(primitive:foo 1)
19(primitive:foo "some string")
20(define A-FOO (slot-ref (primitive:new-Foo) 'swig-this))
21(define ANOTHER-FOO (slot-ref (primitive:new-Foo A-FOO) 'swig-this)) ;; copy constructor
22(primitive:Foo-bar A-FOO 2)
23(primitive:Foo-bar ANOTHER-FOO "another string" 3)
24
25;; TinyCLOS
26;; --------
27
28(display "
29Trying TinyCLOS code ...
30  (+foo+ 1)
31  (+foo+ \"some string\")
32  (define A-FOO (make <Foo>))
33  (define ANOTHER-FOO (make <Foo> A-FOO)) ;; copy constructor
34  (-bar- A-FOO 2)
35  (-bar- ANOTHER-FOO \"another string\" 3)
36")
37
38(foo 1)
39(foo "some string")
40(define A-FOO (make <Foo>))
41(define ANOTHER-FOO (make <Foo> A-FOO)) ;; copy constructor
42(bar A-FOO 2)
43(bar ANOTHER-FOO "another string" 3)
44
45(exit)