From: Heime <heimeborgia@protonmail.com>
To: Jean Louis <bugs@gnu.support>
Cc: Heime via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Re: Handling optional argument with t value
Date: Mon, 05 Dec 2022 20:09:38 +0000 [thread overview]
Message-ID: <soyXUpah8-yFIWzZQHQEuzb5mlYa_v-HPeLZ0-fI7TPzrbf1SveSiv-xuFzAm65u_efYLn1M4Op0GroZdcvuKiGw3lcHxhmC8ds8zPs0K2E=@protonmail.com> (raw)
In-Reply-To: <Y45DoWLdxDxw9NPE@protected.localdomain>
------- Original Message -------
On Monday, December 5th, 2022 at 7:16 PM, Jean Louis <bugs@gnu.support> wrote:
> * Heime heimeborgia@protonmail.com [2022-12-05 02:02]:
>
> > I have this function to which I am adding the capability to print a
> > compact version that excludes the whitespace. Thus I include an
> > optional argument "kpact", so that when it is set to t, the (insert
> > " ") in excluded. Is this a good strategy.
>
>
> "To print a compact version..." compact version of what?
>
> I understand you wish to print propertized version of some symbol.
>
> If it is good strategy or not, I guess you are the one to
> decide. Because it is with special background, I would insert space
> before and after, to make it more indicative or to make it more visible.
>
> > Does the use of (unless kpact (insert " ")) do the job or am I
> > missing some possible condition that might occur?
>
> You missed to express better what you wish to achieve.
I need some advice on how to handle optional arguments, where one either
does not pass it or passes t.
For instance, should I put a default for it, as in (setq kpact (or kpact nil)) ?
Or handle things with a "when", or using some other combination ?
(defun ticker-hour (lampkl &optional kpact)
(setq kpact (or kpact nil))
(when () )
)
next prev parent reply other threads:[~2022-12-05 20:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-04 23:01 Handling optional argument with t value Heime
2022-12-05 19:16 ` Jean Louis
2022-12-05 20:09 ` Heime [this message]
2022-12-05 23:03 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='soyXUpah8-yFIWzZQHQEuzb5mlYa_v-HPeLZ0-fI7TPzrbf1SveSiv-xuFzAm65u_efYLn1M4Op0GroZdcvuKiGw3lcHxhmC8ds8zPs0K2E=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--cc=bugs@gnu.support \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).