GNU bug report logs - #57090
'guix style' pretty-printer always renders integers as base10

Previous Next

Package: guix;

Reported by: Christopher Rodriguez <yewscion <at> gmail.com>

Date: Tue, 9 Aug 2022 20:52:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57090 in the body.
You can then email your comments to 57090 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 20:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Rodriguez <yewscion <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 09 Aug 2022 20:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Rodriguez <yewscion <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: [BUG] Default Notation for chmod in guix style?
Date: Tue, 09 Aug 2022 16:47:58 -0400
[Message part 1 (text/plain, inline)]
Hello,

I've noticed that, when I explicitly declare absolute permissions in
octal during a (chmod …) in my package definitions and then run guix
style, it converts them to decimal instead.

Is this intended? I've gotten feedback and agree that octal (#o755) is
much clearer to read than decimal (493), simply because I'm used to the
actual unix chmod tool and its conventions.

--

Christopher Rodriguez
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 21:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 57090 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Christopher Rodriguez <yewscion <at> gmail.com>, 57090 <at> debbugs.gnu.org,
 ludo <at> gnu.org
Subject: Re: bug#57090: [BUG] Default Notation for chmod in guix style?
Date: Tue, 9 Aug 2022 22:59:11 +0200
[Message part 1 (text/plain, inline)]
Note: No need for [BUG] prefixes -- they are prefixed automatically by 
bug#NNNNN and the bug tracker is either for bugs or patches, and the 
latter has the [PATCH ...] convention. No harm though.

On 09-08-2022 22:47, Christopher Rodriguez wrote:
> Hello,
>
> I've noticed that, when I explicitly declare absolute permissions in
> octal during a (chmod …) in my package definitions and then run guix
> style, it converts them to decimal instead.
>
> Is this intended? I've gotten feedback and agree that octal (#o755) is
> much clearer to read than decimal (493), simply because I'm used to the
> actual unix chmod tool and its conventions.
>
> --
>
> Christopher Rodriguez

'chmod' is not mentioned anywhere in (guix scripts style), so I'd think 
it's just an oversight. The authority on the matter would be Ludovic 
Courtès <ludo <at> gnu.org>

Disclaimer: I'm the one that wrote that feedback. Let's not double-count 
my non-existent 'votes'.

Greetings,
Maxime

[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 21:05:01 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Csepp <raingloom <at> riseup.net>
To: Christopher Rodriguez <yewscion <at> gmail.com>
Cc: bug-guix <at> gnu.org, 57090 <at> debbugs.gnu.org
Subject: Re: bug#57090: [BUG] Default Notation for chmod in guix style?
Date: Tue, 09 Aug 2022 21:01:15 +0000
Christopher Rodriguez <yewscion <at> gmail.com> writes:

> [[PGP Signed Part:Undecided]]
>
> Hello,
>
> I've noticed that, when I explicitly declare absolute permissions in
> octal during a (chmod …) in my package definitions and then run guix
> style, it converts them to decimal instead.
>
> Is this intended? I've gotten feedback and agree that octal (#o755) is
> much clearer to read than decimal (493), simply because I'm used to the
> actual unix chmod tool and its conventions.

Seems to be a Scheme limitation:

```
scheme@(guile-user)> '(#o10)
$1 = (8)
```




Information forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 21:05:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 21:05:02 GMT) Full text and rfc822 format available.

Message #17 received at 57090 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: "Maxime Devos" <maximedevos <at> telenet.be>, "Christopher Rodriguez"
 <yewscion <at> gmail.com>, <57090 <at> debbugs.gnu.org>, <ludo <at> gnu.org>
Subject: Re: bug#57090: [BUG] Default Notation for chmod in guix style?
Date: Tue, 09 Aug 2022 22:04:24 +0100
On Tue Aug 9, 2022 at 9:59 PM BST, Maxime Devos wrote:
> 'chmod' is not mentioned anywhere in (guix scripts style), so I'd think 
> it's just an oversight. The authority on the matter would be Ludovic 
> Courtès <ludo <at> gnu.org>

