Update of scribblings
This commit is contained in:
2
info.rkt
2
info.rkt
@@ -1,7 +1,7 @@
|
|||||||
#lang info
|
#lang info
|
||||||
|
|
||||||
(define pkg-authors '(hnmdijkema))
|
(define pkg-authors '(hnmdijkema))
|
||||||
(define version "0.5")
|
(define version "0.51")
|
||||||
(define license 'Apache-2.0)
|
(define license 'Apache-2.0)
|
||||||
(define collection "roos")
|
(define collection "roos")
|
||||||
(define pkg-desc "An OO Framework for Racket")
|
(define pkg-desc "An OO Framework for Racket")
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ It has a simple form of inheritance. All methods and attributes are "virtual", i
|
|||||||
if called from a base class, and re-declared in a derived roos "class", the derived attribute or
|
if called from a base class, and re-declared in a derived roos "class", the derived attribute or
|
||||||
method will be used.
|
method will be used.
|
||||||
|
|
||||||
@defform[(roos (class-name ...) this supers
|
@defform[(def-roos (class-name ...) this supers
|
||||||
(attribute-i value-i)
|
(attribute-i value-i)
|
||||||
...
|
...
|
||||||
((method-j ...) expr ...)
|
((method-j ...) expr ...)
|
||||||
@@ -42,11 +42,11 @@ Returns the defined roos class of an instantiated roos class if @code{roos-objec
|
|||||||
|
|
||||||
|
|
||||||
@examples[(require roos)
|
@examples[(require roos)
|
||||||
(roos (a x) this (supers)
|
(def-roos (a x) this (supers)
|
||||||
(y ( + x 4))
|
(y ( + x 4))
|
||||||
((g a) (* a (-> this y))))
|
((g a) (* a (-> this y))))
|
||||||
|
|
||||||
(roos (b1) this (supers (a 6))
|
(def-roos (b1) this (supers (a 6))
|
||||||
((v . a) (if (null? a)
|
((v . a) (if (null? a)
|
||||||
(-> supers y)
|
(-> supers y)
|
||||||
(begin
|
(begin
|
||||||
@@ -54,11 +54,11 @@ Returns the defined roos class of an instantiated roos class if @code{roos-objec
|
|||||||
(-> supers y))))
|
(-> supers y))))
|
||||||
(y 55))
|
(y 55))
|
||||||
|
|
||||||
(roos (b2) this (supers (a 5))
|
(def-roos (b2) this (supers (a 5))
|
||||||
((v2) (-> supers y))
|
((v2) (-> supers y))
|
||||||
((v2*) (-> this y)))
|
((v2*) (-> this y)))
|
||||||
|
|
||||||
(roos (c) this (supers (b1) (b2))
|
(def-roos (c) this (supers (b1) (b2))
|
||||||
((zy) (-> supers y))
|
((zy) (-> supers y))
|
||||||
((z1) (-> supers v))
|
((z1) (-> supers v))
|
||||||
((z2) (-> supers v2))
|
((z2) (-> supers v2))
|
||||||
@@ -69,7 +69,7 @@ Returns the defined roos class of an instantiated roos class if @code{roos-objec
|
|||||||
((_ c d ...)
|
((_ c d ...)
|
||||||
c)))
|
c)))
|
||||||
|
|
||||||
(define bb (b1))
|
(define bb (-* b1))
|
||||||
|
|
||||||
(: (-> bb g 2) "(-> bb g 2) Will return the value of (* 2 y of class b1)")
|
(: (-> bb g 2) "(-> bb g 2) Will return the value of (* 2 y of class b1)")
|
||||||
(: (-> bb y! 7) "(-> bb y! 7) Will set y in class b1 to 7")
|
(: (-> bb y! 7) "(-> bb y! 7) Will set y in class b1 to 7")
|
||||||
|
|||||||
Reference in New Issue
Block a user