unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#60834: configuration->documentation generates garbage @-command on fields beginning with numeric characters
@ 2023-01-15 14:34 Bruno Victal
  2023-04-06 13:20 ` Bruno Victal
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Victal @ 2023-01-15 14:34 UTC (permalink / raw)
  To: 60834

Minimal example (with Guix REPL):

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use (gnu services configuration)
scheme@(guix-user)> (define serialize-boolean (lambda (x y) #t))
scheme@(guix-user)> (define-configuration example-configuration (1-foo (boolean #t) "lorem ipsum"))
scheme@(guix-user)> (configuration->documentation 'example-configuration)
%example-configuration
@c %start of fragment

@deftp {Data Type} example-configuration
Available @code{example-configuration} fields are:

@table @asis
@item @code{#@{1-foo@}#} (default: @code{#t}) (type: boolean)
lorem ipsum

@end table

@end deftp


@c %end of fragment
scheme@(guix-user)> 
--8<---------------cut here---------------end--------------->8---




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

* bug#60834: configuration->documentation generates garbage @-command on fields beginning with numeric characters
  2023-01-15 14:34 bug#60834: configuration->documentation generates garbage @-command on fields beginning with numeric characters Bruno Victal
@ 2023-04-06 13:20 ` Bruno Victal
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Victal @ 2023-04-06 13:20 UTC (permalink / raw)
  To: 60834

This seems to be an issue involving how 'object->string' works:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (object->string '1-foo)
$1 = "#{1-foo}#"
scheme@(guile-user)> (object->string '-foo)
$2 = "-foo"
scheme@(guile-user)> (object->string 'foo-1-bar)
$3 = "foo-1-bar"
scheme@(guile-user)> (object->string 'foo-1)
$4 = "foo-1"
scheme@(guile-user)>
--8<---------------cut here---------------end--------------->8---


Grepping guile source, we see that 'format' also uses 'object->string' for the ~a format, which prints:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (format #t "Expected: ~a, ~a; Unexpected: ~a;~%" 'foo '-foo '1-foo)
Expected: foo, -foo; Unexpected: #{1-foo}#;
$5 = #t
scheme@(guile-user)>
--8<---------------cut here---------------end--------------->8---




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

end of thread, other threads:[~2023-04-06 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-15 14:34 bug#60834: configuration->documentation generates garbage @-command on fields beginning with numeric characters Bruno Victal
2023-04-06 13:20 ` Bruno Victal

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