unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* code review request
@ 2022-02-26 10:31 adriano
  2022-02-26 16:36 ` Vijay Marupudi
  0 siblings, 1 reply; 3+ messages in thread
From: adriano @ 2022-02-26 10:31 UTC (permalink / raw)
  To: guile-user

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-27 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-26 10:31 code review request adriano
2022-02-26 16:36 ` Vijay Marupudi
2022-02-27 10:51   ` adriano

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).