slovo | definícia |
call/cc (foldoc) | call-with-current-continuation
call/cc
(call/cc) A Lisp control function that
implements the continuation passing style of programming.
In continuation passing style (CPS), every function f takes an
extra final argument k called the "continuation". The
continuation is itself a function and represents the rest of the
program. Instead of just returning a value in the normal way, f
passes it as an argument to k and returns the result of that.
call/cc takes a function f as its argument and calls f, passing it
the current continuation k. It thus allows a CPS function to be
called in a non-CPS (direct) context.
For example, if the final result is to print the value returned by
call/cc then anything passed to k will also be printed.
E.g, in Scheme:
(define (f k)
(k 1)
(k 2)
3)
(display (call-with-current-continuation f))
Will display 1.
[Is this correct?]
(2014-09-24)
|
| |
Nenašli ste slovo čo ste hľadali ? Doplňte ho do slovníka.
na vytvorenie tejto webstránky bol pužitý dictd server s dátami z sk-spell.sk.cx a z iných voľne dostupných dictd databáz. Ak máte klienta na dictd protokol (napríklad kdict), použite zdroj slovnik.iz.sk a port 2628.
online slovník, sk-spell - slovníkové dáta, IZ Bratislava, Malé Karpaty - turistika, Michal Páleník, správy, údaje o okresoch V4