libera/#commonlisp - IRC Chatlog
Search
15:56:57
Josh_2
shka: got this so far, I think it will work https://plaster.tymoon.eu/view/2513#2513 each user will have their own product tree which they can modify as they wish, taking away and adding
15:57:45
Josh_2
Thank you for helping me, feels like you sprayed a bit of WD40 on my brain, lubricating it a bit
16:03:28
beach
You should avoid structs unless performance measures indicate that they would have a certain advantage to standard classes.
16:10:24
beach
Also, we keep inventing new techniques, like call-site optimization, that make it possible to inline slot accessors of standard objects in many cases. It would be silly to dumb down your programming style for reasons that may go away in the future.
16:13:19
beach
Same thing with generic functions. It would be silly to avoid generic functions in favor of ordinary functions if we can make generic dispatch as fast as ordinary function calls in many cases.
16:15:56
shka
keyword arguments are way to useful to not use even despite theoretical performance hit
16:17:42
shka
i've been programming in golang lately, lack of optional/named arguments lead to some intriguing oddities in the language
16:19:25
beach
Oh, just wait for the new version of the language. I presume it is like every other language in that the specification changes every year or so.
17:10:53
pjb
Josh_2: (format nil "~{~:[odd~;even~] ~A~^, ~}" (mapcan (lambda (n) (list (evenp n) n)) '(1 2 3 4 5))) #| --> "odd 1, even 2, odd 3, even 4, odd 5" |#
17:10:53
pjb
Josh_2: (format nil "~:{~:[~;even ~A; ~]~}" (mapcar (lambda (n) (list (evenp n) n)) '(1 2 3 4 5))) #| --> "even 2; even 4; " |#
17:10:53
pjb
Josh_2: (format nil "~{~[even ~:*~A~;odd~;even ~:*~A~;odd~;even ~:*~A~;odd~;even ~:*~A~;odd~]~^; ~}" '(1 2 3 4 5)) #| --> "odd; even 2; odd; even 4; odd" |#
17:11:45
pjb
Josh_2: but if you want to filter the list while printing, you will have to write a format function and use it with (format nil "~{~/fmt-only-even/~^, ~}" '(1 2 3 4 5))