guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Shepherd on Fibers


From: Maxime Devos
Subject: Re: The Shepherd on Fibers
Date: Tue, 29 Mar 2022 18:26:15 +0200
User-agent: Evolution 3.38.3-1

Ludovic Courtès schreef op di 29-03-2022 om 14:48 [+0200]:
> Maxime Devos <maximedevos@telenet.be> skribis:
> 
> > To help translators, I would use positional arguments in
> > 
> > + (l10n "Accepted connection on ~a from ~:[~a~;~*local process~].")
> 
> Hmm so how would you write this?

Here's an example on how to implement positional arguments in terms of
(ice-9 format) argument jumping:

(format #t "third argument: ~2@*~a, second argument: ~1@*~a, first
argument ~0@*~a!~%" 1 2 3)

(format #t "Accepted connection on ~0@*~a from ~1@*~:[~0@*~a~;local
process~]." "foo" #f "bar")

(format #t "From ~1@*~:[~0@*~a~;local process~] accepted connection on
~0@*~a." "foo" #f "bar")

Or simpler, without format string conditionals, which seems a bit
easier to translate without having to know how (ice-9 format) works:

(if local-process?
    (format #t "Accepted connection on ~a from local process." "foo")
    (format #t "Accepted connection on ~0@*~a from ~1@*~a." "foo" "bar"))

Greetings,
Maxime

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]