good ideas in programming languages

Post on 22-Jan-2018

210 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

••

••

••

••

••

•• int [,] x = new int[2,2] { { 1,2 }, {3, 4} };• x = [1 2; 3 4]

•••• Z = [A B]• X' X^-1•

c * A

A * B

•A \ B

𝑎 𝑏𝑐 𝑑

×𝑒 𝑓𝑔 ℎ

=𝑎𝑒 + 𝑏𝑔 𝑎𝑓 + 𝑏ℎ𝑐𝑒 + 𝑑𝑔 𝑐𝑓 + 𝑑ℎ

𝑎 𝑏𝑐 𝑑

⨀𝑒 𝑓𝑔 ℎ

=𝑎𝑒 𝑏𝑓𝑐𝑔 𝑑ℎ

•• 3f32

•X' * Y • X' *

••

x = {[(2+3)-4]/2};•

• 𝑥𝑖𝑗

X = [1 2; 3 4];X = [ 1 2

3 4 ];

X * Y;X .* Y;

{ … }

(x:i32) -> float { … }

f := (x:i32) -> float { … }

f := (x:i32) -> float { … }

data class Person(var name:String, var age:Int)

equals()/hashCode()

toString()

val (name, age) = john

val john = Person("John", 23)val jane = john.copy(name = "Jane")

class Foo{

group names{

first, middle?, last : string}

}

names

struct Foo SOA{

int x;bool b;

}

Foo foos[128];

int[128]bool[128]

≠ ≤ ≥

⋅ ⨉ ⨀

x²+y³

∧ ∨

x.Contains(y)

!x.Contains(y)

x.Count == 0

x.All(e => y.Contains(e))

x.Remove(e => y.Contains(e))

y ∈ x or x ∋ y

y ∉ x

x = ∅

y ⊂ x

x ∖= y

∀x : {x ∈ items | x > 0}{print(x)

}

top related