Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Ruby
def square(x)
  x*x
end

The last expression is returned by default.
def square(x) = x*x

Ruby 3.0
function Square (X : Integer) return Integer is
begin
   return X * X;
end Square;

New implementation...
< >
programming-idioms.org