From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user Subject: call/cc does not return a value Date: Fri, 13 Sep 2024 08:52:18 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38990"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Sep 13 08:53:54 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sp0Bl-000A5Q-Jj for guile-user@m.gmane-mx.org; Fri, 13 Sep 2024 08:53:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sp0B2-00079W-IT; Fri, 13 Sep 2024 02:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sp0AU-00077Z-4n for guile-user@gnu.org; Fri, 13 Sep 2024 02:53:06 -0400 Original-Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sp0AS-00052j-DF for guile-user@gnu.org; Fri, 13 Sep 2024 02:52:33 -0400 Original-Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-7a9ad8a7c63so62305485a.3 for ; Thu, 12 Sep 2024 23:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726210350; x=1726815150; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Agts9lVFG7+Eh9EvE7lDA7/QwHRqZx9mSYwgCmp1zAk=; b=SYkCdM26yyDJQ/dI0PWOnpZX0sMLfZ8ABF7DMafDkVSZ2Nf79EnqYpCCWKk1T3BA48 rlBm8+HoExT+ZeTR5+PfWKDQaKFGHRiM1/VFuxsKawZ0uxAonSoNcWodQX8HKB2VQldp anDDlpV9k2wgTJPXqTbcwfzNeMlolvBLHWoMLuRSK5UWmDeO/9ER2gnfwk7Arye6yYpt WFdqxUJmH6NNaEJOhB4Dt4KjFajjT3MU1ovdBsgr0iCx3gkmvi16sI0RrHjO1xN8V/ps II0kMKd1X8Dy9tiQDrOoXljSLJYrn8iElokbk1JrBIMiB7TMcn2/LC6bborTIaT2pwgH Fygw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726210350; x=1726815150; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Agts9lVFG7+Eh9EvE7lDA7/QwHRqZx9mSYwgCmp1zAk=; b=T+AYsnf+I9VsZAge8Sxi5sDAA5kICHshYh6yts8HLbJU4oNzD77aBEUmWCPgEPkYfK LMRP8iJasI+Mb3Ps7QGA0SLUENL28hnZ5+htXLu8wD42A5Ejycg/clcbTXUB0ucuQ91U 0KB6fNb20U4S83Jb3G5ETnsW11rDeaUIlZA3CLLigc+nv0rv0Clew9e4tjfwp/mksRsQ 2cCSZgRAZnjAimCuGanedYFE9iOLrHFUt8MVT6ZvHAh5cM8MELpjZte3S9GYEGSOKrwq 8wvgMjyWk5vJjkS1XQAC6239ZZ7BIByNWHdlFstCY4INVBraW0iKvIV2+z0L6QuVJeqb pwbg== X-Gm-Message-State: AOJu0YxPGgWekvNT4p+GRohlBXBwxSUtQ9ww6/rH51VQLKItBpmZSNay 2Axlu9eCyZV2GVi7lmUkJcoyx6gQDwYX3gfm2spwsu4pmpw2ppHKxbwpw+iGnzc8WSTAtAnvn4w lCCz869IgkcMO2YnYvO1ffAm/Pmmns4xq X-Google-Smtp-Source: AGHT+IGdvMyurS3qdBrXSr53xpPOJC+XKzt7w27JF4PEE9ZzsE0qJvbQxXBm4e38ZJ7VOLfuEszo3YKQepwUMc2fUuU= X-Received: by 2002:a05:620a:468e:b0:79f:4b5:3697 with SMTP id af79cd13be357-7ab30dcbaa9mr279382285a.63.1726210350093; Thu, 12 Sep 2024 23:52:30 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::72d; envelope-from=damien.mattei@gmail.com; helo=mail-qk1-x72d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19799 Archived-At: hello, i believed call/cc allowed to return value but i have this macro and i can use continuation, but the value is not passed to the continuation: (define-syntax for (lambda (stx) (syntax-case stx () ((kwd (init test incrmt) body ...) (with-syntax ((BREAK (datum->syntax (syntax kwd) 'break)) (CONTINUE (datum->syntax (syntax kwd) 'continue))) (syntax (call/cc (lambda (escape) (let-syntax ((BREAK (identifier-syntax (escape)))) init (let loop () (when test (call/cc (lambda (next) (let-syntax ((CONTINUE (identifier-syntax (next)))) (let () ;; allow definitions body ...)))) ; end call/cc incrmt (loop))) ; end let loop ))))) ;; close with-syntax )))) mattei@acer:~$ guile GNU Guile 3.0.9 Copyright (C) 1995-2023 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (use-modules (Scheme+)) WARNING: (Scheme+): imported module (if-then-else) overrides core binding `if' WARNING: (Scheme+): imported module (when-unless) overrides core binding `when' WARNING: (Scheme+): imported module (when-unless) overrides core binding `unless' scheme@(guile-user)> (for ((define i 0) (< i 5) (set! i (+ i 1))) (define x 7) (display i) (newline) (when (= i 2) (break "finish"))) 0 1 2 here i should get "finish" at REPL but nothing happens? regards