Non-local variable (original) (raw)
In programming language theory, a non-local variable is a variable that is not defined in the local scope. While the term can refer to global variables, it is primarily used in the context of nested and anonymous functions where some variables can be in neither the local nor the global scope. In Lua they are called the upvalues of the function.
Property | Value |
---|---|
dbo:abstract | En programlingvoj, neloka variablo (rilate al iu regiono R) estas variablo deklarita ekster la koncerna regiono (R), en iu pli vasta regiono (entenanta la regionon R). En multaj programlingvoj, kiaj C, neloka variablo povas esti nur malloka variablo; en aliaj lingvoj, ekz‑e la Algoloj, PL/I, Paskalo, Ĝavaskripto, Pitono, eblas pli profunda ingado de regionoj (interalie, ingitaj subprogramoj), kaj sekve interaj variabloj nelokaj, kies regiono estas malpli granda ol la malloka. Realan ekzemplon pri mallokaj variabloj donas la Reviziita Raporto pri Algolo 60, kie la proceduro RK (kiu integralas sistemon da diferencialaj ekvacioj per la metodo de Runge—Kutta) entenas lokan proceduron RK1P realigantan unuopan paŝon de integralado; tiu RK1P uzas ankaŭ la variablojn de la ĝin entenanta RK estkiel nelokajn variablojn: proceduro RK(x, y, n, fkt, eps, eta, xE, yE, Unue); valore x, y; entjera n; bulea Unue; reelaj x, eps, eta, xE; tabeloj y, yE; proceduro fkt; starto tabelo z, y1, y2, y3[1:n]; reelaj x1, x2, x3, H; bulea eksteren; entjeraj k, j; persistaj reelaj s, Hs; proceduro RK1P(x, y, h, xe, ye); reelaj x, h, xe; tabelo y, ye; komento : RK1P integralas unuopan paŝon de Runge-Kutta kun komencaj valoroj x, y[k]. Tio donas elirajn parametrojn xe=x+h kaj ye[k], kie la lasta estas la solvo je xe. G r a v a : La parametroj n, fkt, z aperas en RK1P kiel objektoj nelokaj; starto tabelo w[1:n], a[1:5]; entjeraj k,j; ......... por k := 1 paŝo 1 ĝis n faru ye[k] := w[k] := y[k]; por j := 1 paŝo 1 ĝis 4 faru starto fkt (xe,v,n,z); xe := x + a[j]; ...... fino; ......... fino RK1P; ........fino RK (eo) In programming language theory, a non-local variable is a variable that is not defined in the local scope. While the term can refer to global variables, it is primarily used in the context of nested and anonymous functions where some variables can be in neither the local nor the global scope. In Lua they are called the upvalues of the function. (en) |
dbo:wikiPageID | 33103837 (xsd:integer) |
dbo:wikiPageLength | 4001 (xsd:nonNegativeInteger) |
dbo:wikiPageRevisionID | 1087359297 (xsd:integer) |
dbo:wikiPageWikiLink | dbr:Compiler dbr:Closure_(computer_science) dbr:Anonymous_function dbr:Lua_(programming_language) dbr:Call_stack dbr:Programming_language_theory dbr:Activation_record dbr:Frame_pointer dbr:Global_variable dbr:Display_register dbr:Higher-order_function dbc:Programming_language_theory dbc:Variable_(computer_science) dbr:Global_scope dbr:Recursion_(computer_science) dbr:Scope_(computer_science) dbr:Nested_function dbr:Local_scope dbr:Compilers:_Principles,_Techniques,_&_Tools dbr:First-class_function dbr:Access_link |
dbp:wikiPageUsesTemplate | dbt:Reflist dbt:See_also dbt:Short_description |
dct:subject | dbc:Programming_language_theory dbc:Variable_(computer_science) |
gold:hypernym | dbr:Variable |
rdf:type | owl:Thing dbo:Star |
rdfs:comment | In programming language theory, a non-local variable is a variable that is not defined in the local scope. While the term can refer to global variables, it is primarily used in the context of nested and anonymous functions where some variables can be in neither the local nor the global scope. In Lua they are called the upvalues of the function. (en) En programlingvoj, neloka variablo (rilate al iu regiono R) estas variablo deklarita ekster la koncerna regiono (R), en iu pli vasta regiono (entenanta la regionon R). En multaj programlingvoj, kiaj C, neloka variablo povas esti nur malloka variablo; en aliaj lingvoj, ekz‑e la Algoloj, PL/I, Paskalo, Ĝavaskripto, Pitono, eblas pli profunda ingado de regionoj (interalie, ingitaj subprogramoj), kaj sekve interaj variabloj nelokaj, kies regiono estas malpli granda ol la malloka. (eo) |
rdfs:label | Neloka variablo (eo) Non-local variable (en) |
rdfs:seeAlso | dbr:Nested_function |
owl:sameAs | freebase:Non-local variable wikidata:Non-local variable dbpedia-eo:Non-local variable dbpedia-vi:Non-local variable https://global.dbpedia.org/id/4sp8T |
prov:wasDerivedFrom | wikipedia-en:Non-local_variable?oldid=1087359297&ns=0 |
foaf:isPrimaryTopicOf | wikipedia-en:Non-local_variable |
is dbo:wikiPageRedirects of | dbr:Non-local_object dbr:Non-local_reference dbr:Nonlocal_reference dbr:Nonlocal_variable |
is dbo:wikiPageWikiLink of | dbr:Non-local_object dbr:Non-local_reference dbr:Nonlocal_reference dbr:Nonlocal dbr:Free_variables_and_bound_variables dbr:Local_variable dbr:Global_variable dbr:Pure_function dbr:Referential_transparency dbr:Scope_(computer_science) dbr:Side_effect_(computer_science) dbr:Variable_(computer_science) dbr:Nested_function dbr:Nonlocal_variable dbr:First-class_function |
is foaf:primaryTopic of | wikipedia-en:Non-local_variable |