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)