A list of puns related to "Anaphoric macro"
I used to write CL daily but sadly haven't touched it in quite some time. I also don't believe I ever used macros so extensively (beyond with-x style macros). I also recall that extensive abuse of anaphoric macros is a bad idea.
However, I'm trying to inject some more CL into my daily routine, and had a particular case where I want to make use of anaphora. I have a CL instance running that I use to notify me of some things, run some jobs manually and/or automatically. I'd like to write these monitoring pieces using something more human than what I have now.
I have a function that, given some config values, outputs a list of assoc lists of current state variables:
(defun get-state (conn line)
(declare (ignore conn line)) ; removed to simplify
'((("Count" . 7) ("Stage" . 6) ("LastUser" . "Mary"))
(("Count" . 3) ("Stage" . 4) ("LastUser" . "Ted"))))
And I write something like the function below where I basically write something like below (I could use remove-if-not below, but this is a simplified form):
(defun monitor-when-ted-modified (conn line)
(let ((states (get-state conn line)))
(loop for state in states
when (equalp (assoc-value state "LastUser" :test #'equalp) "Ted")
collect state)))
I have a few scenarios such as "send all filtered results", "send if single result > N" (which can be stated as a sort of the previous scenario), "send if results change."
Before I get too far down the rabbit hole, taking the ted-modified example, what I'd like next is something more like:
(defmonitor ("ted-conn" "ted-line")
(equalp lastuser "Ted"))
I've implemented this, which assumes a single assoc list, for the time being.
(defun alist-to-let-clause (alist)
(loop for (key . value) in alist
collect (list (intern (string-upcase key)) value)))
(defmacro amonitor (alist &body body)
(with-gensyms (let-clause)
`(let ((,let-clause ,@(alist-to-let-clause ,alist)))
(let ((it "ok!") ;; testing ability to use "it"
,@let-clause)
,@body))))
> (amonitor (first (get-state 1 2)) 1)
(FIRST (GET-STATE 1 2))
Error: Cannot take CAR of FIRST.
Now, it appears as though the expansion isn't occurring as I expect for the assoc list.
I started playing around with the above but have clearly (imo) forgotten how macros work. In the interest of both educating myself and in getting off the ground, I'd
... keep reading on reddit β‘I don't want to step on anybody's toes here, but the amount of non-dad jokes here in this subreddit really annoys me. First of all, dad jokes CAN be NSFW, it clearly says so in the sub rules. Secondly, it doesn't automatically make it a dad joke if it's from a conversation between you and your child. Most importantly, the jokes that your CHILDREN tell YOU are not dad jokes. The point of a dad joke is that it's so cheesy only a dad who's trying to be funny would make such a joke. That's it. They are stupid plays on words, lame puns and so on. There has to be a clever pun or wordplay for it to be considered a dad joke.
Again, to all the fellow dads, I apologise if I'm sounding too harsh. But I just needed to get it off my chest.
Do your worst!
I'm surprised it hasn't decade.
For context I'm a Refuse Driver (Garbage man) & today I was on food waste. After I'd tipped I was checking the wagon for any defects when I spotted a lone pea balanced on the lifts.
I said "hey look, an escaPEA"
No one near me but it didn't half make me laugh for a good hour or so!
Edit: I can't believe how much this has blown up. Thank you everyone I've had a blast reading through the replies π
It really does, I swear!
Buenosdillas
Theyβre on standbi
Pilot on me!!
Dad jokes are supposed to be jokes you can tell a kid and they will understand it and find it funny.
This sub is mostly just NSFW puns now.
If it needs a NSFW tag it's not a dad joke. There should just be a NSFW puns subreddit for that.
Edit* I'm not replying any longer and turning off notifications but to all those that say "no one cares", there sure are a lot of you arguing about it. Maybe I'm wrong but you people don't need to be rude about it. If you really don't care, don't comment.
When I got home, they were still there.
What did 0 say to 8 ?
" Nice Belt "
So What did 3 say to 8 ?
" Hey, you two stop making out "
I won't be doing that today!
[Removed]
You take away their little brooms
This morning, my 4 year old daughter.
Daughter: I'm hungry
Me: nerves building, smile widening
Me: Hi hungry, I'm dad.
She had no idea what was going on but I finally did it.
Thank you all for listening.
There hasn't been a post all year!
Why
Itβs pronounced βNoel.β
After all his first name is No-vac
What, then, is Chinese rap?
Edit:
Notable mentions from the comments:
Spanish/Swedish/Swiss/Serbian hits
French/Finnish art
Country/Canadian rap
Chinese/Country/Canadian rock
Turkish/Tunisian/Taiwanese rap
There hasn't been a single post this year!
(Happy 2022 from New Zealand)
Nothing, it just waved
Him: I can explain everything!
(It's his best joke yet I think)
Bob
So that I could frequently say, "I am going to walk 5 miles now."
Edit: My most popular post on Reddit! π Thank you for the awards.
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.