idiom#5 平面一点

Create a 2D Point data structure

Python


@dataclass
class Point:
    x: float
    y: float

Point = namedtuple("Point", "x y")

Rust

#![allow(unused)]

fn main() {
struct Point {
    x: f64,
    y: f64,
}

struct Point(f64, f64);
}

Elixir

p = [ x: 1.122, y: 7.45 ]

Humm?

和 Python 基本相似;

      _~∽-∽~_
  () /  ☉ #  \ \/
    '_   V   _'
    | '--.--' \

...act by ferris-actor v0.2.4 (built on 23.0303.201916)

知识共享许可协议 本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可;-)