From fb71ff846cf299f2b53454d8d231859dee21e67a Mon Sep 17 00:00:00 2001 From: David Botton Date: Tue, 19 Jan 2021 22:19:40 -0500 Subject: [PATCH] change to use flet --- tutorial/11-tutorial.lisp | 30 +++++++++++++++--------------- tutorial/12-tutorial.lisp | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tutorial/11-tutorial.lisp b/tutorial/11-tutorial.lisp index 5299e1e..a488d00 100644 --- a/tutorial/11-tutorial.lisp +++ b/tutorial/11-tutorial.lisp @@ -41,30 +41,30 @@ (good-button (attach-as-child body "button1id")) (scary-button (attach-as-child body "button2id"))) - (defun on-click-good (obj) - (let ((alert-div (create-div body))) + (flet ((on-click-good (obj) + (let ((alert-div (create-div body))) - (place-before form alert-div) - (setf (hiddenp form) t) + (place-before form alert-div) + (setf (hiddenp form) t) - ; Bootstrap specific markup - (setf (css-class-name alert-div) "alert alert-success") - (setf (attribute alert-div "role") "alert") - - (setf (inner-html alert-div) - (format nil "
radios value : ~A

+ ;; Bootstrap specific markup + (setf (css-class-name alert-div) "alert alert-success") + (setf (attribute alert-div "role") "alert") + + (setf (inner-html alert-div) + (format nil "
radios value : ~A

textinput value : ~A

" - (radio-value form "radios") - (name-value form "textinput"))))) + (radio-value form "radios") + (name-value form "textinput"))))) - (defun on-click-scary (obj) - (reset form)) + (on-click-scary (obj) + (reset form))) ;; We need to overide the boostrap default to submit the form html style (set-on-submit form (lambda (obj)())) (set-on-click good-button #'on-click-good) - (set-on-click scary-button #'on-click-scary) + (set-on-click scary-button #'on-click-scary)) (run body))) diff --git a/tutorial/12-tutorial.lisp b/tutorial/12-tutorial.lisp index 9ea923a..7434681 100644 --- a/tutorial/12-tutorial.lisp +++ b/tutorial/12-tutorial.lisp @@ -67,30 +67,30 @@ (good-button (attach-as-child body "button1id")) (scary-button (attach-as-child body "button2id"))) - (defun on-click-good (obj) - (let ((alert-div (create-div body))) + (flet ((on-click-good (obj) + (let ((alert-div (create-div body))) - (place-before form alert-div) - (setf (hiddenp form) t) + (place-before form alert-div) + (setf (hiddenp form) t) - ; Bootstrap specific markup - (setf (css-class-name alert-div) "alert alert-success") - (setf (attribute alert-div "role") "alert") - - (setf (inner-html alert-div) - (format nil "
radios value : ~A

+ ;; Bootstrap specific markup + (setf (css-class-name alert-div) "alert alert-success") + (setf (attribute alert-div "role") "alert") + + (setf (inner-html alert-div) + (format nil "
radios value : ~A

textinput value : ~A

" - (radio-value form "radios") - (name-value form "textinput"))))) + (radio-value form "radios") + (name-value form "textinput"))))) - (defun on-click-scary (obj) - (reset form)) + (on-click-scary (obj) + (reset form))) ;; We need to overide the boostrap default to submit the form html style (set-on-submit form (lambda (obj)())) (set-on-click good-button #'on-click-good) - (set-on-click scary-button #'on-click-scary) + (set-on-click scary-button #'on-click-scary)) (run body)))