Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,4 +0,0 @@
type Point is tagged record
X : Integer := 0;
Y : Integer := 0;
end record;

View file

@ -1,4 +0,0 @@
type Point is record
X : Integer := 0;
Y : Integer := 0;
end record;

View file

@ -1,11 +0,0 @@
type Person (Gender : Gender_Type) is record
Name : Name_String;
Age : Natural;
Weight : Float;
Case Gender is
when Male =>
Beard_Length : Float;
when Female =>
null;
end case;
end record;

View file

@ -1,6 +1,27 @@
point: #[
x: 10
y: 20
define :Point [
init: constructor [x :integer, y :integer]
distance: method [other][
sqrt (\x - other\x)^2 + (\y - other\y)^2
]
string: method [][
"Point(" ++ (to :string \x) ++ ","
++ (to :string \y) ++ ")"
]
]
print point
pt: to :Point [6 7]!
print ["point A's x coordinate is:" pt\x]
; set a field
pt\y: 3
; stringify using custom magic method
print ["point A:" pt]
pt2: to :Point [2 5]!
print ["point B:" pt2]
print ["Distance between points:" pt\distance pt2]

View file

@ -1,5 +0,0 @@
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Point.
05 x USAGE IS BINARY-SHORT.
05 y USAGE IS BINARY-SHORT.

View file

@ -1,12 +1,12 @@
struct Point
{
int X : prop;
int X : prop(_x);
int Y : prop;
int Y : prop(_y);
constructor new(int x, int y)
{
X := x;
Y := y
_x := x;
_y := y
}
}

View file

@ -1,11 +0,0 @@
enum x, y
sequence point = {0,0}
printf(1,"x = %d, y = %3.3f\n",point)
point[x] = 'A'
point[y] = 53.42
printf(1,"x = %d, y = %3.3f\n",point)
printf(1,"x = %s, y = %3.3f\n",point)

View file

@ -1,18 +0,0 @@
class Point {
[Int]$a
[Int]$b
Point() {
$this.a = 0
$this.b = 0
}
Point([Int]$a, [Int]$b) {
$this.a = $a
$this.b = $b
}
[Int]add() {return $this.a + $this.b}
[Int]mul() {return $this.a * $this.b}
}
$p1 = [Point]::new()
$p2 = [Point]::new(3,2)
$p1.add()
$p2.mul()

View file

@ -1,20 +1,4 @@
mypoint <- list(x=3.4, y=6.7)
# $x
# [1] 3.4
# $y
# [1] 6.7
mypoint$x # 3.4
mypoint <- list(x=3.4, y=6.7) |> print()
mypoint$x
list(a=1:10, b="abc", c=runif(10), d=list(e=1L, f=TRUE))
# $a
# [1] 1 2 3 4 5 6 7 8 9 10
# $b
# [1] "abc"
# $c
# [1] 0.64862897 0.73669435 0.11138945 0.10408015 0.46843836 0.32351247
# [7] 0.20528914 0.78512472 0.06139691 0.76937113
# $d
# $d$e
# [1] 1
# $d$f
# [1] TRUE