Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 872329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:46:10+00:00 2026-05-15T10:46:10+00:00

Here it is a strange function in Scheme: (define f (call/cc (lambda (x) x)

  • 0

Here it is a strange function in Scheme:

(define f
(call/cc
(lambda (x) x) ) )

(((f ‘f) f) 1 )

When f is called in the command line, the result displayed is f .
What is the explanation of this mechanism ?..

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:46:10+00:00Added an answer on May 15, 2026 at 10:46 am

    You’ve just stumbled upon ‘continuations’, possibly the hardest thing of Scheme to understand.

    call/cc is an abbreviation for call-with-current-continuation, what the procedure does is it takes a single argument function as its own argument, and calls it with the current ‘continuation’.

    So what’s a continuation? That’s infamously hard to explain and you should probably google it to get a better explanation than mine. But a continuation is simply a function of one argument, whose body represents a certain ‘continuation’ of a value.

    Like, when we have (+ 2 (* 2 exp)) with exp being a random expression, if we evaluate that expression there is a ‘continuation’ waiting for that result, a place where evaluation continues, if it evaluates to 3 for instance, it inserts that value into the expression (* 2 3) and goes on from there with the next ‘continuation’, or the place where evaluation continues, which is (+ 2 ...).

    In almost all contexts of programming languages, the place where computation continues with the value is the same place as it started, though the return statement in many languages is a key counterexample, the continuation is at a totally different place than the return statement itself.

    In Scheme, you have direct control over your continuations, you can ‘capture’ them like done there. What f does is nothing more than evaluate to the current continuation, after all, when (lambda (x) x) is called with the current continuation, it just evaluates to it, so the entire function body does. As I said, continuations are functions themselves whose body can just be seen as the continuation they are to capture, which was famously shown by the designers of Scheme, that continuations are simply just lambda abstractions.

    So in the code f first evaluates to the continuation it was called in. Then this continuation as a function is applied to 'f (a symbol). This means that that symbol is brought back to that continuation, where it is evaluated again as a symbol, to reveal the function it is bound to, which again is called with a symbol as its argument, which is finally displayed.

    Kind of mind boggling, if you’ve seen the film ‘primer’, maybe this explains it:

    http://thisdomainisirrelevant.net/1047

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 523k
  • Answers 523k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer No. You cannot assume that an app tested on one… May 16, 2026 at 9:38 pm
  • Editorial Team
    Editorial Team added an answer This might be what you are looking for: SnuggleTeX From… May 16, 2026 at 9:38 pm
  • Editorial Team
    Editorial Team added an answer Was able to do this by using [myWebView endEditing:YES] May 16, 2026 at 9:38 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

EDIT - The code looks strange here, so I suggest viewing the files directly
My so far not-so-bad version to implement this is: function bashFileConvert($file) { return preg_replace('/([^\/\s]+\s+[^\/]+)(\/|$)/','${1}${2}',$file);
Here's a strange question for you guys, I have a nice sorted list that
Bumped into a strange situation here. Trying to extract cars from a sql database
Hi I have a strange situation here: # Is there a semantic difference between
I have a feeling my problem is a bit strange, but here goes... I
I don't know if the title explains it very well, so here's what I'm
I'm following this tutorial: http://www.javascripttoolbox.com/jquery/ And I'm trying to get table rows that are
I just read this question and this question , and since then I have
For a strange reason I cannot find the way to specify spines configuration in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.