Deutsch English Français Italiano |
<v74ceo$tuk4$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.arch Subject: Re: Continuations Date: Mon, 15 Jul 2024 23:47:36 -0000 (UTC) Organization: A noiseless patient Spider Lines: 20 Message-ID: <v74ceo$tuk4$1@dont-email.me> References: <v6tbki$3g9rg$1@dont-email.me> <memo.20240713174208.14216G@jgd.cix.co.uk> <v6v3fn$3povk$10@dont-email.me> <4j389jlb44kuhi3o5igf8ucnks3q9m3lc8@4ax.com> <v714in$1foh$2@gal.iecc.com> <lfims1Fl57mU1@mid.individual.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 16 Jul 2024 01:47:36 +0200 (CEST) Injection-Info: dont-email.me; posting-host="55f74b4ae2f116c131f41dc172ef4daf"; logging-data="981636"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rQmjxzsLNPtCNLx9j2JIZ" User-Agent: Pan/0.158 (Avdiivka; ) Cancel-Lock: sha1:g4wv9smrPsXTlIXoKISBBYB/lTc= Bytes: 2168 On Sun, 14 Jul 2024 22:22:41 +0300, Niklas Holsti wrote: > I think of continuation passing as always ending a subprogram by calling > some other subprogram, passing it one or more "continuation" subprograms > as parameters, and expecting that callee to do something and then to > "continue" by further calling one of those "continuations" (with further > "continuation" parameters) and NOT to return to the original caller, > ever. That’s the most general case. But it makes sense to have simpler conventions for common cases, like subroutine call/return. So a subroutine call implicitly passes a continuation that, when invoked, resumes the caller. And the subroutine block can end with an implicit invocation of this continuation. And such continuation objects are so common that it makes sense, as an optimization, to have a special place to allocate them in LIFO fashion--call it a “stack”. You may have heard some people talk about “tree-like stacks”. This is starting to generalize from simple linear stacks to fully general continuations.