kazuyamaa/multi-language-messages-01 huggingface dataset:
Task: Triplet of three numbers
C++: #include <iostream>
#include <vector>

constexpr unsigned int LIMIT = 6000;

std::vector<bool> primes(unsigned int limit) {
    std::vector<bool> p(limit + 1, true);
    unsigned int root = std::sqrt(limit);

    p[0] = false;
    p[1] = false;

    for (size_t i = 2; i <= root; i++) {
        if (p[i]) {
            for (size_t j = 2 * i; j <= limit; j += i) {
                p[j] = false;
            }
        }
    }

    return p;
}

bool triplet(const std::vector<bool> &p, unsigned int n) {
    return n >= 2 && p[n - 1] && p[n + 3] && p[n + 5];
}

int main() {
    std::vector<bool> p = primes(LIMIT);

    for (size_t i = 2; i < LIMIT; i++) {
        if (triplet(p, i)) {
            printf("%4d: %4d, %4d, %4d\n", i, i - 1, i + 3, i + 5);
        }
    }

    return 0;
}

Python: 

N = 6000
p = [None] * 6000  

for i in range(2, round(pow(N,0.5))):
    if not p[i]:
        for j in range(i*2, N, i):
            p[j] = 1


for i in range(3, N):
    if (p[i-1] or p[i+3] or p[i+5]):
        continue
    else:
        print(i, ': ', i-1,  ' ', i+3,  ' ', i+5)
Task: Triplet of three numbers
C#: using System; using System.Collections.Generic; using System.Linq;
using T3 = System.Tuple<int, int, int>; using static System.Console;
class Program { static void Main() {
   WriteLine(" \"N\":  Prime Triplet    Adjacent (to previous)\n" +
             " ---- ----------------- -----------------------");
   foreach(var lmt in new double[]{6e3, 1e5, 1e6, 1e7, 1e8}) {
    var pr = PG.Primes((int)lmt); int l = 0, c = 0; bool a;
    foreach (var t in pr) { c += (a = l == t.Item1) ? 1 : 0;
      if (lmt < 1e5) WriteLine("{0,4}: {1,-18} {2}",
        t.Item1 + 1, t, a ? " *" : ""); l = t.Item3; }
    Console.WriteLine ("Up to {0:n0} there are {1:n0} prime triples, " +
      "of which {2:n0} were found to be adjacent.", lmt, pr.Count(), c); } } }

class PG { static bool[] f; static bool isPrT(int x, int y, int z) {
  if (x < 7) return false; return !f[x] && !f[y] && !f[z]; }
  public static IEnumerable<T3> Primes(int l) { f = new bool[l += 6];
  int j, lj, llj, lllj; j = lj = llj = lllj = 3;
  for (int d = 8, s = 9; s < l; lllj = llj, llj = lj, lj = j, j += 2, s += d += 8)
    if (!f[j]) { if (isPrT(lllj, lj, j)) yield return new T3(lllj, lj, j);
      for (int k = s, i = j << 1; k < l; k += i) f[k] = true; }
  for (; j < l; lllj = llj, llj = lj, lj = j, j += 2)
   if (isPrT(lllj, lj, j)) yield return new T3(lllj, lj, j); } }

Go: package main

import (
    "fmt"
    "rcu"
)

func main() {
    c := rcu.PrimeSieve(6003, false)
    var numbers []int
    fmt.Println("Numbers n < 6000 where: n - 1, n + 3, n + 5 are all primes:")
    for n := 4; n < 6000; n += 2 {
        if !c[n-1] && !c[n+3] && !c[n+5] {
            numbers = append(numbers, n)
        }
    }
    for _, n := range numbers {
        fmt.Printf("%6s  => ", rcu.Commatize(n))
        for _, p := range []int{n - 1, n + 3, n + 5} {
            fmt.Printf("%6s ", rcu.Commatize(p))
        }
        fmt.Println()
    }
    fmt.Printf("\n%d such numbers found.\n", len(numbers))
}
Task: Triplet of three numbers
C#: using System; using System.Collections.Generic; using System.Linq;
using T3 = System.Tuple<int, int, int>; using static System.Console;
class Program { static void Main() {
   WriteLine(" \"N\":  Prime Triplet    Adjacent (to previous)\n" +
             " ---- ----------------- -----------------------");
   foreach(var lmt in new double[]{6e3, 1e5, 1e6, 1e7, 1e8}) {
    var pr = PG.Primes((int)lmt); int l = 0, c = 0; bool a;
    foreach (var t in pr) { c += (a = l == t.Item1) ? 1 : 0;
      if (lmt < 1e5) WriteLine("{0,4}: {1,-18} {2}",
        t.Item1 + 1, t, a ? " *" : ""); l = t.Item3; }
    Console.WriteLine ("Up to {0:n0} there are {1:n0} prime triples, " +
      "of which {2:n0} were found to be adjacent.", lmt, pr.Count(), c); } } }

