diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-14 19:53:31 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-14 19:53:31 -0700 |
commit | d790a3cca5309d86d752bb99a1eeaf3b6ee9c71b (patch) | |
tree | c1e5af9097cb899e121b06900f1b959a21413db5 /txr.1 | |
parent | 779cab95262a606d3e05cf2dc57487e234af9e39 (diff) | |
download | txr-d790a3cca5309d86d752bb99a1eeaf3b6ee9c71b.tar.gz txr-d790a3cca5309d86d752bb99a1eeaf3b6ee9c71b.tar.bz2 txr-d790a3cca5309d86d752bb99a1eeaf3b6ee9c71b.zip |
Remove @(do) from Lisp examples.
* txr.1: example for delay and gen doesn't need @(do).
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -16617,20 +16617,19 @@ only retrieve a cached value. .TP* Example: .cblk - @(do - ;; list is popped only once: the value is computed - ;; just once when force is called on a given promise - ;; for the first time. + ;; list is popped only once: the value is computed + ;; just once when force is called on a given promise + ;; for the first time. - (defun get-it (promise) - (format t "*list* is ~s\en" *list*) - (format t "item is ~s\en" (force promise)) - (format t "item is ~s\en" (force promise)) - (format t "*list* is ~s\en" *list*)) + (defun get-it (promise) + (format t "*list* is ~s\en" *list*) + (format t "item is ~s\en" (force promise)) + (format t "item is ~s\en" (force promise)) + (format t "*list* is ~s\en" *list*)) - (defvar *list* '(1 2 3)) + (defvar *list* '(1 2 3)) - (get-it (delay (pop *list*)))) + (get-it (delay (pop *list*))) Output: @@ -17281,12 +17280,11 @@ stands for Generate Until Null. .TP* Example: .cblk - @(do - ;; Make a lazy list of integers up to 1000 - ;; access and print the first three. - (let* ((counter 0) - (list (gen (< counter 1000) (inc counter)))) - (format t "~s ~s ~s\en" (pop list) (pop list) (pop list)))) + ;; Make a lazy list of integers up to 1000 + ;; access and print the first three. + (let* ((counter 0) + (list (gen (< counter 1000) (inc counter)))) + (format t "~s ~s ~s\en" (pop list) (pop list) (pop list))) Output: 1 2 3 |