Store-passing style (original) (raw)
存储传递风格是一种技术,用来建模可变而不用使用全局变量。它通常出现在将指令式程序转换成纯函数式程序的场合。
Property | Value |
---|---|
dbo:abstract | Store-passing style is a programming technique that is used to model mutable state without using mutable state. It generally arises in the conversion of imperative programs into purely functional ones. So, for instance, consider this JavaScript program, written in a non-store-passing-style: var lastWasA = false// a treebin represents a binary tree of strings.// a treebin is either// - a string, or// - {l : , r: }// does an in-order traversal of this tree's// leaves contain an 'a' followed by a 'b'?function aThenB(treebin) { if (typeof(treebin) === "string") { if (treebin === "a") { lastWasA = true; return false; } else if (treebin === "b") { if (lastWasA) { return true; } else { lastWasA = false; return false; } } else { lastWasA = false; return false; } } else { // not a string, must be an internal node: return ((aThenB(treebin.l))| |
dbo:wikiPageID | 49387218 (xsd:integer) |
dbo:wikiPageLength | 3088 (xsd:nonNegativeInteger) |
dbo:wikiPageRevisionID | 1120237768 (xsd:integer) |
dbo:wikiPageWikiLink | dbr:Continuation-passing_style dbr:State_(computer_science) dbc:Functional_programming dbr:Global_variable dbr:Purely_functional_programming dbr:JavaScript dbc:Software_design_patterns dbr:Imperative_programming dbr:Parallelizable |
dbp:wikiPageUsesTemplate | dbt:Reflist dbt:Short_description |
dct:subject | dbc:Functional_programming dbc:Software_design_patterns |
gold:hypernym | dbr:Technique |
rdf:type | dbo:TopicalConcept |
rdfs:comment | 存储传递风格是一种技术,用来建模可变而不用使用全局变量。它通常出现在将指令式程序转换成纯函数式程序的场合。 (zh) Store-passing style is a programming technique that is used to model mutable state without using mutable state. It generally arises in the conversion of imperative programs into purely functional ones. So, for instance, consider this JavaScript program, written in a non-store-passing-style: This contains a reference to a global variable. In store-passing style, the value of the global variable (or variables) is passed along to each call, and also returned from each call and threaded through the next call. The code might look like this: (en) |
rdfs:label | Store-passing style (en) 存储传递风格 (zh) |
owl:sameAs | yago-res:Store-passing style wikidata:Store-passing style dbpedia-hu:Store-passing style dbpedia-zh:Store-passing style https://global.dbpedia.org/id/2PHo3 |
prov:wasDerivedFrom | wikipedia-en:Store-passing_style?oldid=1120237768&ns=0 |
foaf:isPrimaryTopicOf | wikipedia-en:Store-passing_style |
is dbo:wikiPageWikiLink of | dbr:Essentials_of_Programming_Languages dbr:Purely_functional_data_structure dbr:Purely_functional_programming |
is foaf:primaryTopic of | wikipedia-en:Store-passing_style |