From 6b2d8d5fe2556316c6cff7f876153716ce296183 Mon Sep 17 00:00:00 2001 From: Aaron Zeng Date: Tue, 21 Apr 2015 15:08:39 -0400 Subject: fix the while macro for Common Lisp Earlier version was incorrect, as it only executed `body` once and then terminated, like an if statement instead. --- common-lisp.html.markdown | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index c4ecb5e8..f9f64d68 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -573,13 +573,15 @@ nil ; for false - and the empty list "While `condition` is true, `body` is executed. `condition` is tested prior to each execution of `body`" - (let ((block-name (gensym))) + (let ((block-name (gensym)) (done (gensym))) `(tagbody + ,block-name (unless ,condition - (go ,block-name)) + (go ,done)) (progn ,@body) - ,block-name))) + (go ,block-name) + ,done))) ;; Let's look at the high-level version of this: -- cgit v1.2.3 From fbd07f268cd6e64c65912ccc27f2ec9e222ec536 Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Sun, 4 Oct 2015 21:24:57 +0530 Subject: Issue #1157 Comment explaining '-p', in line 178. --- common-lisp.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index f9f64d68..e3bb61cf 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -175,7 +175,8 @@ nil ; for false - and the empty list :age 5)) *rover* ; => #S(DOG :NAME "rover" :BREED "collie" :AGE 5) -(dog-p *rover*) ; => t ;; ewww) +(dog-p *rover*) ; => true #| -p signifies "predicate". It's used to + check if *rover* is an instance of dog.|# (dog-name *rover*) ; => "rover" ;; Dog-p, make-dog, and dog-name are all created by defstruct! -- cgit v1.2.3 From 68fc9b5c1f71adcbbbd53711e9a5692a8372b8cf Mon Sep 17 00:00:00 2001 From: Pushkar Sharma Date: Mon, 5 Oct 2015 00:35:49 +0530 Subject: fixed the comment format --- common-lisp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index e3bb61cf..e0597e94 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -176,7 +176,7 @@ nil ; for false - and the empty list *rover* ; => #S(DOG :NAME "rover" :BREED "collie" :AGE 5) (dog-p *rover*) ; => true #| -p signifies "predicate". It's used to - check if *rover* is an instance of dog.|# + check if *rover* is an instance of dog. |# (dog-name *rover*) ; => "rover" ;; Dog-p, make-dog, and dog-name are all created by defstruct! -- cgit v1.2.3 From 960ee4a1856db8eadb96277bb2422edfa8f2a81c Mon Sep 17 00:00:00 2001 From: Gabriel Halley Date: Wed, 7 Oct 2015 23:11:24 -0400 Subject: removing whitespace all over --- common-lisp.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index e0597e94..63183c1e 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -261,7 +261,7 @@ nil ; for false - and the empty list (defparameter *adjvec* (make-array '(3) :initial-contents '(1 2 3) :adjustable t :fill-pointer t)) - + *adjvec* ; => #(1 2 3) ;; Adding new element: -- cgit v1.2.3 From 452b0bb21912b56b862409c50f15cb2acd4ea120 Mon Sep 17 00:00:00 2001 From: Hellseher Date: Sat, 14 Nov 2015 00:24:46 +0000 Subject: [A] extra links Links : : CLiki : Awesome Common Lisp : COMMON LISP A Gentle Introduction to Symbolic Computation : Common-Lisp.net --- common-lisp.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index 63183c1e..13f0023e 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -615,8 +615,15 @@ nil ; for false - and the empty list ## Further Reading [Keep moving on to the Practical Common Lisp book.](http://www.gigamonkeys.com/book/) +[A Gentle Introduction to...](https://www.cs.cmu.edu/~dst/LispBook/book.pdf) +## Extra Info + +[CLiki](http://www.cliki.net/) +[common-lisp.net](https://common-lisp.net/) +[Awesome Common Lisp](https://github.com/CodyReichert/awesome-cl) + ## Credits. Lots of thanks to the Scheme people for rolling up a great starting -- cgit v1.2.3 From b20abcb791cf3d2b0e7274fb300c6d0e7b791da1 Mon Sep 17 00:00:00 2001 From: Hellseher Date: Sat, 14 Nov 2015 00:33:00 +0000 Subject: [E] styling links --- common-lisp.html.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index 13f0023e..2b1f5de4 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -614,15 +614,15 @@ nil ; for false - and the empty list ## Further Reading -[Keep moving on to the Practical Common Lisp book.](http://www.gigamonkeys.com/book/) -[A Gentle Introduction to...](https://www.cs.cmu.edu/~dst/LispBook/book.pdf) +* [Keep moving on to the Practical Common Lisp book.](http://www.gigamonkeys.com/book/) +* [A Gentle Introduction to...](https://www.cs.cmu.edu/~dst/LispBook/book.pdf) ## Extra Info -[CLiki](http://www.cliki.net/) -[common-lisp.net](https://common-lisp.net/) -[Awesome Common Lisp](https://github.com/CodyReichert/awesome-cl) +* [CLiki](http://www.cliki.net/) +* [common-lisp.net](https://common-lisp.net/) +* [Awesome Common Lisp](https://github.com/CodyReichert/awesome-cl) ## Credits. -- cgit v1.2.3 From 2f85645c9f988663c2f584fb23392d873fc3c8e9 Mon Sep 17 00:00:00 2001 From: Anton Davydov Date: Wed, 9 Dec 2015 00:03:06 +0300 Subject: [common-lisp/en] Fix code in examples --- common-lisp.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common-lisp.html.markdown') diff --git a/common-lisp.html.markdown b/common-lisp.html.markdown index 2b1f5de4..9a23bc26 100644 --- a/common-lisp.html.markdown +++ b/common-lisp.html.markdown @@ -339,7 +339,7 @@ nil ; for false - and the empty list ;; The () in the above is the list of arguments for the function (defun hello (name) - (format nil "Hello, ~a " name)) + (format nil "Hello, ~a" name)) (hello "Steve") ; => "Hello, Steve" @@ -430,7 +430,7 @@ nil ; for false - and the empty list (defun walker (n) (if (zerop n) :walked - (walker (1- n)))) + (walker (- n 1)))) (walker 5) ; => :walked -- cgit v1.2.3