Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Classes/Transd/classes.transd
Normal file
24
Task/Classes/Transd/classes.transd
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#lang transd
|
||||
|
||||
class Point : {
|
||||
x: Double(),
|
||||
y: Double(),
|
||||
@init: (λ v Vector<Double>() (= x (get v 0)) (= y (get v 1))),
|
||||
print: (λ (textout "Point(" x "; " y ")\n" ))
|
||||
}
|
||||
|
||||
MainModule: {
|
||||
v_: [[1.0, 2.0], [3.0, 4.0]],
|
||||
|
||||
_start: (λ
|
||||
// creating an instance of class
|
||||
(with pt Point([5.0, 6.0])
|
||||
// calling a class' method
|
||||
(print pt)
|
||||
)
|
||||
|
||||
// creating several instances using data deserialization
|
||||
(with v Vector<Point>(v_)
|
||||
(for p in v do (print p))
|
||||
) )
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue