freenode/lisp - IRC Chatlog
Search
16:18:35
kinope
Rewrote my simple queue closure today as a class and honestly it's much easier to grok
16:19:21
phoe
borei: an advantage of a funcallable instance over closures is that it's much easier to inspect the state in case of debugging.
16:20:01
phoe
like, you literally check the slot values of the funcallable instance, as opposed to using implementation-dependent means to get the values and what else from the places that are closed over
16:20:42
borei
https://pastebin.com/qeTicWt3 <- this form do what im looking for, it points me that i don't understand how does macros works
16:21:21
kinope
I had a look at cl-speedy-queue afterwards and whoa! the performance blew mine out of the water.
16:21:53
TMA
beach: I am trying to be careful. I too have been rebuffed in a similar way on too more ocasions than I care to count.
16:24:28
Bike
borei: compare (macroexpand-1 '(defnode ...)) to that form, and observe whta is different
16:28:16
kinope
Apparently cl-speedy-queue is non-consing. I'm wondering how that works. My queue class operates on lists and I think I have a constant complexity algorithm but it's still very slow. How does one create a data structure that operates faster than consing lists, I thought that the list was as deep as you could go in lisp. Am I making sense?
16:28:41
borei
after macroexpand-1 let form just gone, meaning that there is no lexical environment - is it correct statement ?
16:29:26
jackdaniel
that may require some modulo arithmetic if you want to make it rotary, but either way that should not cons
16:54:51
kinope
Reading the design document for Flexichain now, it seems to tackle a problem that is a bit larger than I need right now. Interesting none the less. If I ever build an application with my framework flexichain seems like a good candidate for text fields and such. I'm going to study the design of cl-speedy-queue for my own edification, but I'm probably going to use it for the message queue for now.
17:02:08
kinope
One has to specify the size of the queue when using speedy-queue, but when I think about it I don't think the message queue needs resizing, or even needs to be so big. Since a stable actor network shouldn't have a queue of unprocessed messages growing however fast or slowly towards infinity anyway. Should be possible to determine the size of queue needed for a given application.
17:26:04
_death
it looks like it represents a queue as a vector with head/tail pointers (and a sentinel for some reason.. maybe related to concurrency?) .. one issue is that it doesn't remove references to values when it dequeues
19:10:37
phoe
(Lisp-Koans #u"https://github.com/google/lisp-koans") (CL-on-Exercism #u"https://exercism.io/tracks/common-lisp")
19:25:32
nwoob
one advice I want from you guys, my problem solving skill is weak. what are the ways to improve them
19:27:11
phoe
nwoob: 1) think, 2) write code, 3) ask for help, 4) adjust code based on review, 5) GOTO 1
19:28:40
selwyn
practise... and after you have solved a problem (any problem) try to think how it could have been solved better, what went well/ what was a waste of time, etc. and use the lessons learnt next time
19:33:22
bhartrihari
It might also be helpful to find some interesting puzzles initially to get you going. Like riddle books by Raymond Smullyan for logical (and chess) puzzles. (He also teaches how to think about certain kinds of problems, and go about solving them).
22:14:01
nwoob
I learned recursion from little schemer and there is not return statement while calling recursive function but in other languages I have to add return statement before recursive call why?
0:12:47
kinope
_death: It looks like a sentinel only in name, but its not like a sentinel that you'd use for a list. It's a symbol called 'empty, and it probably exists for the very readon
0:14:27
kinope
the queue doesnt dereference values so it needs a quick way to determine if the queue is effectively empty
0:19:08
kinope
in the case that the queue is effectively empty the head and tail pointers are changed to point to it. But they are not really pointers either, they are just numbers that are used in an array/vector indexing operation
1:36:41
kinope
Morning all! Question. Is it just a matter of style whether one should make a small abstraction like (not (null x)) => not-empty_p, as an inlined function or a macro?
2:00:34
edgar-rft
kinope: I usually decide such a question by looking at my code. If the code is littered with (not (null x)) or some other repetitive pattern I try to find a shorter abstraction for it, but only if it makes the code easier to understand for a human. Every abstraction makes it necessary to learn a new symbol, so it makes no sense to abstract each and everything that only appears rather seldom in my code.
2:06:48
kinope
edgar-rft: Great! thanks. Should one make the abstraction a macro or a inlined function depending on the complexity of the operation?
2:08:59
no-defun-allowed
Macros shouldn't be where functions can be used, so an inlined function would suffice.
2:51:41
White_Flame
a big problem with inline functions in SBCL in particular, is that if you end up with hundreds of them in a single function body (as in a macroexpansion), it can massively slow down compilation