class PG { static bool[] f; static bool isPrT(int x, int y, int z) {
  if (x < 7) return false; return !f[x] && !f[y] && !f[z]; }
  public static IEnumerable<T3> Primes(int l) { f = new bool[l += 6];
  int j, lj, llj, lllj; j = lj = llj = lllj = 3;
  for (int d = 8, s = 9; s < l; lllj = llj, llj = lj, lj = j, j += 2, s += d += 8)
    if (!f[j]) { if (isPrT(lllj, lj, j)) yield return new T3(lllj, lj, j);
      for (int k = s, i = j << 1; k < l; k += i) f[k] = true; }
  for (; j < l; lllj = llj, llj = lj, lj = j, j += 2)
   if (isPrT(lllj, lj, j)) yield return new T3(lllj, lj, j); } }

Python: 

N = 6000
p = [None] * 6000  

for i in range(2, round(pow(N,0.5))):
    if not p[i]:
        for j in range(i*2, N, i):
            p[j] = 1


for i in range(3, N):
    if (p[i-1] or p[i+3] or p[i+5]):
        continue
    else:
        print(i, ': ', i-1,  ' ', i+3,  ' ', i+5)
Task: Triplet of three numbers
Go: package main

import (
    "fmt"
    "rcu"
)

func main() {
    c := rcu.PrimeSieve(6003, false)
    var numbers []int
    fmt.Println("Numbers n < 6000 where: n - 1, n + 3, n + 5 are all primes:")
    for n := 4; n < 6000; n += 2 {
        if !c[n-1] && !c[n+3] && !c[n+5] {
            numbers = append(numbers, n)
        }
    }
    for _, n := range numbers {
        fmt.Printf("%6s  => ", rcu.Commatize(n))
        for _, p := range []int{n - 1, n + 3, n + 5} {
            fmt.Printf("%6s ", rcu.Commatize(p))
        }
        fmt.Println()
    }
    fmt.Printf("\n%d such numbers found.\n", len(numbers))
}

Python: 

N = 6000
p = [None] * 6000  

for i in range(2, round(pow(N,0.5))):
    if not p[i]:
        for j in range(i*2, N, i):
            p[j] = 1


for i in range(3, N):
    if (p[i-1] or p[i+3] or p[i+5]):
        continue
    else:
        print(i, ': ', i-1,  ' ', i+3,  ' ', i+5)
Task: Triplet of three numbers
C: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define LIMIT 6000

char *primes(unsigned int limit) {
    char *p = malloc(limit + 1);
    int i, j, sqr = sqrt(limit);
    
    p[0] = p[1] = 0;
    memset(p+2, 1, limit-1);
    for (i=2; i<=sqr; i++)
        if (p[i])
            for (j=i*2; j<=limit; j+=i)
                p[j] = 0;
            
    return p;
}

int triplet(const char *p, unsigned int n) {
    return n >= 2 && p[n-1] && p[n+3] && p[n+5];
}

int main() {
    char *p = primes(LIMIT+5);
    int i;
    
    for (i=2; i<LIMIT; i++)
        if (triplet(p, i))
            printf("%4d: %4d, %4d, %4d\n", i, i-1, i+3, i+5);
    
    free(p);
    return 0;
}

Go: package main

import (
    "fmt"
    "rcu"
)

func main() {
    c := rcu.PrimeSieve(6003, false)
    var numbers []int
    fmt.Println("Numbers n < 6000 where: n - 1, n + 3, n + 5 are all primes:")
    for n := 4; n < 6000; n += 2 {
        if !c[n-1] && !c[n+3] && !c[n+5] {
            numbers = append(numbers, n)
        }
    }
    for _, n := range numbers {
        fmt.Printf("%6s  => ", rcu.Commatize(n))
        for _, p := range []int{n - 1, n + 3, n + 5} {
            fmt.Printf("%6s ", rcu.Commatize(p))
        }
        fmt.Println()
    }
    fmt.Printf("\n%d such numbers found.\n", len(numbers))
}
Task: Named parameters
C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}

