Lus yog
Xeem chav kawm {
static muaj nuj nqi main() {
cov neeg kawg = [
"Elizabeth" => "Programming",
"Joel" => "Tsim"
];
rau (npe => hauj lwm hauv tib neeg) {
trace('$name does $job for a living!');
}
}
}
Cov yam ntxwv tshiab hauv version 4.1:
- Ntxiv tail recursion optimization.
- Ntxiv ib qho API tshiab rau kev sib koom ua ke.
- Lub construct "sim {} catch(e) {}" yog tso cai raws li ib tug shorthand rau "sim {} catch(e: haxe.Exception) {}".
- Ntxiv kev txhawb nqa SSL rau tus neeg txhais lus evas.
- Lub hom phiaj JVM tsis suav tias yog kev sim ntxiv lawm.
- Rau Language Server Protocol, kev txhawb nqa rau "Goto Implementation" thiab "Nrhiav references" functions tau ntxiv.
- Txhim kho lub npe ntawm cov hloov pauv hauv zos ib ntus hauv cov lej tsim tawm. Tshem tawm redundant "rov qab;" hauv xub ua haujlwm yam tsis muaj nqi rov qab.
- Kev nkag mus ua ke (tau, default) raug tso cai rau ntawm thaj chaw (getter nkaus xwb, tus cwj pwm ua haujlwm ua ntej).
- Tso cai increment and decrement operators for fields
hom abstract . - Txhim kho inlining ntawm rau loops siv anonymous iterators.
- js: Txhim kho StringMap kev siv rau ES5.
- js: Generation of let variables has been added to the compiler option β-D js-es=6β, tiam ntawm ES6 chav kawm tau raug txhim kho.
- lua: "StringIterator" optimized, ua yuam kev tuav txhim kho.
- php: Optimized "Std.isOfType" rau hom pib.
- php: Generated arrays tam sim no siv cov haiv neeg interfaces "Iterator", "IteratorAggregate", "Countable".
- cs: Ntxiv metadata "@:assemblyMeta" thiab "@:assemblyStrict".
- python: ntxiv kev siv "__contains__" rau cov khoom tsis qhia npe
thiab "__getitem__", uas tso cai rau lawv siv raws li phau ntawv txhais lus hauv cov cai tsim tawm. - jvm: Txhim kho kev ua tau zoo ua tsaug rau txoj hauv kev tshiab ntawm kev nkag mus rau cov haujlwm ntaus ntawv thiab tsim cov kev cuam tshuam ntxiv rau hauv cov xwm txheej uas cov khoom siv los ua cov qauv tsis qhia npe (kev saib xyuas cov cuab yeej muaj zog tiv thaiv):
Kev txhim kho hauv cov tsev qiv ntawv txheem:
- Ntxiv "Array.contains" muaj nuj nqi.
- Ntxiv "Array.keyValueIterator", uas siv cov ntsiab lus tseem ceeb rau arrays ("rau (tus yuam sij => tus nqi hauv array)").
- Ntxiv txwv hom "haxe.Constraints.NotVoid".
- Cov haujlwm "findIndex" thiab "foldi" tau ntxiv rau "Lambda" chav kawm.
- Siv "array access" (access ntawm "arr[i]") thiab key-value iteration rau "haxe.ds.HashMap".
- jvm: Implemented JVM-specific versions of "StringMap", "sys.thread.Lock", "sys.thread.Thread".
- java/jvm: Siv ib txwm siv ntawm "MD5", "SHA-1" thiab "SHA-256" rau "haxe.crypto" modules.
- macro: Ntxiv "haxe.macro.Context.containsDisplayPosition(pos)".
- nullsafety: "Strict" hom yog tam sim no kho raws li ib leeg threaded; ntxiv "StrictThreaded" hom.
- "Std.is" tau deprecated nyob rau hauv txaus siab ntawm "Std.isOfType".
- Ntxiv cov lus ceeb toom thaum siv cov hloov pauv hauv zos yam tsis muaj txiaj ntsig hauv kev kaw.
- js: "untyped __js__(code, args)" yog deprecated, hloov los ntawm "js.Syntax.code(code, args)".
- php/neko: "neko.Web" thiab "php.Web" tau deprecated thiab yuav raug tsiv mus rau lub tsev qiv ntawv "hx4compat" tom qab.
Hauv kev tso tawm tom ntej
- Kev txhim kho pob neeg saib xyuas
haxelib . - Asynchronous system API raws li
libuv . - Coroutines.
- Tshaj tawm modular static functions thiab variables tsis tsim cov chav kawm (twb muaj nyob rau hauv nightly builds).
Tau qhov twg los: opennet.ru