Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
30
Task/Object-serialization/PicoLisp/object-serialization-1.l
Normal file
30
Task/Object-serialization/PicoLisp/object-serialization-1.l
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
(class +Point)
|
||||
# x y
|
||||
|
||||
(dm T (X Y)
|
||||
(=: x (or X 0))
|
||||
(=: y (or Y 0)) )
|
||||
|
||||
(dm print> ()
|
||||
(prinl "Point " (: x) "," (: y)) )
|
||||
|
||||
(class +Circle +Point)
|
||||
# r
|
||||
|
||||
(dm T (X Y R)
|
||||
(super X Y)
|
||||
(=: r (or R 0)) )
|
||||
|
||||
(dm print> ()
|
||||
(prinl "Circle " (: x) "," (: y) "," (: r)) )
|
||||
|
||||
(setq
|
||||
P (new '(+Point) 3 4)
|
||||
C (new '(+Circle) 10 10 5) )
|
||||
|
||||
(print> P)
|
||||
(print> C)
|
||||
|
||||
(out "objects.dat"
|
||||
(pr (val P) (getl P))
|
||||
(pr (val C) (getl C)) )
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(in "objects.dat"
|
||||
(putl (setq A (box (rd))) (rd))
|
||||
(putl (setq B (box (rd))) (rd)) )
|
||||
|
||||
(print> A)
|
||||
(print> B)
|
||||
Loading…
Add table
Add a link
Reference in a new issue