* bug#57090: [BUG] Default Notation for chmod in guix style?
@ 2022-08-09 20:47 Christopher Rodriguez
2022-08-09 20:59 ` Maxime Devos
2022-08-09 21:01 ` bug#57090: [BUG] Default Notation for chmod in guix style? Csepp
0 siblings, 2 replies; 7+ messages in thread
From: Christopher Rodriguez @ 2022-08-09 20:47 UTC (permalink / raw)
To: 57090
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#57090: [BUG] Default Notation for chmod in guix style?
2022-08-09 20:47 bug#57090: [BUG] Default Notation for chmod in guix style? Christopher Rodriguez
@ 2022-08-09 20:59 ` Maxime Devos
2022-08-09 21:04 ` paren--- via Bug reports for GNU Guix
2022-08-09 21:01 ` bug#57090: [BUG] Default Notation for chmod in guix style? Csepp
1 sibling, 1 reply; 7+ messages in thread
From: Maxime Devos @ 2022-08-09 20:59 UTC (permalink / raw)
To: Christopher Rodriguez, 57090, ludo
[-- Attachment #1.1.1: Type: text/plain, Size: 994 bytes --]
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@gnu.org>
Disclaimer: I'm the one that wrote that feedback. Let's not double-count
my non-existent 'votes'.
Greetings,
Maxime
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#57090: [BUG] Default Notation for chmod in guix style?
2022-08-09 20:59 ` Maxime Devos
@ 2022-08-09 21:04 ` paren--- via Bug reports for GNU Guix
2022-08-09 21:12 ` Ludovic Courtès
0 siblings, 1 reply; 7+ messages in thread
From: paren--- via Bug reports for GNU Guix @ 2022-08-09 21:04 UTC (permalink / raw)
To: Maxime Devos, Christopher Rodriguez, 57090, ludo
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@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.
-- (
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#57090: [BUG] Default Notation for chmod in guix style?
2022-08-09 21:04 ` paren--- via Bug reports for GNU Guix
@ 2022-08-09 21:12 ` Ludovic Courtès
2022-09-01 16:43 ` bug#57090: 'guix style' pretty-printer always renders integers as base10 Ludovic Courtès
0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2022-08-09 21:12 UTC (permalink / raw)
To: (; +Cc: 57090, Christopher Rodriguez, Maxime Devos
Hi,
"(" <paren@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@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’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#57090: 'guix style' pretty-printer always renders integers as base10
2022-08-09 21:12 ` Ludovic Courtès
@ 2022-09-01 16:43 ` Ludovic Courtès
0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2022-09-01 16:43 UTC (permalink / raw)
To: (; +Cc: Maxime Devos, Christopher Rodriguez, 57090-done
Hi,
Ludovic Courtès <ludo@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’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#57090: [BUG] Default Notation for chmod in guix style?
2022-08-09 20:47 bug#57090: [BUG] Default Notation for chmod in guix style? Christopher Rodriguez
2022-08-09 20:59 ` Maxime Devos
@ 2022-08-09 21:01 ` Csepp
2022-08-09 21:08 ` paren--- via Bug reports for GNU Guix
1 sibling, 1 reply; 7+ messages in thread
From: Csepp @ 2022-08-09 21:01 UTC (permalink / raw)
To: Christopher Rodriguez; +Cc: 57090
Christopher Rodriguez <yewscion@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)
```
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-09-01 17:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-09 20:47 bug#57090: [BUG] Default Notation for chmod in guix style? Christopher Rodriguez
2022-08-09 20:59 ` Maxime Devos
2022-08-09 21:04 ` paren--- via Bug reports for GNU Guix
2022-08-09 21:12 ` Ludovic Courtès
2022-09-01 16:43 ` bug#57090: 'guix style' pretty-printer always renders integers as base10 Ludovic Courtès
2022-08-09 21:01 ` bug#57090: [BUG] Default Notation for chmod in guix style? Csepp
2022-08-09 21:08 ` paren--- via Bug reports for GNU Guix
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).