Bigloo homepage -- Jvm Example





 1: (module main
 2:    (java (class point
 3:             (constructor init-default-point ())
 4:             (field x::int "x")
 5:             (method show::void (::point) "show")
 6:             (method static pointstatistics::int () "PointStatistics")
 7:             "Point")
 8:          (class point
 9:             (field y::int "y")
10:             (field static point-num::int "point_num")
11:             (constructor init-point (::int ::int)))
12:          (export callback "callback"))
13:    (export (callback::int ::int))
14:    (main main))
15: 
16: (define (main argv)
17:    (let loop ((num (if (null? (cdr argv))
18:                        10
19:                        (string->integer (cadr argv)))))
20:       (if (=fx num -1)
21:           (let ((pt (init-default-point)))
22:              (show pt)
23:              (newline)
24:              (print "Number of allocated points: " (PointStatistics))
25:              (print "point-num: " point-num))
26:           (let ((pt (init-point num num)))
27:              (show pt)
28:              (print "  <-->  Point: " pt " x:" (point-x pt) " y:" (point-y pt))
29:              (newline)
30:              (loop (-fx num 1))))))
31: 
32: (define (callback x)
33:    (+ 1 x))
34: 

This Html page has been produced by Skribe.
Last update Thu Feb 27 08:01:21 2020.