From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.lisp.guile.user Subject: Re: Writing a procedure in different style Date: Sun, 13 Dec 2020 16:43:00 +0100 Message-ID: <20201213154300.GC6620@tuxteam.de> References: <3760549b-b32f-fafc-1291-8e3eda7b3753@posteo.de> <2d6f348c-1e43-a5c4-1998-baa04b91bf8c@gmail.com> <1385bd6a-c14e-76f1-6dfe-4cf50d192375@gmail.com> <33683c10-5e29-8e4a-03a4-64852fbcf474@posteo.de> <20201213142412.GB6620@tuxteam.de> <66a4948b-6c35-d9df-daa0-865956f52821@posteo.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hOcCNbCCxyk/YU74" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37698"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: guile-user@gnu.org To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Dec 13 16:43:24 2020 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 1koTWt-0009if-9K for guile-user@m.gmane-mx.org; Sun, 13 Dec 2020 16:43:23 +0100 Original-Received: from localhost ([::1]:44508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koTWs-00087I-B4 for guile-user@m.gmane-mx.org; Sun, 13 Dec 2020 10:43:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koTWc-00086M-3t for guile-user@gnu.org; Sun, 13 Dec 2020 10:43:06 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:52521) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1koTWX-0000s6-Bn for guile-user@gnu.org; Sun, 13 Dec 2020 10:43:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=KgMJtPnTRdYnDjIa6yz+SnWoiN9GCA8pXVhpH5gONbU=; b=hYG+hkXXgjmLeabfiFU7zQWlob4Dzg4ou5iByWsyDgEsIL9xKIE3jt8fNXrZ1v94VS7F3clVzccl5taYwB7zrFpljHJttJV2OMMmerPWQhPgEV/7pVHxmK+X6Szi+qMHk8zLEBHYmVwJPQ6nqi4sJlc3sSxGxXQfovcXNt8rRJvTZRY8gJIP4Am4Cmw0nt9wiOyGLBwKZTtJ1Q40BpI6wtjmPBJnzzwRFx+rr6hy0vvAANtULQ5u0z67zhPGo5b0gLn2brQN6H5KQGKC3jCzbNHC0pt2bTMRpl4RjfST9d6gXdXFtJtHiWbAN/d41bar0OrArWGfqYYvVNQTP77GUw==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1koTWW-000331-W8; Sun, 13 Dec 2020 16:43:01 +0100 Content-Disposition: inline In-Reply-To: <66a4948b-6c35-d9df-daa0-865956f52821@posteo.de> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.lisp.guile.user:17081 Archived-At: --hOcCNbCCxyk/YU74 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 13, 2020 at 04:01:24PM +0100, Zelphir Kaltstahl wrote: > Hi Tomas! >=20 > In some way what you write makes sense. Let me state here, that I did > read that book and worked through it for a year though, even through the > complicated parts like the y-combinator and some chapters I must have > read like 4 or 5 times and discovered new aspects on each try. That's it -- I'm through some n-th iteration and still go "oh!" from time to time :-D > What is typically the case in the book is a different situation though, > than what was in Taylan's procedure. Usually it is the list you are > working on in that iteration, which you check for being (null? ...), not > the thing, that you give as argument to a recursive call or as a return > value, which you add in some way to the result. Usually the questions > from the quote are asked once the argument is received in the next > iteration. That I definitely usually do, but in Taylan's answer there is > an (if (null? ...) ...) for the `rest`, inside the case, where the usual > (null? ...) check is already done on the subtree, which we recur on. I have the hunch that this is only shifting things one level up or down the stack, but basically, it's the same principle at work. I'd have to fiddle for a while with that to see whether I'm totally off, though. Anyway, a reminder for me to do the n+1st iteration: "Do It, Do It Again, and Again, and Again, ..." :-) Thanks for that! Cheers - t --hOcCNbCCxyk/YU74 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl/WNoQACgkQBcgs9XrR2kZ7dwCfQtttuXq/FhlwEYHPbz6IaAcf WLsAn0mw4OFl8MRWN5S+wRuTnAuIR3of =JouP -----END PGP SIGNATURE----- --hOcCNbCCxyk/YU74--