all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Execute commands with unless on symbols
@ 2022-10-08 16:08 uzibalqa
  2022-10-08 16:24 ` [External] : " Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: uzibalqa @ 2022-10-08 16:08 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor

Have made a symbol 'go or `nogo and want to use an unless condition that only
executes some commands for the 'go condition.  How should the unless condition 
be constructed with the `nogo?

(defconst modust-statck 'go)

(unless modust-statck






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

* RE: [External] : Execute commands with unless on symbols
  2022-10-08 16:08 Execute commands with unless on symbols uzibalqa
@ 2022-10-08 16:24 ` Drew Adams
  2022-10-08 17:12   ` uzibalqa
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2022-10-08 16:24 UTC (permalink / raw)
  To: uzibalqa, uzibalqa via Users list for the GNU Emacs text editor

> (defconst modust-statck 'go)
> (unless modust-statck

Yes.  Doesn't that do what you ask?

On the other hand, `defconst' is specifically
intended to give the message to human readers
that neither humans nor code are expected to
change the value of the variable.  It's a
proclamation to human readers that the var is
really a constant.

And if it's really a constant, then why test
it (e.g. with `unless')?  Either you should
use `defvar' or you just do XYZ instead of
(unless modust-statck XYZ).  No?

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

* RE: [External] : Execute commands with unless on symbols
  2022-10-08 16:24 ` [External] : " Drew Adams
@ 2022-10-08 17:12   ` uzibalqa
  0 siblings, 0 replies; 3+ messages in thread
From: uzibalqa @ 2022-10-08 17:12 UTC (permalink / raw)
  To: Drew Adams; +Cc: uzibalqa via Users list for the GNU Emacs text editor


------- Original Message -------
On Saturday, October 8th, 2022 at 4:24 PM, Drew Adams <drew.adams@oracle.com> wrote:


> > (defconst modust-statck 'go)
> > (unless modust-statck
> 
> 
> Yes. Doesn't that do what you ask?
> 
> On the other hand, `defconst' is specifically intended to give the message to human readers that neither humans nor code are expected to change the value of the variable. It's a proclamation to human readers that the var is really a constant. And if it's really a constant, then why test it (e.g. with` unless')? Either you should
> use `defvar' or you just do XYZ instead of
> (unless modust-statck XYZ). No?

You are right.  Would work better if I can pass 'go or 'nogo to a function.  I would still
need the "(unless param".  With some "eq" declaration for 'nogo.







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

end of thread, other threads:[~2022-10-08 17:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-08 16:08 Execute commands with unless on symbols uzibalqa
2022-10-08 16:24 ` [External] : " Drew Adams
2022-10-08 17:12   ` uzibalqa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.