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
This commit is contained in:
parent
704e2ac719
commit
3def239916
20 changed files with 681 additions and 682 deletions
|
|
@ -53,30 +53,30 @@ public:
|
|||
(display "CHICKEN Low-Level Procedures\n")
|
||||
(display "----------------------------\n")
|
||||
(display "
|
||||
(define A-CIRCLE-SHAPE (example-new-Circle %radius))
|
||||
(example-Circle-area %circle)
|
||||
(example-Circle-perimeter %circle)
|
||||
(example-delete-Circle %circle)
|
||||
(define A-CIRCLE-SHAPE (example:new-Circle %radius))
|
||||
(example:Circle-area %circle)
|
||||
(example:Circle-perimeter %circle)
|
||||
(example:delete-Circle %circle)
|
||||
|
||||
(define A-SQUARE-SHAPE (example-new-Square %width))
|
||||
(example-Square-area %square)
|
||||
(example-Square-perimeter %square)
|
||||
(example-delete-Square %square)
|
||||
(define A-SQUARE-SHAPE (example:new-Square %width))
|
||||
(example:Square-area %square)
|
||||
(example:Square-perimeter %square)
|
||||
(example:delete-Square %square)
|
||||
|
||||
(example-delete-Shape %shape)
|
||||
(example-Shape-x-set %shape %x)
|
||||
(example-Shape-x-get %shape)
|
||||
(example-Shape-y-set %shape %y)
|
||||
(example-Shape-y-get %shape)
|
||||
(example-Shape-move %shape %dx %dy)
|
||||
(example-Shape-area %shape)
|
||||
(example-Shape-perimeter %shape)
|
||||
(example-Shape-nshapes)
|
||||
(example-Shape-nshapes %nshapes-int)
|
||||
(example-Shape-First)
|
||||
(example-Shape-Second)
|
||||
(example-Shape-Third)
|
||||
(example-Shape-Last)
|
||||
(example:delete-Shape %shape)
|
||||
(example:Shape-x-set %shape %x)
|
||||
(example:Shape-x-get %shape)
|
||||
(example:Shape-y-set %shape %y)
|
||||
(example:Shape-y-get %shape)
|
||||
(example:Shape-move %shape %dx %dy)
|
||||
(example:Shape-area %shape)
|
||||
(example:Shape-perimeter %shape)
|
||||
(example:Shape-nshapes)
|
||||
(example:Shape-nshapes %nshapes-int)
|
||||
(example:Shape-First)
|
||||
(example:Shape-Second)
|
||||
(example:Shape-Third)
|
||||
(example:Shape-Last)
|
||||
")
|
||||
|
||||
(display "\n")
|
||||
|
|
@ -89,7 +89,7 @@ public:
|
|||
;; After generic methods are defined, can include TinyCLOS code
|
||||
(include \"example_clos\")
|
||||
|
||||
(define A-CIRCLE-SHAPE (make <example-Circle> %radius))
|
||||
(define A-CIRCLE-SHAPE (make <example:Circle> %radius))
|
||||
(-get-x- %shapeObject)
|
||||
(-set-x!- %shapeObject %x)
|
||||
(-get-y- %shapeObject)
|
||||
|
|
@ -97,9 +97,9 @@ public:
|
|||
(-move!- %shapeObject %dx %dy)
|
||||
(-area- %shapeObject)
|
||||
(-perimeter- %shapeObject)
|
||||
(+example-Shape-nshapes+)
|
||||
(+example-Shape-nshapes+ %nshapes-int)
|
||||
;; do not use (example-delete-Shape (slot-ref %shapeObject 'this))
|
||||
(+example:Shape-nshapes+)
|
||||
(+example:Shape-nshapes+ %nshapes-int)
|
||||
;; do not use (example:delete-Shape (slot-ref %shapeObject 'this))
|
||||
;; as %shapeObject is always garbage-collected
|
||||
")
|
||||
(display "\n")))
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
;; ----- Object creation -----
|
||||
|
||||
(display "Creating some objects:\n")
|
||||
(define c (example-new-Circle 10.0))
|
||||
(define c (example:new-Circle 10.0))
|
||||
(display " Created circle ")
|
||||
(display c)
|
||||
(display "\n")
|
||||
(define s (example-new-Square 10.0))
|
||||
(define s (example:new-Square 10.0))
|
||||
(display " Created square ")
|
||||
(display s)
|
||||
(display "\n")
|
||||
|
|
@ -16,29 +16,29 @@
|
|||
;; ----- Access a static member -----
|
||||
|
||||
(display "\nA total of ")
|
||||
(display (example-Shape-nshapes))
|
||||
(display (example:Shape-nshapes))
|
||||
(display " shapes were created\n")
|
||||
|
||||
;; ----- Member data access -----
|
||||
|
||||
;; Set the location of the object
|
||||
|
||||
(example-Shape-x-set c 20.0)
|
||||
(example-Shape-y-set c 30.0)
|
||||
(example:Shape-x-set c 20.0)
|
||||
(example:Shape-y-set c 30.0)
|
||||
|
||||
(example-Shape-x-set s -10.0)
|
||||
(example-Shape-y-set s 5.0)
|
||||
(example:Shape-x-set s -10.0)
|
||||
(example:Shape-y-set s 5.0)
|
||||
|
||||
(display "\nHere is their current position:\n")
|
||||
(display " Circle = (")
|
||||
(display (example-Shape-x-get c))
|
||||
(display (example:Shape-x-get c))
|
||||
(display ", ")
|
||||
(display (example-Shape-y-get c))
|
||||
(display (example:Shape-y-get c))
|
||||
(display ")\n")
|
||||
(display " Square = (")
|
||||
(display (example-Shape-x-get s))
|
||||
(display (example:Shape-x-get s))
|
||||
(display ", ")
|
||||
(display (example-Shape-y-get s))
|
||||
(display (example:Shape-y-get s))
|
||||
(display ")\n")
|
||||
|
||||
;; ----- Call some methods -----
|
||||
|
|
@ -50,10 +50,10 @@
|
|||
(display o)
|
||||
(display "\n")
|
||||
(display " area = ")
|
||||
(display (example-Shape-area o))
|
||||
(display (example:Shape-area o))
|
||||
(display "\n")
|
||||
(display " perimeter = ")
|
||||
(display (example-Shape-perimeter o))
|
||||
(display (example:Shape-perimeter o))
|
||||
(display "\n"))))
|
||||
(disp c)
|
||||
(disp s))
|
||||
|
|
@ -61,10 +61,10 @@
|
|||
(display "\nGuess I'll clean up now\n")
|
||||
|
||||
;; Note: this invokes the virtual destructor
|
||||
(example-delete-Shape c)
|
||||
(example-delete-Shape s)
|
||||
(example:delete-Shape c)
|
||||
(example:delete-Shape s)
|
||||
|
||||
(set! s 3)
|
||||
(display (example-Shape-nshapes))
|
||||
(display (example:Shape-nshapes))
|
||||
(display " shapes remain\n")
|
||||
(display "Goodbye\n")
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@
|
|||
;; ----- Object creation -----
|
||||
|
||||
(display "Creating some objects:\n")
|
||||
(define c (make <example-Circle> 10.0))
|
||||
(define c (make <example:Circle> 10.0))
|
||||
(display " Created circle ")
|
||||
(display c)
|
||||
(display "\n")
|
||||
(define s (make <example-Square> 10.0))
|
||||
(define s (make <example:Square> 10.0))
|
||||
(display " Created square ")
|
||||
(display s)
|
||||
(display "\n")
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
;; ----- Access a static member -----
|
||||
|
||||
(display "\nA total of ")
|
||||
(display (+example-Shape-nshapes+))
|
||||
(display (+example:Shape-nshapes+))
|
||||
(display " shapes were created\n")
|
||||
|
||||
;; ----- Member data access -----
|
||||
|
|
@ -71,6 +71,6 @@
|
|||
(set! s 88)
|
||||
(gc #t)
|
||||
|
||||
(display (+example-Shape-nshapes+))
|
||||
(display (+example:Shape-nshapes+))
|
||||
(display " shapes remain\n")
|
||||
(display "Goodbye\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue