From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id B7696BC6C for ; Wed, 3 Oct 2007 11:30:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAH/9AkfBAkMt/2dsb2JhbAA X-IronPort-AV: E=Sophos;i="4.21,223,1188770400"; d="scan'208";a="2316944" Received: from vega.fmf.uni-lj.si (HELO postar.fmf.uni-lj.si) ([193.2.67.45]) by mail2-smtp-roc.national.inria.fr with ESMTP; 03 Oct 2007 11:30:33 +0200 Received: from localhost (unknown [192.168.5.1]) by postar.fmf.uni-lj.si (Postfix) with ESMTP id CEAC8188B90; Wed, 3 Oct 2007 11:30:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at spam.fmf.uni-lj.si Received: from postar.fmf.uni-lj.si ([192.168.5.5]) by localhost (spam.fmf.uni-lj.si [192.168.5.1]) (amavisd-new, port 10024) with ESMTP id NRNmpqiouT9N; Wed, 3 Oct 2007 11:30:32 +0200 (CEST) Received: from [192.168.1.101] (BSN-77-148-136.static.dsl.siol.net [193.77.148.136]) (Authenticated sender: bauer) by postar.fmf.uni-lj.si (Postfix) with ESMTP id 7F2F0188B61; Wed, 3 Oct 2007 11:30:32 +0200 (CEST) Message-ID: <47036137.2000009@fmf.uni-lj.si> Date: Wed, 03 Oct 2007 11:30:31 +0200 From: Andrej Bauer Reply-To: Andrej.Bauer@andrej.com User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: oleg@pobox.com, caml-list@yquem.inria.fr Subject: Re: [Caml-list] Which control structure? References: <20071003080053.5B954A9A1@Adric.metnet.fnmoc.navy.mil> In-Reply-To: <20071003080053.5B954A9A1@Adric.metnet.fnmoc.navy.mil> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; andrej:01 andrej:01 oleg:01 delimited:01 bool:01 bool:01 delimited:01 swallow:98 wrote:01 caml-list:01 int:01 argument:02 functional:02 let:03 problem:05 oleg@pobox.com wrote: > In almost all useful circumstances call/cc appears in combination with > store -- which is a dead give-away that we are dealing with delimited > continuations. I suspected that much, and hoped for a reply from you :-) > The following code does compute (p false, p true) by > really entering p only once (but exiting it twice). Excellent, thank you. > The argument to p must be a thunk, so we are able to enter p, or to get p to swallow the > hook. This is not a problem because in my actual non-simplified problem p is a functional of type (int -> bool) -> bool. Now let me see if I can apply delimited continuations in the non-simplified version. Thank you again! Andrej