Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Object-serialization/TXR/object-serialization-2.txr
Normal file
13
Task/Object-serialization/TXR/object-serialization-2.txr
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defstruct shape ()
|
||||
(pos-x 0.0) (pos-y 0.0))
|
||||
|
||||
(defstruct circle (shape)
|
||||
radius
|
||||
(:method print (me stream pretty-p)
|
||||
(if pretty-p
|
||||
(put-string `#<circle of radius @{me.radius} at coordinates (@{me.pos-x}, @{me.pos-y})>`)
|
||||
:)))
|
||||
|
||||
(let ((circ (new circle radius 5.3)))
|
||||
(prinl circ) ;; print machine readably
|
||||
(pprinl circ)) ;; print pretty
|
||||
Loading…
Add table
Add a link
Reference in a new issue