GNU bug report logs - #19975
25.0.50; Add %s-like descriptor to `format' that treats nil like empty string

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 1 Mar 2015 15:34:01 UTC

Severity: wishlist

Tags: wontfix

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 19975 <at> debbugs.gnu.org
Subject: bug#19975: 25.0.50; Add %s-like descriptor to `format' that treats nil like empty string
Date: Sun, 1 Mar 2015 23:07:13 -0800 (PST)
> > Enhancement request.  Add a new format descriptor to `format' that would
> > behave just like %s except that a nil argument would be treated as if it
> > were "".
> 
> It's easy enough to use (or foo "").

Yes of course "it's easy enough".  That's what we've all been
doing for decades.  It would be even clearer and simpler still
to have a format descriptor for this common use case.

That is what this enhancement request is about - not needing to
write such "easy enough" code.

And of course it is not always (or foo "").
It might well be (if foo "whatever" "").  Or if you prefer,
(let ((bar "whatever")) (or (and foo bar) "")).




This bug report was last modified 9 years and 25 days ago.

Previous Next


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