home > 比較編 > Perl, PHP, Python, Ruby > dictionaries >

ForNext

Only Do What Only You Can Do

133. merge

VBScript

JScript

Perl

%d1 = (a=>1, b=>2);
%d2 = (b=>3, c=>4);
%d1 = (%d1, %d2);

PHP

$d1 = array("a"=>1, "b"=>2);
$d2 = array("b"=>3, "c"=>4);
$d1 = array_merge($d1, $d2);

Python

d1 = {'a':1, 'b':2}
d2 = {'b':3, 'c':4}
d1.update(d2)

Ruby

d1 = {"a"=>1, "b"=>2}
d2 = {"b"=>3, "c"=>4}
d1.merge!(d2)

PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system