Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
12
Task/Compound-data-type/EchoLisp/compound-data-type.echolisp
Normal file
12
Task/Compound-data-type/EchoLisp/compound-data-type.echolisp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(lib 'struct)
|
||||
(struct Point (x y))
|
||||
(Point 3 4)
|
||||
→ #<Point> (3 4)
|
||||
|
||||
;; run-time type checking is possible
|
||||
(lib 'types)
|
||||
(struct Point (x y))
|
||||
(struct-type Point Number Number)
|
||||
(Point 3 4)
|
||||
(Point 3 'albert)
|
||||
❌ error: #number? : type-check failure : albert → 'Point:y'
|
||||
Loading…
Add table
Add a link
Reference in a new issue