Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Emacs-Lisp-02.org #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions show-notes/Emacs-Lisp-02.org
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ You can compare two numeric values (even integers against floats):
(< 1 2) ;; t
(> 1 2) ;; nil
(> 1 1) ;; nil
(> 1.2 1) ;; nil
(> 1.2 1) ;; t

(>= 1 1) ;; t
(<= -1 -1.0) ;; t
Expand Down Expand Up @@ -598,7 +598,7 @@ Emacs provides the following logic operators:
- =not= - Inverts the truth value of the argument
- =and= - Returns the last value if all expressions are truthy
- =or= - Returns the first value that is truthy (short-circuits)
- =xor= - Returns the first value that is truthy (doesn't short-circuit)
- =xor= - Returns the truthy value if the other one is false, otherwise returns nil

#+begin_src emacs-lisp

Expand All @@ -614,6 +614,11 @@ Emacs provides the following logic operators:
(or nil 'something) ;; 'something
(or nil 'something t) ;; 'something
(or (- 3 3) (+ 2 0)) ;; 0

(xor 1 1) ;; nil
(xor nil 1) ;; 1
(xor 1 nil) ;; 1
(xor 1 nil nil) ;; wrong-number-of-arguments

#+end_src

Expand Down