jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
mseddon has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
CrazyEddy has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
madage has quit [Ping timeout: 240 seconds]
madage has joined #lisp
sympt_ has joined #lisp
sympt has quit [Ping timeout: 240 seconds]
nicktick has joined #lisp
hiroaki has quit [Ping timeout: 265 seconds]
Oladon has joined #lisp
gko_ has joined #lisp
zaquest has quit [Read error: Connection reset by peer]
Bourne has joined #lisp
zaquest has joined #lisp
EvW1 has quit [Ping timeout: 260 seconds]
orivej has joined #lisp
chipolux has joined #lisp
torbo has joined #lisp
froggey has quit [Ping timeout: 240 seconds]
froggey has joined #lisp
Jesin has quit [Quit: Leaving]
Alfr_ has joined #lisp
Jesin has joined #lisp
Alfr__ has quit [Ping timeout: 240 seconds]
CrazyEddy has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
abhixec has quit [Quit: leaving]
shifty has quit [Ping timeout: 264 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
torbo has quit [Remote host closed the connection]
<beach> Good morning everyone!
Bit_MCP has joined #lisp
abhixec has joined #lisp
orivej has quit [Ping timeout: 264 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 264 seconds]
Lord_of_Life_ is now known as Lord_of_Life
paul0 has quit [Read error: Connection reset by peer]
paul0 has joined #lisp
Bit_MCP has quit [Quit: Leaving]
u0_a156 has joined #lisp
<u0_a156> Thank you for reopening #lisp to non-registered users. :)
<beach> Uh, oh!
<u0_a156> Pleased to meet you bleach. Concerning CL, I'm awfully... lost when it comes to quicklisp and ASDF and what the difference is. :/
<aeth> Quicklisp is built on top of ASDF.
* beach gets ready to use /ignore much more.
<u0_a156> That explains why it was able to load... On another machine I tried to (ql:quickload "youtube") but it said ASDF wasn't new enough.
<aeth> Quicklisp's abstraction is the project, which is the top level directory, probably from a git repository. This can contain one or more ASDF systems, defined in DEFSYSTEMs in .asd files
<aeth> The complete mapping is here, but it has the long name (which is probably the last update from the, probably git, repository) https://www.quicklisp.org/beta/releases.html
<aeth> e.g. 1am-20141106-git is the project release of the project 1 am which provides the system 1am, but they don't always have to align, e.g. a few later you see 3bmd provides a bunch
<aeth> s/1 am/1am/
<u0_a156> I don't get that... But I have seen "3bmd" in ql:system-apropos names.
<aeth> I'll give a more dramatic example, much further down on that page. You can see on that page I linked to that "cl-sdl2" is the project name, but "sdl2" is the ASDF system name.
<aeth> So they don't have to align at all.
<aeth> Quicklisp is a higher level built on top of ASDF systems.
<u0_a156> In other words, an extra opportunity for misconfiguration...Never mess with configuration files, let the installer do it!
Joaozinho_Grande has joined #lisp
Joaozinho_Grande has left #lisp [#lisp]
EvW has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
gravicappa has joined #lisp
EvW has quit [Ping timeout: 244 seconds]
rumbler31 has quit [Ping timeout: 265 seconds]
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
shifty has joined #lisp
<jackdaniel> philweb: did you add uiop to dependencies?
orivej has joined #lisp
gravicappa has quit [Ping timeout: 240 seconds]
gravicappa has joined #lisp
heisig has joined #lisp
bocaneri has quit [Ping timeout: 256 seconds]
[ is now known as uplime
enrio has joined #lisp
bocaneri has joined #lisp
bocaneri has quit [Excess Flood]
bocaneri has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
<philweb> jackdaniel: I added asdf to dependencies thinking that would pull them in (apparently it didn't work) then I tried adding the named packages (uiop/os and uiop/pathname) but that results in component not found when loading my top-level system
iAmDecim has quit [Quit: WeeChat 2.8]
enrioog has joined #lisp
mindCrime has quit [Excess Flood]
mindCrime has joined #lisp
bsd4me has quit [Quit: Leaving]
enrio has quit [Ping timeout: 264 seconds]
Lycurgus has joined #lisp
ggole has joined #lisp
abhixec has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: closed"]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
bhartrihari has joined #lisp
Lycurgus has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
liberliver has joined #lisp
pve has joined #lisp
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
vaporatorius__ has quit [Ping timeout: 264 seconds]
philweb has quit [Ping timeout: 245 seconds]
<jackdaniel> add uiop, it is a system
<jackdaniel> or put (require 'asdf) as a prelude code
gko_ has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
toorevitimirp has joined #lisp
mankaev has quit [Ping timeout: 246 seconds]
nanoz has joined #lisp
enrioog has quit [Ping timeout: 260 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
hendursa1 has joined #lisp
mankaev has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
akoana has left #lisp ["Leaving"]
zaquest has quit [Quit: Leaving]
notzmv has quit [Ping timeout: 240 seconds]
wxie has joined #lisp
zaquest has joined #lisp
FreeBirdLjj has joined #lisp
wxie has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Ping timeout: 244 seconds]
mankaev has quit [Ping timeout: 260 seconds]
galex-713 has quit [Ping timeout: 272 seconds]
Inline has joined #lisp
notzmv has joined #lisp
hiroaki has joined #lisp
toorevitimirp has quit [Ping timeout: 265 seconds]
galex-713 has joined #lisp
mankaev has joined #lisp
VincentVega has joined #lisp
orivej has joined #lisp
enrioog has joined #lisp
VincentVega has quit [Remote host closed the connection]
nanoz has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 256 seconds]
dra has joined #lisp
<Inline> i have a question with regards to condition messages getting shown in jupyter
<Inline> that file when loaded in the repl does not show any condition messages
treflip has joined #lisp
<phoe> Inline: in a clean REPL, you mean?
<phoe> because here you have a situation where you're redefining methods that were already present in Lisp
<phoe> these warnings will not appear if you have nothing to redefine
space_otter has quit [Remote host closed the connection]
CrazyEddy has joined #lisp
<Inline> those methods are all in the file classe7.lisp
<phoe> how many times did you load that exact file in Jupyter?
<phoe> and how many in the REPL?
<Inline> just once
<phoe> see, that's the difference
<Inline> in the repl the warnings are suppressed as they should be
<Inline> and in jupyter not
<Inline> so the question is why ?
<phoe> ooh, I see now
<Inline> or what i have todo in order to suppress the warnings there too
<phoe> I actually don't know; it seems like an issue with cl-jupyter, since I assume that's what you are using
<Inline> btw jupyter:install from a running repl has problems establishing a server connection, the server times out or whatever and gets killed
<Inline> when i use jupyter:install-image all is fine, connection-wise tho
orivej has joined #lisp
<Inline> jah, i suppose it's an issue around cl-jupyter together with threading or some such
lleiguay has joined #lisp
mindCrime has quit [Ping timeout: 240 seconds]
mindCrime has joined #lisp
ted_wroclaw has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
contrapunctus has left #lisp [#lisp]
orivej has quit [Ping timeout: 240 seconds]
bilegeek has quit [Quit: Leaving]
sm2n_ has joined #lisp
sm2n has quit [Ping timeout: 256 seconds]
contrapunctus has joined #lisp
<pve> Inline: what happens if you print *load-truename* in that file?
sm2n_ is now known as sm2n
enrioog has quit [Ping timeout: 256 seconds]
ukari has joined #lisp
orivej has joined #lisp
dra has quit [Quit: Leaving]
shangul has joined #lisp
mindCrime has quit [Ping timeout: 260 seconds]
mangul has joined #lisp
mindCrime has joined #lisp
gko_ has joined #lisp
random-nick has joined #lisp
shangul has quit [Ping timeout: 265 seconds]
Inline has quit [Ping timeout: 260 seconds]
ayuce has joined #lisp
bitmapper has quit [Ping timeout: 246 seconds]
Oladon has quit [Quit: Leaving.]
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
pve has quit [Ping timeout: 265 seconds]
nicktick has quit [Ping timeout: 264 seconds]
mankaev has quit [Ping timeout: 272 seconds]
mankaev has joined #lisp
mindCrime has quit [Ping timeout: 260 seconds]
ted_wroclaw has quit [Quit: Textual IRC Client: www.textualapp.com]
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #lisp
ukari has quit [Ping timeout: 240 seconds]
bhartrihari has joined #lisp
ukari has joined #lisp
nicktick has joined #lisp
minion has quit [Remote host closed the connection]
specbot has quit [Remote host closed the connection]
farooqkz__ has joined #lisp
mangul has quit [Ping timeout: 240 seconds]
RedMallet has joined #lisp
lleiguay has left #lisp [#lisp]
jprajzne has quit [Quit: jprajzne]
ukari has quit [Ping timeout: 240 seconds]
_whitelogger has joined #lisp
ralt has joined #lisp
rumbler31 has joined #lisp
mangoicedtea has joined #lisp
specbot has joined #lisp
minion has joined #lisp
RedMallet has quit [Quit: WeeChat 2.8]
dra has joined #lisp
mangul has joined #lisp
EvW1 has joined #lisp
farooqkz__ has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 256 seconds]
<remexre> is there a common naming convention for functions made to be passed as the second argument to SORT?
<beach> Maybe something containing LESSP or LESS-P?
<remexre> And, stepping back a bit, if I need to manipulate sets of a struct and sets of those sets, is there a better representation than sorted vectors?
<beach> OK, hold on a bit.
<beach> Sets are not sorted.
<remexre> er, I'm using sorting as a normalization procedure
<remexre> so I can do (member foo-set foo-foo-set :test #'equalp), to check for membership of the set in the set of sets
<beach> Well, then, it is impossible to answer your question, because there is no abstract data type named SET, simply because it is not possible to design one that has optimal performance for all possible set operations. That's why we have stacks, queues, union-find sets, binary trees, hash tables, etc.
<beach> So you need to come up with a protocol (i.e. a set of operations) that you need to perform on those sets. Then you will know the best data structure.
<remexre> I think I just need mapc and "insert, returning whether the item was present" (or separate member and insert, which is what I'm doing now)
<remexre> and mapc could be "convert to sequence" or "remove arbitrary element" as well
<beach> But if you can come up with a total order, then you can use binary search or you can use a balanced tree.
<beach> Then you will have an O(log n) algorithm rather than an O(n).
<beach> .. For INSERT and FIND.
<remexre> mhm, yeah; just wanted to be sure that there wasn't some better way built in
<remexre> thanks!
<beach> Sure.
* beach naively thought "better" meant just that.
<remexre> I mean, more "built in" than better
Lycurgus has joined #lisp
enrio has joined #lisp
galex-713 has quit [Read error: Connection reset by peer]
oni-on-ion has joined #lisp
galex-713 has joined #lisp
<u0_a156> I think this is close: ensure-gethash key hash-table &optional default https://common-lisp.net/project/alexandria/draft/alexandria.html#Hash-Tables
v88m has quit [Ping timeout: 256 seconds]
EvW1 has quit [Ping timeout: 256 seconds]
pve has joined #lisp
toorevitimirp has joined #lisp
<remexre> I thought hash tables (other than eq?) were quite slow
<beach> They are O(1) "average" complexity which is even better than a balanced tree. But again, it depends on what your domain can handle.
<beach> The overhead is somewhat large for a hash table, but that pays off when you have a lot of elements.
<beach> Compared to O(n), it pays off fairly fast. Not so fast for O(log n).
<remexre> yeah, I'm never going to have more than a hundred elements per set anyway, so I think constant factors would win out
Bourne has quit [Ping timeout: 240 seconds]
paul0 has quit [Quit: Leaving]
treflip has quit [Quit: WeeChat 2.6]
FreeBirdLjj has joined #lisp
mangul has quit [Ping timeout: 256 seconds]
<ralt> oh, I could've used ensure-gethash
FreeBirdLjj has quit [Ping timeout: 244 seconds]
<ralt> an hour ago I wrote a (let ((presentp (nth-value (gethash key table))) (if presentp (incf (gethash key table)) (setf (gethash key table) 0))
enrioog has joined #lisp
enrio has quit [Ping timeout: 246 seconds]
<ralt> which reminds me, anyone has an idea of how to do this better? https://pastebin.com/Jzd8hhab
<ralt> I have a hash table with millions of elements
<ralt> values are integers, and I want to get the top 10
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
nicktick has quit [Ping timeout: 240 seconds]
bitmapper has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
<ralt> the `(push v top-10) (sort top-10 #'<)` is not great but OTOH it's a list with 10 elements... I guess an `(insert-sorted v top-10)` would be better, but not by that much? idk
<beach> You can use MERGE.
<ralt> let me look that up
mangoicedtea has quit [Quit: Leaving]
<beach> Also, your elements are numbers?
Lycurgus has quit [Remote host closed the connection]
<beach> Do we know anything else about them? Integers? Range?
<MichaelRaskin> I believe separately storing the minimum and its position could be faster than sorting every time (but maybe array of length 10 is short enough)
<ralt> uint64 at worse
<beach> OK. No great help. :)
<ralt> MERGE looks interesting, trying to use it
<beach> Also, pop followed by push allocates memory. (SETF FIRST) would be better.
<ralt> so yes, I can replace the push/sort with merge
<ralt> well, with (setf first) I need to do a sort after
<beach> Right, that was an independent possibility.
<ralt> but maybe the memory allocations will be worse than the sorting?
<beach> Possibly.
toorevitimirp has quit [Remote host closed the connection]
<beach> Also, MichaelRaskin is right, you can use a vector, and you can use bubble sort or insertion sort which are linear if you only insert one element, but you already figured that out.
toorevitimirp has joined #lisp
<u0_a156> Can you sort a top-100 vector to sort less often? Not sure if would be facter.
<ralt> somehow even with pop/push I end up with "0 bytes consed" in (TIME)
<ralt> the pop/merge ends up with the least amount of CPU cycles
<ralt> the (SETF FIRST) + (SORT) ends up with double the amount of CPU cycles than pop/push/sort?
EvW has joined #lisp
<ralt> that's... not what I expected
<ralt> ah, no, I misread
<ralt> setf first+sort ends up with less instructions than pop/push/sort, which makes sense
caltelt has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
ebrasca has joined #lisp
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
<beach> Whew!
minion has joined #lisp
specbot has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
liberliver has quit [Ping timeout: 246 seconds]
philweb has joined #lisp
gungomanj has joined #lisp
treflip has joined #lisp
puchacz has joined #lisp
gungomanj has quit [Quit: Konversation terminated!]
enrio has joined #lisp
enrioog has quit [Ping timeout: 246 seconds]
<philweb> jackdaniel: getting closer. I've reduced the code to a trivial test and pasted it with notes in case there's something obvious I'm doing wrong: https://pastebin.com/YG1aqisj
samir has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
bhartrihari has joined #lisp
gko_ has quit [Ping timeout: 265 seconds]
C-16 has joined #lisp
pve has quit [Ping timeout: 256 seconds]
Bourne has joined #lisp
pve has joined #lisp
Misha_B has joined #lisp
Misha_B has quit [Remote host closed the connection]
ebrasca has quit [Remote host closed the connection]
cosimone has joined #lisp
treflip has quit [Quit: WeeChat 2.8]
pve_ has joined #lisp
vutral has joined #lisp
pve has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
treflip has joined #lisp
orivej has joined #lisp
alandipert9 has joined #lisp
alandipert has quit [Ping timeout: 246 seconds]
alandipert9 is now known as alandipert
shifty has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
renzhi has joined #lisp
mankaev has quit [Ping timeout: 264 seconds]
mankaev has joined #lisp
v88m has joined #lisp
abhixec has joined #lisp
theseb has joined #lisp
theseb has left #lisp ["Leaving"]
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
shifty has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
Oladon has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
pfr has quit [Ping timeout: 256 seconds]
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
Inline has joined #lisp
pve_ has quit [Quit: leaving]
pve has joined #lisp
<Inline> sorry pve
<Inline> pve: just saw it now
bitmapper has quit [Read error: Connection reset by peer]
<Inline> pve: it just prints "/home/user/lisp/classes7.lisp")
<Inline> which is correct
<Inline> ooh
<Inline> hmmmm
<pve> Inline: no problem
<Inline> pve: solved it
<pve> great
<Inline> pve: (handler-bind ((warning #'sb-ext::muffle-warning))
<Inline> (load "/home/oleo/lisp/classes7")) suppresses the warnings
bitmapper has joined #lisp
<Inline> pve: either wrapping that around the forms in my file or doing it like above both solves my problems
<pve> I was kind of expecting it to print the filename twice or something
<Inline> nope
<Inline> pve: it just really prints the filename once
<pve> actually different filenames even
<Inline> no again
<pve> because that usually triggers the warning
<Inline> hmm
<Inline> seems like it's lexenv is different somehow
narimiran has joined #lisp
<pve> like if you defun foo in the repl and then load a file that also contains (defun foo () ..), you should get the warning
<Inline> yes
<pve> but if you managed to muffle them, then maybe it's ok
<Inline> i had sb-kernel:redefinition-with-defun warnings too i think with other files
<Inline> pve: the problem is declarations don't take effect
<pve> ok, I'm more interested in why it thinks they are redefinitions in the first place :)
<pve> maybe just define load-quietly and call it a day?
<Inline> pve: (declaim (sb-ext::muffle-conditions cl:warning)) has no effect in that file
oni-on-ion has quit [Remote host closed the connection]
<pve> should that work? I've never tried it..
oni-on-ion has joined #lisp
<pve> is it related to sb-ext:*muffled-warnings*
bocaneri has quit [Read error: Connection reset by peer]
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
<Inline> that is set to only 'sb-kernel:uninteresting-redefinition'
<Inline> in both the repl and the jupyter kernel image
shifty has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
cosimone has quit [Ping timeout: 244 seconds]
narimiran has quit [Quit: leaving]
pfr has joined #lisp
rippa has joined #lisp
<contrapunctus> Let's make a CL implementation called +, and watch the world burn. 😏
natter has joined #lisp
<contrapunctus> ...ah, on second thoughts, that wouldn't be too effective. (I'm referring to code which uses ++ to ignore the next expression.)
paul0 has joined #lisp
Inquieto has joined #lisp
treflip has quit [Quit: WeeChat 2.6]
_whitelogger has joined #lisp
pfr has quit [Ping timeout: 260 seconds]
pfr has joined #lisp
space_otter has joined #lisp
renzhi has quit [Ping timeout: 264 seconds]
torbo has joined #lisp
torbo has quit [Remote host closed the connection]
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
cosimone has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
mindCrime has joined #lisp
kaftejiman has joined #lisp
nullheroes has quit [Quit: WeeChat 2.9]
nullheroes has joined #lisp
nullheroes has quit [Client Quit]
nullheroes has joined #lisp
EvW1 has joined #lisp
heisig has quit [Quit: Leaving]
dominic34 has joined #lisp
dominic34 has quit [Excess Flood]
dominic34 has joined #lisp
ralt has joined #lisp
torbo has joined #lisp
mindCrime has quit [Excess Flood]
mindCrime has joined #lisp
vutral has quit [Quit: Connection closed for inactivity]
izh_ has joined #lisp
ljavorsk_ has joined #lisp
ljavorsk_ has quit [Remote host closed the connection]
ljavorsk_ has joined #lisp
gravicappa has quit [Ping timeout: 246 seconds]
mrcom has quit [Quit: This computer has gone to sleep]
mrcom has joined #lisp
enrio has quit [Ping timeout: 246 seconds]
pfr has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
terpri_ has joined #lisp
izh_ has quit [Quit: Leaving]
CrazyEddy has quit [Ping timeout: 265 seconds]
ljavorsk_ has quit [Read error: Connection reset by peer]
ljavorsk_ has joined #lisp
terpri has quit [Ping timeout: 260 seconds]
bsd4me has joined #lisp
samir has quit [Remote host closed the connection]
pve has quit [Quit: leaving]
orivej has quit [Ping timeout: 240 seconds]
terpri_ is now known as terpri
Lycurgus has joined #lisp
ljavorsk_ has quit [Ping timeout: 264 seconds]
VincentVega has joined #lisp
gaqwas has quit [Remote host closed the connection]
cosimone has quit [Quit: Quit.]
ggole has quit [Quit: Leaving]
luckless_ has quit [Remote host closed the connection]
luckless_ has joined #lisp
<VincentVega> Good day/night all! Wondering, so I have a dynamic variable (it's global and all functions use it conveniently). Now, I want to run the code in a few threads (independently), each having it's own (thread-specific) value of the dynamic variable. Can this be done?
bocaneri has joined #lisp
<aeth> I think dynamic variables are always thread-specific? Probably an implementation-specific thing, but I thought it's sort of part of the bordeaux-threads assumptions.
<aeth> oh, no, wait, it's more complicated than that
kaftejiman has quit [Remote host closed the connection]
<aeth> VincentVega: I think the most portable way to do it would be to wrap the thread entry point (inside of the lambda that's run on the new thread in bt:make-thread) in a LET?
shifty has joined #lisp
<aeth> initial-bindings is what I must've been thinking of, but it has some implementation-specific behavior
<VincentVega> aeth: hmm, yes, indeed, let over lambda sounds like it's gonna work!
<VincentVega> aeth: thank you!
<phoe> let over lambda?
<phoe> more like lambda over let
<aeth> right
<aeth> let over lambda is the implementation-specific behavior BT is warning you not to do in bt:make-thread's documentation
<phoe> you want to pass the value lexically, and then bind the dynavar inside the lambda
<aeth> lambda over let looks like it's safe.
Lycurgus has quit [Remote host closed the connection]
<phoe> (let ((foo *foo*)) (bt:make-thread (lambda () (let ((*foo* foo)) ...))))
<phoe> this way the value is passed via a lexical closure which is guaranteed to work
<aeth> ^
<VincentVega> thanks guys, I see what you are saying
cosimone has joined #lisp
renzhi has joined #lisp
cosimone has quit [Remote host closed the connection]
gaqwas has joined #lisp
cosimone has joined #lisp
Inline has quit [Ping timeout: 240 seconds]
shifty has quit [Ping timeout: 264 seconds]
cosimone has quit [Remote host closed the connection]
<stylewarning> phoe: a pro gamer move also known as the dynamic-lexical razzledazzle
<aeth> It's a design pattern. This means the proper solution is to use a make-thread* macro to do that instead. :-p
<VincentVega> stylewarning: I like that : D
akoana has joined #lisp
<edgar-rft> let's paternally design pitiful design patterns
mangoicedtea has joined #lisp
satousan has joined #lisp
VincentVega has quit [Remote host closed the connection]
luna_is_here has quit [Ping timeout: 240 seconds]
<White_Flame> I guess a with-* macro would be a design pattern, as there aren't specifically scope management operations in lisp
luna_is_here has joined #lisp
<aeth> White_Flame: Correct. When Lispers criticize design patterns as unnecessary in Common Lisp, I bring up the case of "macro design pattern" conventions, like with-foo (usually with an unwind-protect), define-foo (usually with a defun, but maybe it deals with a different global definition), do-foo (iteration), etc.
gaqwas has quit [Ping timeout: 265 seconds]
<aeth> White_Flame: Although to be fair, you could turn some of these into macros, even though only define-modify-macro (like incf/decf) actually is like that in the standard.
<fwoaroof[m]> I generally think of "design patterns" as involving fairly complicated code structures that have to be manually implemented every time
<White_Flame> macros are literally for automating away manual design patterns ;)
<fwoaroof[m]> Yeah, at that point I call them "abstractions" :)
<White_Flame> well, their syntactic abstractions, not abstractions behind function APIs
<fwoaroof[m]> A design pattern is the result of not being able to abstract in a specific way
<White_Flame> *they're
<fwoaroof[m]> Most languages don't give you the ability to implement syntactic abstractions
<fwoaroof[m]> So you end up with boilerplaty design patterns
* edgar-rft defines (defmacro with-several-megatons-of-unnecessary-bloat ....)
<aeth> Hey, I've seen that before, with different names!
ralt has quit [Quit: Connection closed for inactivity]
<aeth> (I've probably written it, too...)
<edgar-rft> aeth: but I generalized it!
<aeth> solve the package name conflict issue in Quicklisp so you can say with-every-single-asdf-system-in-quicklisp-loaded
<edgar-rft> now I can write (with-several-megatons-of-unnecessary-bloat (+ 1 1))
<fwoaroof[m]> Just embed CL in CL
<aeth> edgar-rft: yes, but my macro bloats more
<fwoaroof[m]> And load every system in its own CL
<edgar-rft> beach currently does that, it's called SICL :-)
<fwoaroof[m]> And then run the host CL in docker, in a VM on a server somewhere
<aeth> think of all of the fun surprises realized by modifying global state, e.g. you might discover that (with-every-system-loaded (+ 1 1)) => ٢
dra has quit [Remote host closed the connection]
<edgar-rft> (apply #'1+ global-warming))
edgar-rft has quit [Quit: Leaving]
ayuce has quit [Remote host closed the connection]
satousan has quit [Quit: WeeChat 2.3]
renzhi has quit [Ping timeout: 256 seconds]
abhixec has quit [Quit: leaving]
puchacz has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 244 seconds]
renzhi has joined #lisp
pfr has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
cjb has joined #lisp
mangoicedtea has quit [Quit: Leaving]
shifty has joined #lisp
MichaelRaskin has quit [Quit: MichaelRaskin]
random-nick has quit [Ping timeout: 264 seconds]