AnyLang 编程语言比较/变量和数据结构
外观
变量可以组合成复合数据结构。数据结构在主流编程语言中非常有用且常见,它们遵循普遍认可的模式,这些模式可以被记录并重复使用。[1][2]
(也称为 simpletable_aoh [数组的哈希])
(也称为 simpletable_aod [数组的字典])
此复合数据结构适用于在大多数编程语言中表示一系列行和列。[3] AoH 代表“数组的哈希”。[4]
var mytable_aoh = [
{ "fname":"fred" , "lname":"flintstone" , "age":"33" , "sex":"male" , "motto":"yabbadabbadoo" }
,{ "fname":"wilma" , "lname":"flintstone" , "age":"28" , "sex":"female" , "motto":"" }
,{ "fname":"barney" , "lname":"rubble" , "age":"32" , "sex":"male" , "motto":"hiya fred!" }
,{ "fname":"Fred" , "lname":"Astaire" , "age":"76" , "sex":"male" , "motto":"Dancing is a sweat job" }
];
$mytable_aoh = Array(
Array( 'lname' => 'Simpson' ,'fname' => 'Homer' ,'age' => '35' ,'motto' => '_blank_' )
,Array( 'lname' => 'Simpson' ,'fname' => 'Marge' ,'age' => '34' ,'motto' => '_blank_' )
,Array( 'lname' => 'Flintstone' ,'fname' => 'Fred' ,'age' => '33' ,'motto' => '_blank_' )
,Array( 'lname' => 'John' ,'fname' => 'Doe' ,'age' => '0' ,'motto' => '_blank_' )
,Array( 'lname' => 'Flintstone' ,'fname' => 'Wilma' ,'age' => '29' ,'motto' => '_blank_' )
);
行使用无序的名称-值对序列表示(也称为字典、哈希、对象)。
(也称为 simpletable_aos [数组的序列])
这是一种表结构,适用于在大多数编程语言中表示一系列行和列。[5]
var mytable_aoa = [
[ "fname" , "lname" , "age" , "sex" , "motto" ]
,[ "fred" , "flintstone" , "33" , "male" , "yabbadabbadoo" ]
,[ "wilma" , "flintstone" , "28" , "female" , "" ]
,[ "barney" , "rubble" , "32" , "male" , "hiya fred!" ]
,[ "Fred" , "Astaire" , "76" , "male" , "Dancing is a sweat job" ]
];
行使用有序的值序列表示(也称为数组、列表)。
- ↑ 参见例如,"Perl Data Structures Cookbook". Retrieved 2010-01-15 09:34:53.
{{cite web}}
: Check date values in:|accessdate=
(help) Perl Data Structures Cookbook - ↑ Christiansen, Tom (2003). Perl Cookbook. Boston: Twayne Publishers. ISBN 0596003137.
- ↑ 此结构的搜索指纹为 gem_hypo_kinds_yuzovka_aoh。
- ↑ 此术语在 Perl 中使用,其中“哈希”是“字典”数组的另一个术语。
- ↑ 此结构的搜索指纹为 gem_hypo_kinds_yuzovka_aoa。