From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QFhYDytERGMEggEAbAwnHQ (envelope-from ) for ; Mon, 10 Oct 2022 18:11:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iMEGDytERGMG5QAAG6o9tA (envelope-from ) for ; Mon, 10 Oct 2022 18:11:23 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0252239AAE for ; Mon, 10 Oct 2022 18:11:23 +0200 (CEST) Received: from localhost ([::1]:44136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohvN8-0005dP-3Z for larch@yhetil.org; Mon, 10 Oct 2022 12:11:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohvH3-00026v-GR for help-guix@gnu.org; Mon, 10 Oct 2022 12:05:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohvH2-0004oE-CW; Mon, 10 Oct 2022 12:05:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Yyzx7BiobARE/mXbjNNmSQ65PIdaMaeIaJOqEVbqO74=; b=YTEetgeJxcu2Lc0mOwXl 5gfr9DyTATHPfwt0DMHX+NyUfhJo67u+K4BcbQgbbZseqh4pinYep53aeHLP4nr0hT2yxoddePy9n 5Cg7QjnICh6DZX5IxOYt7kFgKt5Al0S9XlcFpklCrNPZpXDtEAzbG0gIb8C2vB6ob6MGgaJEQx3tc xBb+IJ/EVnt2hYcEd0IlHR1ALyP8syjhc9YBVRSvq1UXowhNYXX5v99QezGyK1DPqVpV1awA+A8Xr 3AhOHSLUlaCFkDA9ecZiHyjeopfqe0xsFnpczMXBm6zLLAuEpkKJWo7ob8HvxTgHUFFTGrDAS4k2r IWfyTanefG9BfA==; Received: from [193.50.110.253] (port=50634 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohvH1-000600-VH; Mon, 10 Oct 2022 12:05:00 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: jgart Cc: Guix Help Subject: Re: How can I step through this code? References: <20221005220527.GB3151@dismail.de> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 19 =?utf-8?Q?Vend=C3=A9miaire?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Tournesol X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 10 Oct 2022 18:04:57 +0200 In-Reply-To: <20221005220527.GB3151@dismail.de> (jgart@dismail.de's message of "Wed, 5 Oct 2022 22:05:27 -0500") Message-ID: <87ilkrzmty.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665418283; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Yyzx7BiobARE/mXbjNNmSQ65PIdaMaeIaJOqEVbqO74=; b=gOaIcvYGycgzyFn/gOU++sduDHRUUvKDrBWIrKz4tqKJuWuPK6uJfMBR9LFSGkt6urXP41 SFuv5megiC0UMM9n4nXZFjB69F0g+Ejs49mvxXziz60iaJzonjKKnONE9PlLYZiXvnA+db qpmtT+nivywhC4e8gAY5TA2Q1+NSmq8xoHmZLbJgDf2qOssSWnoKhXSezAN2TIPQhWKKBo BZcrOo/ZFFE6+uf7+m67NVNDNa7Rqh+mVys3IYbdFHT7hRrBSXcMzlxcUhNWj12rIipPZp aNr6qwBKHTyO6pSeVIQ/R4BqwdX2ysyO2b9BNXDEqiIZrOCI6O5E5SHqj8P0Fg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665418283; a=rsa-sha256; cv=none; b=GPQGNL3ERXFmlG3MXxtqjJ5dX2mS5Z3YmhfqVI7Ik64N3zUWO1Pibj7Rx1qI2PAYye6npN 1/+ti5/+iXwLbXO1bOd/ag0iu853ONsNaNR2xkwSdWJS1n62U9IIqO+0n3RWSKXL4Xx9aW yqmNqpVeQmu6x99PlvAuwbuibPqfFwI6kmf+mC25QOH5t6lNN3OVMXyYD3p/utq7KVL4qi OpBmcbdYQ5wo9L+wev5YeE0yRJ6ikjaNaWLBloJq9pJOJdn0kzwdKqopP7kQ68zTmcxwiL 6MuO2VcCoJtdkex5uqbH4oHIaJBjK797aE+XY1WEcexmmhPDq0ohzDipb6gh5A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=YTEetgeJ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.09 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=YTEetgeJ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0252239AAE X-Spam-Score: -4.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: YI8dBm04nnP1 Hi, jgart skribis: > How can I step through this code? > > (define-syntax do > (syntax-rules () > ((do ((var init step ...) ...) > (test expr ...) > command ...) > (letrec > ((loop > (lambda (var ...) > (if test > (begin > (if #f #f) > expr ...) > (begin > command > ... > (loop (do "step" var step ...) > ...)))))) > (loop init ...))) > ((do "step" x) > x) > ((do "step" x y) > y))) You can=E2=80=99t: this is a macro and Guile doesn=E2=80=99t have a =E2=80= =9Cmacro stepper=E2=80=9D (Racket does). What you can do though, is define the macro and expand it on examples of your choosing to see how it behaves: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,expand (do ((x 0 (+ 1 x))) ((>=3D x 10)) (pk x)) $7 =3D (let loop ((x 0)) (if (>=3D x 10) (if #f #f) (begin (pk x) (loop (+ 1 x))))) scheme@(guile-user)> ,optimize (do ((x 0 (+ 1 x))) ((>=3D x 10)) (pk x)) $8 =3D (begin (pk 0) (pk 1) (pk 2) (pk 3) (pk 4) (pk 5) (pk 6) (pk 7) (pk 8) (pk 9) (if #f #f)) --8<---------------cut here---------------end--------------->8--- (Personally I=E2=80=99ve never used =E2=80=98do=E2=80=99 and I don=E2=80=99= t feel like starting today. :-)) Ludo=E2=80=99.