-
Notifications
You must be signed in to change notification settings - Fork 2
Here
Bill Hails edited this page Nov 23, 2018
·
7 revisions
The special function here takes a function of one argument and passes it the current continuation as a function
so that calling the current continuation is equivalent to returning through here.
An example may make this clearer:
here(
fn(ret) {
if (ret(3)) {
4
} else {
5
}
}
);
returns 3. The continuation is first class like any other function and can be passed to other functions,
stored in variables, called later etc. The type of here is ((#a -> #b) -> #a) -> #a), see Type Notation for a discussion of this notation.
hereis calledcall-with-current-continuation, orcall/ccin other languages.
Up: Home
Next: Spawn
PyScheme, AKA F-Natural