Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,5 @@
Lbl POINT
r₂→{r₁}ʳ
r₃→{r₁+2}ʳ
r₁
Return

View file

@ -0,0 +1 @@
POINT(L₁,5,10)

View 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'

View file

@ -0,0 +1,11 @@
' FB 1.05.0 Win64
Type Point
As Integer x, y
End Type
Dim p As Point = (1, 2)
Dim p2 As Point = (3, 4)
Print p.x, p.y
Print p2.x, p2.y
Sleep

View file

@ -0,0 +1,3 @@
(defrecord point
x
y)

View file

@ -0,0 +1,14 @@
define Point => type {
parent pair
public onCreate(x,y) => {
..onCreate(#x=#y)
}
public x => .first
public y => .second
}
local(point) = Point(33, 42)
#point->x
#point->y

View file

@ -0,0 +1,8 @@
-- parent script "MyPoint"
property x
property y
on new (me, px, py)
me.x = px
me.y = py
return me
end

View file

@ -0,0 +1,3 @@
p = script("MyPoint").new(23, 42)
put p.x, p.y
-- 23 42

View file

@ -0,0 +1,4 @@
-- in some movie script
on MyPoint (x, y)
return script("MyPoint").new(x, y)
end

View file

@ -0,0 +1,3 @@
p = MyPoint(23, 42)
put p.x, p.y
-- 23 42

View file

@ -0,0 +1,4 @@
type Point = tuple[x, y: int]
var p: Point = (12, 13)
var p2: Point = (x: 100, y: 200)

View file

@ -0,0 +1 @@
Object Class new: Point(x, y)

View file

@ -0,0 +1,15 @@
enum x,y
type point(object p)
return sequence(p) and length(p)=y and atom(p[x]) and atom(p[y])
end type
point p = {175,3.375}
p[x] -= p[y]*20
puts(1,"point p is ")
?p
printf(1,"p[x]:%g, p[y]:%g\n",{p[x],p[y]})
p[x] = 0 -- fine
p[y] = "string" -- run-time error

View file

@ -0,0 +1 @@
see new point {x=10 y=20} class point x y

View file

@ -0,0 +1,2 @@
x: 10.000000
y: 20.000000

View file

@ -0,0 +1,4 @@
(datatype point
X : number; Y : number;
====================
[point X Y] : point;)

View file

@ -0,0 +1,2 @@
(2+) (@p 1 2)
(@p 1 2) : (number * number)

View file

@ -0,0 +1,3 @@
struct Point {x, y};
var point = Point(1, 2);
say point.y; #=> 2

View file

@ -0,0 +1,19 @@
// Structure
struct Point {
var x:Int
var y:Int
}
// Tuple
typealias PointTuple = (Int, Int)
// Class
class PointClass {
var x:Int!
var y:Int!
init(x:Int, y:Int) {
self.x = x
self.y = y
}
}

View file

@ -0,0 +1 @@
{"x":1, "y":2}

View file

@ -0,0 +1 @@
{"x":1, "y":2, type: "Point"}