Call-with-current-continuation (original) (raw)

About DBpedia

스킴 언어에서, call-with-current-continuation 함수, 줄여서 call/cc 함수는 제어 연산자로써 사용된다. 이 함수는 다른 여러 언어에서 채택되었다. call/cc는 함수 f를 그 유일한 인자로 받는데, 어떤 한 식안에서의 (call/cc f)는 바로 그 식의 현재 연속에 적용된다. 예를 들어 ((call/cc f) e2) 는 함수 f를 연속에 적용하는 것인데, 이 연속은 (call/cc f) 를 변수 c 로 바꾼 후, 식을 람다 추상화한 (lambda(c) (c e2)) 이다. 이것이 바로 현재 연속인데, 위 식의 결과는 이 연속에 함수 f 를 적용하는 것 (f (lambda (c) (c e2)) 이다. 보완적인 예로, 식 (e1 (call/cc f)) 에서, 하위식 (call/cc f) 을 위한 연속은 (lambda (c) (e1 c)) 인데, 이것은 (f (lambda (c) (e1 c))) 와 같다. 달리 말하자면, 현재 프로그램 제어 상태의 "스냅샷"을 하나의 개체로 취하고, 그것을 함수 f에 적용하는 것이다. 연속 개체는 일급 값이며 함수로 나타나는데, 그 유일한 기능은 함수 적용이다. 연속 개체가 인자에 적용될 때, 기존 연속은 제거되며, 적용된 연속이 프로그램의 흐름은 계속되어 연속이 잡혔던 자리에서 바로 들어서게 되고, 연속의 인자는 call/cc 호출의 반환값이 된다. call/cc에 의해 생성된 연속은 한 번 이상 호출될 수 있으며, call/cc 적용 범위 밖에서도 호출될 수 있다.

Property Value
dbo:abstract In the Scheme computer programming language, the procedure call-with-current-continuation, abbreviated call/cc, is used as a control flow operator. It has been adopted by several other programming languages. Taking a function f as its only argument, (call/cc f) within an expression is applied to the current continuation of the expression.For example ((call/cc f) e2) is equivalent to applying f to the current continuation of the expression. The current continuation is given by replacing (call/cc f) by a variable c bound by a lambda abstraction, so the current continuation is (lambda (c) (c e2)). Applying the function f to it gives the final result (f (lambda (c) (c e2))). As a complementary example, in an expression (e1 (call/cc f)), the continuation for the sub-expression (call/cc f) is (lambda (c) (e1 c)), so the whole expression is equivalent to (f (lambda (c) (e1 c))).In other words it takes a "snapshot" of the current control context or control state of the program as an object and applies f to it. The continuation object is a first-class value and is represented as a function, with function application as its only operation. When a continuation object is applied to an argument, the existing continuation is eliminated and the applied continuation is restored in its place, so that the program flow will continue at the point at which the continuation was captured and the argument of the continuation then becomes the "return value" of the call/cc invocation. Continuations created with call/cc may be called more than once, and even from outside the dynamic extent of the call/cc application. In computer science, making this type of implicit program state visible as an object is termed reification. (Scheme does not syntactically distinguish between applying continuations or functions.) With call/cc a variety of complex control operators can be implemented from other languages via a few lines of code, e.g., McCarthy's amb operator for nondeterministic choice, Prolog-style backtracking, Simula 67-style coroutines and generalizations thereof, Icon-style generators, or engines and threads or even the obscure COMEFROM. (en) 스킴 언어에서, call-with-current-continuation 함수, 줄여서 call/cc 함수는 제어 연산자로써 사용된다. 이 함수는 다른 여러 언어에서 채택되었다. call/cc는 함수 f를 그 유일한 인자로 받는데, 어떤 한 식안에서의 (call/cc f)는 바로 그 식의 현재 연속에 적용된다. 예를 들어 ((call/cc f) e2) 는 함수 f를 연속에 적용하는 것인데, 이 연속은 (call/cc f) 를 변수 c 로 바꾼 후, 식을 람다 추상화한 (lambda(c) (c e2)) 이다. 이것이 바로 현재 연속인데, 위 식의 결과는 이 연속에 함수 f 를 적용하는 것 (f (lambda (c) (c e2)) 이다. 보완적인 예로, 식 (e1 (call/cc f)) 에서, 하위식 (call/cc f) 을 위한 연속은 (lambda (c) (e1 c)) 인데, 이것은 (f (lambda (c) (e1 c))) 와 같다. 달리 말하자면, 현재 프로그램 제어 상태의 "스냅샷"을 하나의 개체로 취하고, 그것을 함수 f에 적용하는 것이다. 연속 개체는 일급 값이며 함수로 나타나는데, 그 유일한 기능은 함수 적용이다. 연속 개체가 인자에 적용될 때, 기존 연속은 제거되며, 적용된 연속이 프로그램의 흐름은 계속되어 연속이 잡혔던 자리에서 바로 들어서게 되고, 연속의 인자는 call/cc 호출의 반환값이 된다. call/cc에 의해 생성된 연속은 한 번 이상 호출될 수 있으며, call/cc 적용 범위 밖에서도 호출될 수 있다. (ko)
dbo:wikiPageExternalLink http://community.schemewiki.org/%3Fcall-with-current-continuation https://groups.google.com/group/comp.lang.lisp/msg/4e1f782be5ba2841 https://web.archive.org/web/20100525110918/http:/www.icsi.berkeley.edu/~nweaver/multitask.scm
dbo:wikiPageID 1064182 (xsd:integer)
dbo:wikiPageLength 13419 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID 1110924162 (xsd:integer)
dbo:wikiPageWikiLink dbr:Prolog dbr:Ruby_(programming_language) dbr:Scheme_(programming_language) dbr:Engine_(computer_science) dbr:Unlambda dbr:Intuitionistic_logic dbr:Peirce's_law dbr:Generator_(computer_programming) dbr:Continuation dbr:Continuation-passing_style dbr:Control_flow dbr:Coroutine dbr:Application_programming_interface dbc:Continuations dbc:Scheme_(programming_language) dbr:Simula dbr:Standard_ML dbr:Closure_(computer_programming) dbr:Computer_programming dbr:Delimited_continuation dbr:Function_application dbr:C++ dbr:C_(programming_language) dbc:Subroutines dbr:Curry–Howard_correspondence dbr:Goto dbr:Procedure_(computer_science) dbr:Reification_(computer_science) dbr:Return_statement dbr:Haskell_(programming_language) dbr:Backtracking dbr:John_McCarthy_(computer_scientist) dbr:Thread_(computing) dbr:Double_negation_elimination dbr:COMEFROM dbr:Classical_logic dbr:Fiber_(computer_science) dbr:Continuation_passing_style dbr:Icon_(programming_language) dbr:OCaml dbr:Operator_(computer_programming) dbr:Racket_(programming_language) dbr:Nondeterministic_programming dbr:First-class_value dbr:R_programming
dbp:wikiPageUsesTemplate dbt:Cn dbt:Lisp_programming_language dbt:Lowercase_title dbt:Reflist dbt:Short_description
dcterms:subject dbc:Continuations dbc:Scheme_(programming_language) dbc:Subroutines
gold:hypernym dbr:Operator
rdf:type dbo:Company yago:WikicatContinuations yago:WikicatSubroutines yago:Abstraction100002137 yago:Act100030358 yago:Activity100407535 yago:Code106355894 yago:CodingSystem106353757 yago:Communication100033020 yago:Continuance101017987 yago:Event100029378 yago:PsychologicalFeature100023100 yago:Writing106359877 yago:WrittenCommunication106349220 yago:YagoPermanentlyLocatedEntity yago:Routine106582403 yago:Software106566077
rdfs:comment 스킴 언어에서, call-with-current-continuation 함수, 줄여서 call/cc 함수는 제어 연산자로써 사용된다. 이 함수는 다른 여러 언어에서 채택되었다. call/cc는 함수 f를 그 유일한 인자로 받는데, 어떤 한 식안에서의 (call/cc f)는 바로 그 식의 현재 연속에 적용된다. 예를 들어 ((call/cc f) e2) 는 함수 f를 연속에 적용하는 것인데, 이 연속은 (call/cc f) 를 변수 c 로 바꾼 후, 식을 람다 추상화한 (lambda(c) (c e2)) 이다. 이것이 바로 현재 연속인데, 위 식의 결과는 이 연속에 함수 f 를 적용하는 것 (f (lambda (c) (c e2)) 이다. 보완적인 예로, 식 (e1 (call/cc f)) 에서, 하위식 (call/cc f) 을 위한 연속은 (lambda (c) (e1 c)) 인데, 이것은 (f (lambda (c) (e1 c))) 와 같다. 달리 말하자면, 현재 프로그램 제어 상태의 "스냅샷"을 하나의 개체로 취하고, 그것을 함수 f에 적용하는 것이다. 연속 개체는 일급 값이며 함수로 나타나는데, 그 유일한 기능은 함수 적용이다. 연속 개체가 인자에 적용될 때, 기존 연속은 제거되며, 적용된 연속이 프로그램의 흐름은 계속되어 연속이 잡혔던 자리에서 바로 들어서게 되고, 연속의 인자는 call/cc 호출의 반환값이 된다. call/cc에 의해 생성된 연속은 한 번 이상 호출될 수 있으며, call/cc 적용 범위 밖에서도 호출될 수 있다. (ko) In the Scheme computer programming language, the procedure call-with-current-continuation, abbreviated call/cc, is used as a control flow operator. It has been adopted by several other programming languages. In computer science, making this type of implicit program state visible as an object is termed reification. (Scheme does not syntactically distinguish between applying continuations or functions.) (en)
rdfs:label Call-with-current-continuation (en) Call-with-current-continuation (ko)
owl:sameAs freebase:Call-with-current-continuation yago-res:Call-with-current-continuation wikidata:Call-with-current-continuation dbpedia-ko:Call-with-current-continuation https://global.dbpedia.org/id/4eieh
prov:wasDerivedFrom wikipedia-en:Call-with-current-continuation?oldid=1110924162&ns=0
foaf:isPrimaryTopicOf wikipedia-en:Call-with-current-continuation
is dbo:wikiPageRedirects of dbr:Call/cc dbr:Call_with_current_continuation dbr:Callcc dbr:Continuation_object
is dbo:wikiPageWikiLink of dbr:S-algol dbr:Monad_(functional_programming) dbr:Continuation dbr:Continuation-passing_style dbr:Curry–Howard_correspondence dbr:T_(programming_language) dbr:J_operator dbr:Fiber_(computer_science) dbr:Call/cc dbr:Call_with_current_continuation dbr:Callcc dbr:Continuation_object
is foaf:primaryTopic of wikipedia-en:Call-with-current-continuation