all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* is there an existing negate function ?
@ 2009-03-09 23:38 Mike Mattie
  2009-03-10  0:22 ` Juanma Barranquero
  2009-03-10  6:36 ` Drew Adams
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Mattie @ 2009-03-09 23:38 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

is there an existing negate function ? something like this
that I have no found ?

(defun negate ( value )
  "negate VALUE

   Invert the boolean sense of VALUE

   0 -> 1
   1 -> 0
  "
  (if value
    nil
    t))

-- 
GnuPG Key: B9012279 is available from HKP server pgp.mit.edu

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: is there an existing negate function ?
  2009-03-09 23:38 is there an existing negate function ? Mike Mattie
@ 2009-03-10  0:22 ` Juanma Barranquero
  2009-03-10  6:36 ` Drew Adams
  1 sibling, 0 replies; 3+ messages in thread
From: Juanma Barranquero @ 2009-03-10  0:22 UTC (permalink / raw)
  To: Mike Mattie; +Cc: help-gnu-emacs

> is there an existing negate function ? something like this
> that I have no found ?
>
> (defun negate ( value )
>  (if value
>    nil
>    t))

`null' (or its alias, `not').

    Juanma




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

* RE: is there an existing negate function ?
  2009-03-09 23:38 is there an existing negate function ? Mike Mattie
  2009-03-10  0:22 ` Juanma Barranquero
@ 2009-03-10  6:36 ` Drew Adams
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2009-03-10  6:36 UTC (permalink / raw)
  To: 'Mike Mattie', help-gnu-emacs

> is there an existing negate function ? something like this
> that I have no found ?
> 
> (defun negate ( value )
>   "negate VALUE - Invert the boolean sense of VALUE
>    0 -> 1
>    1 -> 0"
>   (if value nil t))

I'll bite. ;-)

Is `not' (aka `null') what you mean?
(not nil) -> t
(not 'non-nil) -> nil





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

end of thread, other threads:[~2009-03-10  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-09 23:38 is there an existing negate function ? Mike Mattie
2009-03-10  0:22 ` Juanma Barranquero
2009-03-10  6:36 ` Drew Adams

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.