From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: adriano Newsgroups: gmane.lisp.guile.user Subject: code review request Date: Sat, 26 Feb 2022 11:31:40 +0100 Message-ID: <3cbcf4f1e624e54d6c4e459d9fc156ab9a5e6f31.camel@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20098"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Feb 26 11:32:14 2022 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 1nNuN4-00052L-1q for guile-user@m.gmane-mx.org; Sat, 26 Feb 2022 11:32:14 +0100 Original-Received: from localhost ([::1]:40884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNuN2-0004o2-I3 for guile-user@m.gmane-mx.org; Sat, 26 Feb 2022 05:32:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNuMi-0004nq-Ek for guile-user@gnu.org; Sat, 26 Feb 2022 05:31:53 -0500 Original-Received: from mx1.riseup.net ([198.252.153.129]:34194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNuMf-00017U-Hi for guile-user@gnu.org; Sat, 26 Feb 2022 05:31:51 -0500 Original-Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4K5NH52SYCzF79d for ; Sat, 26 Feb 2022 02:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1645871505; bh=qfRrebjzQ5O92cza+5cBSuAtbAGVuZ0O++2tcYud30c=; h=Subject:From:To:Date:From; b=Z++VMS4yS6ZrZvGkrawGhjgTS4ZV3wftjsGwHcwSFjTmHcxWh1GclTsX1x8t0kBFT 41635FIpATK/awnqV7PHs+LVQBr71KWZUqgXewblazSSiy4MWmAJrHpF1FcGzAhSu6 c85hU6kNk6I2tZtSzw+ZJHP5TFo+R/NeYdfDIOPI= X-Riseup-User-ID: 86C28399E110DD2E82BEA5EA44E57D1D90CEC179811E3AEDA074456A699727CA Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4K5NH4345mz5vNJ for ; Sat, 26 Feb 2022 02:31:44 -0800 (PST) Received-SPF: pass client-ip=198.252.153.129; envelope-from=randomlooser@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.lisp.guile.user:18146 Archived-At: I wrote a brief piece of Guile code and it got me confused, I'd like to ask for a code review The code is here https://gitlab.com/humanitiesNerd/filesystembrowsing A few words about it I have a folder with 2 small files in it (included in the repo) I'd like to "browse" it programmatically and come up with a dictionary like structure like this ((domenica 13 dicembre 2020 #(2049 2627145 33204 1 1000 1000 0 443230 1645865577 1607841890 1645864904 4096 872 regular 436 596285075 248104000 1645864904)) (martedì 15 febbraio 2022 #(2049 4195086 33204 1 1000 1000 0 53 1645865577 1644926631 1645864925 4096 8 regular 436 700286391 687497000 1645864925))) The keys are domenica 13 dicembre 2020 martedì 15 febbraio 2022 these are dates expressed in a human readable format the values are supposed to be lists of stat objects (for now) The dates are the files mtimes The idea is to group the files based on their mtimes I think I want to use "file-system-fold" from (ice-9 ftw) for this I wrote a "leaf" procedure to be passed to file-system-fold and I tested it in the REPL, it seems to work But when I call (file-system-fold enter? my-leaf-procedure down up skip error result dir) I get a result I don't understand: this return 2 values One is expected, it's the one I wanted to produce The other one is totally unexpected, it's a vhash and I don't understand where it gets created, why it gets returned, what it contains In the file "notes" I pasted what I got by evaluating the last expression in my code file "palestra.scm" is the file containing the code Thanks for any help