GNU bug report logs -
#36048
[PATCH] guix: import: hackage: handle hackage revisions
Previous Next
Reported by: Robert Vollmert <rob <at> vllmrt.net>
Date: Sat, 1 Jun 2019 22:37:02 UTC
Severity: normal
Tags: patch
Done: Timothy Sample <samplet <at> ngyro.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Timothy,
thanks for the detailed feedback, this is very helpful!
I’ve sent an updated patch addressing some of the concerns, but have
some questions regarding others. (I just realized that the documentation
updates probably anticipate multiple return values.)
> On 13. Jun 2019, at 04:28, Timothy Sample <samplet <at> ngyro.com> wrote:
>> + (let-values (((port get-hash) (open-sha256-input-port port)))
>> + (cons
>> + (read-cabal (canonical-newline-port port))
>> + (bytevector->nix-base32-string (get-hash)))))
[…]
> Also, I think returning multiple values would be more natural here
> (i.e., replace “cons” with “values”).
I tried building it that way to begin with, but I’m having issues
making it work (nicely, or maybe at all). I think it comes down to
later functions optionally failing with a single #f-value. Judging
by the lack of infrastructure, I imagine functions that return different
numbers of values are not idiomatic scheme. Should this be changed to
return two values (#f #f) on failure? Or to raise an exception and
handle it higher up when we want to ignore a failure?
Currently, implementing this with values/let-values results in me
doing more or less a combination of let-values and match, at which
point it seems that any potential benefits of using multiple values
as opposed to a pair/list are lost. (There’s no match-values form is
there?)
Cheers
Rob
This bug report was last modified 5 years and 342 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.