unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: adriano <randomlooser@riseup.net>
To: guile-user <guile-user@gnu.org>
Subject: code review request
Date: Sat, 26 Feb 2022 11:31:40 +0100	[thread overview]
Message-ID: <3cbcf4f1e624e54d6c4e459d9fc156ab9a5e6f31.camel@riseup.net> (raw)

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




             reply	other threads:[~2022-02-26 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 10:31 adriano [this message]
2022-02-26 16:36 ` code review request Vijay Marupudi
2022-02-27 10:51   ` adriano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3cbcf4f1e624e54d6c4e459d9fc156ab9a5e6f31.camel@riseup.net \
    --to=randomlooser@riseup.net \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).