Is it possible that (guix read-print) stores octal numbers directly as
Scheme numbers, with no way to distinguish them from decimal numbers,
which means when they are printed they are just treated as base10? I
poked around a bit in the module but couldn't find the code for number
reading.

    -- (




Information forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 21:09:02 GMT) Full text and rfc822 format available.

Message #20 received at 57090 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: "Csepp" <raingloom <at> riseup.net>, "Christopher Rodriguez"
 <yewscion <at> gmail.com>
Cc: 57090 <at> debbugs.gnu.org
Subject: Re: bug#57090: [BUG] Default Notation for chmod in guix style?
Date: Tue, 09 Aug 2022 22:08:53 +0100
On Tue Aug 9, 2022 at 10:01 PM BST, Csepp wrote:
> Seems to be a Scheme limitation:
>
> ```
> scheme@(guile-user)> '(#o10)
> $1 = (8)
> ```

`guix style` uses a completely seperate reader, defined
in (guix read-print), so even though it's possible it has
the same limitation, we could easily modify it to support
octal/hexadecimal/binary numbers.

    -- (




Information forwarded to bug-guix <at> gnu.org:
bug#57090; Package guix. (Tue, 09 Aug 2022 21:13:01 GMT) Full text and rfc822 format available.

Message #23 received at 57090 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "(" <paren <at> disroot.org>
Cc: 57090 <at> debbugs.gnu.org, Christopher Rodriguez <yewscion <at> gmail.com>,
 Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57090: [BUG] Default Notation for chmod in guix style?
Date: Tue, 09 Aug 2022 23:12:20 +0200
Hi,

"(" <paren <at> disroot.org> skribis:

> On Tue Aug 9, 2022 at 9:59 PM BST, Maxime Devos wrote:
>> 'chmod' is not mentioned anywhere in (guix scripts style), so I'd think 
>> it's just an oversight. The authority on the matter would be Ludovic 
>> Courtès <ludo <at> gnu.org>
>
> Is it possible that (guix read-print) stores octal numbers directly as
> Scheme numbers, with no way to distinguish them from decimal numbers,
> which means when they are printed they are just treated as base10? I
> poked around a bit in the module but couldn't find the code for number
> reading.

Indeed, the reader is basically a wrapper around ‘read’.  It preserves
comments and vertical space, but it doesn’t attempt to preserve the
style of numbers (base, etc.), strings (whether \n & co. are escaped or
literal), and so on.  I think that’d be a bit too much honestly.

Now, we could tweak the pretty printer so that it recognizes patterns
where numbers or strings should be printed in a certain way.

Help welcome! :-)

Ludo’.




Changed bug title to ''guix style' pretty-printer always renders integers as base10' from '[BUG] Default Notation for chmod in guix style?' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 31 Aug 2022 09:21:01 GMT) Full text and rfc822 format available.

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 01 Sep 2022 16:44:01 GMT) Full text and rfc822 format available.

Notification sent to Christopher Rodriguez <yewscion <at> gmail.com>:
bug acknowledged by developer. (Thu, 01 Sep 2022 16:44:01 GMT) Full text and rfc822 format available.

Message #30 received at 57090-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "(" <paren <at> disroot.org>
Cc: Maxime Devos <maximedevos <at> telenet.be>,
 Christopher Rodriguez <yewscion <at> gmail.com>, 57090-done <at> debbugs.gnu.org
Subject: Re: bug#57090: 'guix style' pretty-printer always renders integers
 as base10
Date: Thu, 01 Sep 2022 18:43:22 +0200
Hi,

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Now, we could tweak the pretty printer so that it recognizes patterns
> where numbers or strings should be printed in a certain way.

I did that in c3b1cfe76b7038f4030d7d207ffc417fed9a7ead.  Lemme know how
you like it!  :-)

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Sep 2022 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 206 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.