This language bar is your friend. Select your favorite languages!
typedef struct {
  double x;
  double y;
} Point;
struct Point {
  double x;
  double y;
};
type Point is
   record
      X : Float;
      Y : Float;
   end record;
typedef struct {
  double x;
  double y;
} Point;
[x y]
struct Point
        {
            public double x;
            public double y;
        };
class Point
{
    float x;
    float y;
}
struct Point{
    double x;
    double y;
}

    
class Point {
  double x, y;
  Point(this.x, this.y);
}
class Point {
  double x, y;
}
p = [ x: 1.122, y: 7.45 ]
PointAsATuple = {X, Y}.
-module(points).
-export([new/2, x/1, y/1]).

-opaque point() :: #{x => float(), y => float()}.
-export_type([point/0]).

-spec new(float(), float()) -> point().
new(X, Y) -> #{x => X, y => Y}.

-spec x(point()) -> float().
x(#{x := X}) -> X.

-spec y(point()) -> float().
y(#{y := Y}) -> Y.
PointAsAMap = #{x => X, y => Y}.
type point
  real(kind=8) :: x
  real(kind=8) :: y
end type point
type Point struct {
    x, y float64
}
data Point = Point
  { x :: Double
  , y :: Double
  } deriving (Eq,Ord,Show,Read)
data Point = Point 
  { x :: Double
  , y :: Double 
  }
var p = { x: 1.122, y: 7.45 };
class Point{
  double x;
  double y;
}
point = { x = 123, y = 456 }
<?php

class Point{
    public $x = 0.0;
    public $y = 0.0;
}
Type
  TPoint = Record
    x : Double;
    y : Double;
  End;
my $point = { x=>1.5, y=>6.3 };
my $point = [ 1.5, 6.3 ];
from collections import namedtuple
Point = namedtuple('Point', ['x', 'y'])
Point = Struct.new(:x, :y)
struct Point { x: f64, y: f64, }
case class Point(x: Float, y: Float)
(define (make-point x y)
  (cons x y))
(define (point-x p)
  (car p))
(define (point-y p)
  (cdr p))

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org