Changeset 34938 in project


Ignore:
Timestamp:
12/17/17 02:30:01 (6 months ago)
Author:
kon
Message:

updt ex ; has a name don' it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-27/OO-example.scm

    r34865 r34938  
    55(define-class <named> () (
    66  (namsym reader: name) ) )
     7(define-method (name (obj <named>))
     8  (slot-value obj 'namsym))
    79
    810;; Parameterized extension "concept"
     
    7981
    8082#|
    81 (use test)
    82 
    8383(let ((expn-rd (make-random-distribution make-random-exponentials mu: 0.5)))
     84  (use test)
    8485  (test <random-distribution> (class-of expn-rd))
    8586  (test-assert (number? (next-value expn-rd)))
     
    8889
    8990#|
    90 ;; Use it
     91(define expn-rd (make-random-distribution make-random-exponentials mu: 0.5))
    9192(use coops-extras)
    92 
    93 (define expn-rd (make-random-distribution make-random-exponentials mu: 0.5))
    9493(describe-object expn-rd)
    95 ;coops instance of class `<random-distribution>':
     94;#> coops instance of class `<random-distribution>':
    9695;tmpval: #f
    9796;namsym: exponentials
     
    101100;nxtval: #<procedure (f_1191)>
    102101
    103 (next-value expn-rd) ;=> ...
     102(next-value expn-rd) ;#> 0.#...
    104103|#
Note: See TracChangeset for help on using the changeset viewer.