Changeset 34938 in project for release/4/srfi-27/OO-example.scm
- Timestamp:
- 12/17/17 02:30:01 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
release/4/srfi-27/OO-example.scm
r34865 r34938 5 5 (define-class <named> () ( 6 6 (namsym reader: name) ) ) 7 (define-method (name (obj <named>)) 8 (slot-value obj 'namsym)) 7 9 8 10 ;; Parameterized extension "concept" … … 79 81 80 82 #| 81 (use test)82 83 83 (let ((expn-rd (make-random-distribution make-random-exponentials mu: 0.5))) 84 (use test) 84 85 (test <random-distribution> (class-of expn-rd)) 85 86 (test-assert (number? (next-value expn-rd))) … … 88 89 89 90 #| 90 ;; Use it 91 (define expn-rd (make-random-distribution make-random-exponentials mu: 0.5)) 91 92 (use coops-extras) 92 93 (define expn-rd (make-random-distribution make-random-exponentials mu: 0.5))94 93 (describe-object expn-rd) 95 ; coops instance of class `<random-distribution>':94 ;#> coops instance of class `<random-distribution>': 96 95 ;tmpval: #f 97 96 ;namsym: exponentials … … 101 100 ;nxtval: #<procedure (f_1191)> 102 101 103 (next-value expn-rd) ; =>...102 (next-value expn-rd) ;#> 0.#... 104 103 |#
Note: See TracChangeset
for help on using the changeset viewer.