C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};
Task: Named parameters
C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}

Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }
Task: Named parameters
C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}

Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters
C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};

Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}
Task: Named parameters
C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};

Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }
Task: Named parameters
C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};

Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters
C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};

VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters
Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }

Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters
Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }

VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters
Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}

Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5)
Task: Named parameters
Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}

VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters
Python: def subtract(x, y):
    return x - y

subtract(5, 3)         
subtract(y = 3, x = 5) 

VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters
C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}

Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}
Task: Named parameters
Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}

Java: module NamedParams
    {
    const Point(Int x, Int y)
        {
        Point with(Int? x=Null, Int? y=Null)
            {
            return new Point(x ?: this.x, y ?: this.y);
            }
        }

    @Inject Console console;

    void run()
        {
        Point origin = new Point(0, 0);
        console.print($"origin={origin}");
        Point moveRight = origin.with(x=5);
        console.print($"moveRight(x=5)={moveRight}");
        Point moveUp    = moveRight.with(y=3);
        console.print($"moveUp(y=3)={moveUp}");
        }
    }
Task: Named parameters
C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}

VB: Public Function timedelta(Optional weeks As Integer = 0, Optional days As Integer = 0, _
    Optional hours As Integer = 0, Optional minutes As Integer = 0, Optional seconds As Integer = 0, _
    Optional milliseconds As Integer = 0, Optional microseconds As Integer = 0) As Variant
End Function
Public Sub main()
    
    fourdays = timedelta(days:=4)
    
    
    oneday = timedelta(days = 1) 
                                        
                                        
    Dim hours As Integer
    shift = timedelta(hours:=hours) 
    
                                 
End Sub
Task: Named parameters
C: #include <stdio.h>



typedef struct { int x, y, z; } FTest_args;

void FTest (FTest_args args) {
	printf("x: %d, y: %d, z: %d\n", args.x, args.y, args.z);
}

#define FT(...) FTest((FTest_args){ __VA_ARGS__ })




#define DFT(...) FTest((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })




void FTest2 (int x, int y, int z) {
	printf("x: %d, y: %d, z: %d\n", x, y, z);
}

static inline void FTest2_default_wrapper (FTest_args args) {
	return FTest2(args.x, args.y, args.z);
}

#define DF2(...) FTest2_default_wrapper((FTest_args){ .x = 142, .y = 143, .z = 144, __VA_ARGS__ })


int main(int argc, char **argv)
{
	
	FTest((FTest_args){ .y = 10 });
	FTest((FTest_args){ .y = 10, .z = 42 });
	FT( .z = 47, .y = 10, .x = 42 );

	
	DFT();
	DFT( .z = 99 );

	
	DF2();
	DF2( .z = 99 );

	return 0;
}

PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);
Task: Named parameters
C++: class foo_params{
	friend void foo(foo_params p);
public:
    foo_params(int r):
        required_param_(r),
	optional_x_(0),
	optional_y_(1),
	optional_z_(3.1415)
	{}
     foo_params& x(int i){
	optional_x_=i;
	return *this;
     }
     foo_params& y(int i){
	optional_y_=i;
	return *this;
     }
     foo_params& z(float f){
	optional_z_=f;
	return *this;
     }
private:
        int 	required_param_;
	int 	optional_x_;
	int 	optional_y_;
	float 	optional_z_;
};

PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);
Task: Named parameters
Go: package main

import (
   "fmt"
)

type params struct {x, y, z int}

func myFunc(p params) int {
    return p.x + p.y + p.z
}

func main() {
    r := myFunc(params{x: 1, y: 2, z: 3}) 
    fmt.Println("r =", r)
    s := myFunc(params{z: 3, y: 2, x: 1}) 
    fmt.Println("s =", s)
    t := myFunc(params{y: 2})             
    fmt.Println("t =", t)
}

PHP: function named($args) {
  $args += ["gbv" => 2,
            "motor" => "away",
            "teenage" => "fbi"];
  echo $args["gbv"] . " men running " . $args['motor'] . " from the " . $args['teenage'];
}

named(["teenage" => "cia", "gbv" => 10]);