summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--playlist.lisp14
-rw-r--r--user.lisp4
-rw-r--r--utilities.lisp12
-rw-r--r--vampire.lisp4
4 files changed, 18 insertions, 16 deletions
diff --git a/playlist.lisp b/playlist.lisp
index 0d6e589..c2350d1 100644
--- a/playlist.lisp
+++ b/playlist.lisp
@@ -239,12 +239,12 @@
(setf (tracks ctl)
(insert-nth track-ctl -1 (tracks ctl) t))
(setf (visiblep delbtn) t)
- (set-on-click delbtn (alambda (remove-track track-ctl)))
- (set-on-click downbtn (alambda (move-track-down track-ctl)))
- (set-on-click upbtn (alambda (move-track-up track-ctl))))
+ (set-on-click delbtn (thunk* (remove-track track-ctl)))
+ (set-on-click downbtn (thunk* (move-track-down track-ctl)))
+ (set-on-click upbtn (thunk* (move-track-up track-ctl))))
(set-on-time-update audio 'update-now-playing-time)
(set-on-ended audio 'advance-now-playing)
- (set-on-click item (alambda (play-this-audio audio)))))
+ (set-on-click item (thunk* (play-this-audio audio)))))
(defun create-track-listing (parent pl)
(when-let (ctl (cur-playlist-ctl parent))
@@ -272,7 +272,7 @@
(setf (place-holder url-input) "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
(set-on-click
button
- (alambda
+ (thunk*
(let* ((url
(value url-input))
(notice
@@ -322,7 +322,7 @@
(set-on-blur
input
- (alambda
+ (thunk*
(when (plusp (length (value input)))
(update-playlist-title pl (value input))
(setf (text title-elem) (value input)))
@@ -331,7 +331,7 @@
(set-on-click
title-elem
- (alambda
+ (thunk*
(setf (value input) (text title-elem)
(display title-elem) "none"
(display input) "inline")
diff --git a/user.lisp b/user.lisp
index a18ecb3..6fbbf66 100644
--- a/user.lisp
+++ b/user.lisp
@@ -22,7 +22,7 @@
(button (:content "Create" :bind btn)))
(set-on-click
btn
- (alambda
+ (thunk*
(new-playlist (session-user parent) :title (value pl-title))
(reload (location (connection-body parent)))))))
@@ -43,7 +43,7 @@
(a (:link url :content (playlist-title pl) :bind pl-link))))
(set-on-click
pl-link
- (alambda
+ (thunk*
(setf (url (location (connection-body parent)))
url)))))))
diff --git a/utilities.lisp b/utilities.lisp
index ec1ae55..ce14b7e 100644
--- a/utilities.lisp
+++ b/utilities.lisp
@@ -84,11 +84,13 @@
(nth m list) tmp)
list))
-(defmacro alambda (&body body)
- "Anaphoric lambda of one argument"
- `(lambda (it)
- (declare (ignorable it))
- ,@body))
+(defmacro thunk* (&body body)
+ "Returns a lambda of any number of arguments where those arguments
+ are ignored."
+ (let ((args (gensym)) )
+ `(lambda (&rest ,args)
+ (declare (ignorable ,args))
+ ,@body)))
(defun tmp-dir-name ()
(merge-pathnames
diff --git a/vampire.lisp b/vampire.lisp
index f99d5a3..e4940f9 100644
--- a/vampire.lisp
+++ b/vampire.lisp
@@ -45,7 +45,7 @@
(button (:content "Create" :bind btn)))
(set-on-click
btn
- (alambda
+ (thunk*
(new-playlist (session-user parent) :title (value pl-title))
(reload (location (connection-body parent)))))))
@@ -66,7 +66,7 @@
(a (:link url :content (playlist-title pl) :bind pl-link))))
(set-on-click
pl-link
- (alambda
+ (thunk*
(setf (url (location (connection-body parent)))
url)))))))