<nij>
These are not exported elisp functions, but we can evaluated them manually.
<nij>
By using these, I can confidently switch to the process I want.
<nij>
And then the command that sends string (to be interpreted as commands) to the connected process is (sly-interactive-eval "(+ 1 1)"), for example.
<nij>
Phew~ finally I can control it directly from xmonad ~_~
frodef has quit [Ping timeout: 246 seconds]
ex_nihilo has quit [Ping timeout: 264 seconds]
bitmapper has joined #lisp
domovod has joined #lisp
pankajsg has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
Wezl has quit [Ping timeout: 260 seconds]
domovod has quit [Quit: WeeChat 3.0]
wxie has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
ex_nihilo has joined #lisp
zulu-inuoe has quit [Read error: Connection reset by peer]
mrcom has quit [Ping timeout: 265 seconds]
dbotton has quit [Quit: This computer has gone to sleep]
nij` has joined #lisp
nij has quit [Ping timeout: 260 seconds]
rumbler31 has quit [Remote host closed the connection]
dbotton has joined #lisp
madage has quit [Remote host closed the connection]
madage has joined #lisp
hjudt has quit [Ping timeout: 240 seconds]
charles` has quit [Ping timeout: 258 seconds]
wxie1 has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
wxie1 is now known as wxie
greeb has quit [Ping timeout: 246 seconds]
wxie has quit [Ping timeout: 240 seconds]
mrcom has joined #lisp
freshmaker666 has joined #lisp
freshmaker666 has joined #lisp
freshmaker666 has quit [Changing host]
zacts has quit [Quit: leaving]
ptrkriz has quit [Remote host closed the connection]
gaqwas has quit [Ping timeout: 256 seconds]
gaqwas has joined #lisp
mr-iznogud has joined #lisp
mmmattyx has quit [Quit: Connection closed for inactivity]
housel has quit [Read error: Connection reset by peer]
peasynt has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
<nij>
It says that common lisp uses package to resolve the problem. Can I see what's the name of the package? What if the package conflicts with existing package?
<nij>
It also says that Scheme resolves this by impose hygienic macros. How exactly do they do that (or should this go to #scheme)?
<no-defun-allowed>
In Common Lisp, you usually use GENSYM to make names of variables that the client shouldn't be able to see.
<beach>
nij: That would be the package that was current when the macro was created.
nij has quit [Remote host closed the connection]
<nij>
Hmm.. so perhaps wikipedia is outdated or something.
<nij>
Yeah.. that's what I read from gigamonkey.
nij has joined #lisp
<beach>
nij: No, two different problems.
<beach>
nij: What the article is referring to is a specific function called by the expansion of the macro. That function should then have a name that is typically in the same package as the name of the macro.
<beach>
nij: What no-defun-allowed is saying is that, if some lexical variable is needed by the expansion of the macro, but with a name that does not matter otherwise, then GENSYM is used.
<beach>
nij: All this is quite well explained in the book On Lisp by Paul Graham.
hendursa1 has joined #lisp
<no-defun-allowed>
The article mentions both GENSYM and using internal symbols.
<beach>
So it does.
<no-defun-allowed>
Those are in the "Temporary symbol creation" and "Packages" sections, respectively. Note that uninterned symbols, such as those made by GENSYM, have no package, so they can never conflict with other symbols.
hendursaga has quit [Ping timeout: 268 seconds]
frodef has quit [Remote host closed the connection]
<beach>
no-defun-allowed: That's not all there is to it though. If you use a symbol such as #:mumble in a macro, then it can conflict if macros are nested.
ravndal has quit [Quit: WeeChat 3.0]
<beach>
... it can conflict with itself in different nesting depths.
<nij>
I did notice that.. just had an impression that the package method was preferred.
<beach>
nij: They solve two different problems as I said.
<no-defun-allowed>
That is true, you will want to call GENSYM (or whatever symbol-creating function you choose) in the macro definition that is the result of another macroexpansion, to avoid conflicts.
frodef has joined #lisp
<beach>
So it is important to use GENSYM so that different symbols are used for each (possibly nested) expansion.
aartaka has quit [Read error: Connection reset by peer]
ravndal has joined #lisp
aartaka_d has joined #lisp
aartaka has joined #lisp
<nij>
Oh I got temporarily disconnected.. now I see. Thank you beach.
<beach>
Sure.
<nij>
Thank you no-defun-allowed :)
<nij>
(I'm pretty sure you use defmacro all the time. Keep the hard work ;))
<no-defun-allowed>
I tend to over-use GENSYM.
deltab has quit [Ping timeout: 265 seconds]
<beach>
nij: Macros are not used nearly as often as functions (for instance), but when you need a macro, it is good that DEFMACRO is there.
<no-defun-allowed>
For example, there's a neat little "continuation" pattern, where one expands (with-foo () ...) to (flet ((continuation () ...)) (call-with-foo #'continuation)), in which case CONTINUATION can be an internal symbol.
aartaka_d has quit [Ping timeout: 246 seconds]
<no-defun-allowed>
SBCL uses internal symbols (for example, in WITH-MUTEX-HELD), but I GENSYM anyway.
<no-defun-allowed>
(Er, SBCL calls it WITH-MUTEX.)
<nij>
uh oh oh it's just a bad joke toward no-defun-allowed's nickname
<nij>
sorry, but yeah I am not pretty sure when to use macros either
ebrasca has joined #lisp
deltab has joined #lisp
frgo has quit [Remote host closed the connection]
nij has quit [Remote host closed the connection]
nij has joined #lisp
karlosz has quit [Quit: karlosz]
mr-iznogud has quit [Ping timeout: 265 seconds]
mrcom has quit [Ping timeout: 265 seconds]
devon has quit [Remote host closed the connection]
tgbugs has quit [Ping timeout: 246 seconds]
tassleoff has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 258 seconds]
tgbugs has joined #lisp
scymtym has quit [Remote host closed the connection]
aindilis[d] has joined #lisp
karlicoss[d] has joined #lisp
jacobpdq[d] has joined #lisp
koo5[d] has joined #lisp
freeman42x[d] has joined #lisp
CasAM[d] has joined #lisp
[d] has joined #lisp
dmiles[d] has joined #lisp
zacts has quit [Ping timeout: 240 seconds]
Stargazer2005 has joined #lisp
sveit has quit [Quit: Bye]
sveit has joined #lisp
galex-713 has quit [Ping timeout: 272 seconds]
galex-713 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
Zeco has joined #lisp
Stargazer2005 has quit [Quit: Connection closed]
aartaka has joined #lisp
Lord_of_Life_ has joined #lisp
aartaka_d has quit [Ping timeout: 240 seconds]
Stargazer2005 has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
aartaka has quit [Ping timeout: 246 seconds]
koo5[d] has quit [Remote host closed the connection]
jacobpdq[d] has quit [Remote host closed the connection]
freeman42x[d] has quit [Remote host closed the connection]
CasAM[d] has quit [Remote host closed the connection]
karlicoss[d] has quit [Remote host closed the connection]
[d] has quit [Remote host closed the connection]
dmiles[d] has quit [Remote host closed the connection]
aindilis[d] has quit [Remote host closed the connection]
h4ck3r9696 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
aartaka has joined #lisp
scymtym has joined #lisp
[d] has joined #lisp
<no-defun-allowed>
Well, you couldn't use macros to implement WITH-MUTEX, and requiring the client to use CALL-WITH-MUTEX wouldn't look great.
nij has quit [Remote host closed the connection]
nij has joined #lisp
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
surabax has quit [Quit: Leaving]
Stargazer2005 has quit [Quit: Connection closed]
Anonymous_ has joined #lisp
frodef has quit [Ping timeout: 264 seconds]
random-nick has joined #lisp
<[d]>
<no-defun-allowed#0000> Well, you couldn't use macros to implement WITH-MUTEX, and requiring the client to use CALL-WITH-MUTEX wouldn't look great.
<flip214>
did anyone manage to compress streams with CL-PDF? swank cross-reference tells me that I can activate the SALZA2 (LOAD-ZLIB) function, but *compress-streams* stays NIL
<jmercouris>
give someone enough money, and they will make the time
Inline has joined #lisp
<beach>
Sure, but that might involve quitting the dayjob.
<jmercouris>
Yeah, that's true
<beach>
jmercouris: For instance, I could spend up to 1k€ per month for at least 6 months to get help with SICL-related projects, but there just aren't any people that are both available and qualified.
<jmercouris>
I bet if you had 300k€ per month, many more qualified people would suddenly be available
<jmercouris>
I think a lot of the problem with Common Lisp is the money available in the ecosystem, the problem is not technological
<jmercouris>
People learn JS not because it is a Oasis in a desert of bad languages, but because there is money to be made
<jmercouris>
why? industry movements, who knows why
<beach>
Yes, there is obviously some amount where people would quit their dayjobs.
<jmercouris>
the problem is and will continue to be a question of money
Bike has joined #lisp
<jmercouris>
there are many more people who would like to use Lisp more often, but they cannot, because having fun programming doesn't always put food on the table
<jmercouris>
slingings bits of JS however, often does
<beach>
That's not all there is though. A lot of the work that we need done requires more basic knowledge than your typical Web job in industry.
amb007 has quit [Read error: Connection reset by peer]
<jmercouris>
sure, many things are pioneering efforts rather than implementing yet another CRUD site
<jmercouris>
however, there are plenty of highly qualified people working in reesearch that requires lots of background
nij has joined #lisp
<aeth>
You need charismatic projects. Then qualified people might be willing to take a pay cut (because if they're American they might be making well over $300,000 and you'll never have FAANG money).
amb007 has joined #lisp
<jmercouris>
Yes, you're right aeth
<jmercouris>
maybe Nyxt will change that
<jmercouris>
I don't anticipate having FAANG level money, but I do anticipate success
mmohammadi9812 has quit [Read error: Connection reset by peer]
tgbugs has quit [Ping timeout: 246 seconds]
Lycurgus has quit [Quit: Exeunt]
mmohammadi9812 has joined #lisp
<aeth>
I wouldn't call a web browser "charismatic", but unfortunately Mozilla seems to be doing its best to implode recently, so maybe it will be one in the future.
<aeth>
(Especially mobile, wow I hate that redesign.)
<jmercouris>
well, your mistake is in thinking that Nyxt is a web browser
<jmercouris>
Nyxt is a lisp platform
dbotton has quit [Quit: This computer has gone to sleep]
<jmercouris>
anyways, what would be a 'charismatic' project?
amb007 has quit [Read error: Connection reset by peer]
<jmercouris>
Mezzano?
amb007 has joined #lisp
dbotton has joined #lisp
<aeth>
Gamedev is probably the perennial software field where people take pay cuts to join. The rest are fairly opportunistic, like e.g. a social network in the past. Maybe VR or AR in the near future?
<jmercouris>
I don't find game development particularly inspiring or technologically interesting
<aeth>
Chat seems to be a fairly strong motivator, too...
<aeth>
Never would've motivated me since we have IRC, of course.
<aeth>
Maybe self-driving cars were an example of this in the past? They have the money now, though.
amb007 has quit [Read error: Connection reset by peer]
<Xach>
I think I may get to use ldiff in real code today!
norserob has quit [Quit: leaving]
amb007 has joined #lisp
<aeth>
jmercouris: I've probably missed a huge amount of categories just because they've always seemed fairly boring to me. e.g. maybe NoSQL was like this in the past. As in, just plain boring database stuff with a PR spin.
<jmercouris>
well, one mans boredom is another man's fascination
imode has joined #lisp
<jmercouris>
I'm sure most people here find browsers relatively boring
<aeth>
Yeah. It's probably hard to tell which fields had lots of people willing to take pay cuts in over the years to work in. Probably only VCs have that complete data set.
<beach>
Maybe a killer app rather than an OS would be "charismatic". Imagine something like MuseScore but written in Common Lisp instead.
rumbler31 has joined #lisp
<beach>
I mean, an OS is what we need, but it would be hard to make people accept and use it.
norserob has joined #lisp
yonkunas has joined #lisp
<beach>
It is hard for me to understand why anyone would write such a thing in C++.
<jmercouris>
Nyxt is supposed to be the killer App
<jmercouris>
Mezzano is supposed to be the OS :-D
<_death>
Xach: ldiff/member idiom is cool
<jmercouris>
I'll report back in 10 years if I've made headway or not...
<Xach>
_death: i feel like i don't use ldiff enough, so it makes me smile when i come up with a new, non-contrived reason to use it.
<Xach>
now if only i could find reasons to use nreconc or revappend more
<beach>
jmercouris: I was under the impression that large parts of Nyxt are written in C or C++. Not so?
<jmercouris>
Nothing in Nyxt is written in C
<jmercouris>
we just use foreign libraries
<_death>
Xach: another use could be (do* ((right list (rest right)) (left nil (ldiff list right))) ((null right)) ...)
rumbler31 has quit [Ping timeout: 264 seconds]
nij has left #lisp ["ERC (IRC client for Emacs 27.1)"]
<beach>
jmercouris: But those are written in C or C++, right?
<jmercouris>
that's correct, but they are not part of Nyxt
<beach>
Still, I wouldn't be able to run Nyxt on an OS without a C compiler.
<jmercouris>
sure, luckily C code can compile on Mezzano
<jmercouris>
and we will also make a renderer at some point that we can afford to
<jmercouris>
s/that/when
<beach>
Yeah, I wasn't thinking of Mezzano right then.
<_death>
Xach: looks like I used ldiff twice in aoc2020.. I was certain that I have some revappend uses somewhere as well, but can't find'em right now
Blukunfando has quit [Ping timeout: 246 seconds]
theothornhill has joined #lisp
zaquest has quit [Quit: Leaving]
mmohammadi9812 has quit [Ping timeout: 240 seconds]
theothornhill has quit [Remote host closed the connection]
renzhi has joined #lisp
Stargazer2005 has joined #lisp
zaquest has joined #lisp
Anonymous_ has quit [Remote host closed the connection]
dbotton has quit [Quit: This computer has gone to sleep]
wsinatra has joined #lisp
red-dot has joined #lisp
<red-dot>
Hello everyone.
<red-dot>
anyone on Windows using UIOP:run-program will a full path?
<red-dot>
e.g. (uiop:run-program "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe")?
luni has quit [Quit: Connection closed]
pfdietz has joined #lisp
wsinatra has quit [Ping timeout: 240 seconds]
<red-dot>
It doesn't seem like uiop:run-program works with absolute paths, at least not with SBCL and Windows. I thought this was working in the past...
<pfdietz>
The CLHS has some thing that are in direct conflict with each other. complex types, I'm looking at you.
dbotton has joined #lisp
Stargazer2005 has quit [Quit: Ping timeout (120 seconds)]
KeyboardWorrier has quit [Ping timeout: 265 seconds]
pfdietz has quit [Quit: Ping timeout (120 seconds)]
<Bike>
oh, are there parts that disagree about how they work with upgrading?
<Bike>
yyyyyes. super
mmohammadi9812 has joined #lisp
theothornhill has joined #lisp
nij has joined #lisp
<nij>
After getting stumpwm from ql:quickload, can I make install using asdf, but not the GNU make tools as it's stated in the readme? https://github.com/stumpwm/stumpwm
<Bike>
i don't think asdf really does installations
<jmercouris>
you COULD have your asd file do the installation for you, but it is not part of ASDF
<nij>
What then is the make tools used commonly in CL community? GNU make tools?
<jmercouris>
typically just a makefile, yes
<jmercouris>
we don't need it for much, mostly just moving around an executable
<jmercouris>
possibly checking for dependencies, simplifying the compilation process for non lisp users
<nij>
if the users have sbcl and quicklisp installed, the compilation process would be easier?
<jmercouris>
well, yeah
<jmercouris>
how else could they compile CL without CL?
<nij>
First install CL for them as a dependency.
jeosol has joined #lisp
<nij>
Oh I see. At that stage you better use Make.
<jmercouris>
users do not need to compile your software for you to distribute it
<jmercouris>
you can distribute lisp images of your software compiled on similar machiens
<jmercouris>
s/machiens/machines
liberliver1 has joined #lisp
gxt has joined #lisp
liberliver has quit [Ping timeout: 258 seconds]
liberliver1 is now known as liberliver
Stargazer2005 has joined #lisp
<_death>
red-dot: try passing (list (uiop:native-namestring "C:\\...")) .. if a string is passed, uiop:run-program treats it as a "command", which I guess won't do with spaces and no quotes or something similar
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
toorevitimirp has quit [Remote host closed the connection]
v3ga has quit [Ping timeout: 258 seconds]
toorevitimirp has joined #lisp
_oldtopman has joined #lisp
lansiir has quit [Ping timeout: 272 seconds]
Major_Biscuit has quit [Ping timeout: 272 seconds]
nij has quit [Quit: ERC (IRC client for Emacs 27.1)]
Major_Biscuit has joined #lisp
Anonymous_ has joined #lisp
theothornhill has quit [Ping timeout: 272 seconds]
thatpythonboy has joined #lisp
<thatpythonboy>
hi
<beach>
Hello thatpythonboy.
<thatpythonboy>
if i read roots of lisp paper, will i know lisp-like qualities such as read/eval/macros
<thatpythonboy>
i prefer rootsoflisp as i find gigamonkeys too big
<beach>
I don't know that paper. Do you have a link?
<ecraven>
so it seems to use *exactly* the same names for things
<_death>
there's also dylan, goo, etc. but they all miss some CLOS features (and may have features not in CLOS, though we also have a good MOP)
* beach
forgot about Dylan.
tgbugs has joined #lisp
<thatpythonboy>
that is just a function that julia calls a method due to multiple dispatch
<phoe>
using julia nomenclature though, julia's GFs *do* have methods
dbotton has quit [Quit: This computer has gone to sleep]
<phoe>
so do CL generic functions
<ecraven>
beach: I wish prefix-dylan would have taken off
<_death>
thatpythonboy: a generic function contains a bunch of methods.. when it's called, it decides which methods to call
<phoe>
and CL's methods are *not* "just" functions due to the presence of method combinations.
<ecraven>
phoe: is there *any* other language or non-CL-Lisp that has method combinations?
<beach>
ecraven: I see what you mean. RScheme from U Texas is essentially that.
<phoe>
ecraven: I am not aware of one
<ecraven>
the more I try to implement these things myself in different Schemes, the more I wonder how any of this can be even halfway performant in CL... you guys (and all before you) really do great work!
toorevitimirp has quit [Remote host closed the connection]
<beach>
ecraven: What are "these things" that you are referring to?
<ecraven>
making method dispatch fast
<thatpythonboy>
peter norvig shows a lisp interpreter in python, is there one in lisp itself?
<phoe>
thatpythonboy: yes, roots of lisp shows one
<ecraven>
I tried implementing a generic predicate dispatch in chez scheme (which is really fast by itself)
<_death>
thatpythonboy: PCL is a book, whereas roots of lisp is a short article.. you say PCL is too big, but you're also asking whether to read a short article, which is strange
<ecraven>
it's really slow :D
<thatpythonboy>
rootsoflisp says the interpreter is incomplete
<beach>
ecraven: I see. I suppose you read my paper about that, yes?
<ecraven>
beach: I read all of your and other people's papers
saganman has quit [Quit: WeeChat 1.6]
<beach>
Wow!
<ecraven>
I just need a few more years of time to implement things ;)
<beach>
Heh.
<ecraven>
(sorry, "on that subject", not "all of your papers in general")
<thatpythonboy>
just need a basic interpreter not big CL mess
<ecraven>
I should just give up and use CL already... :D I've been trying to implement halfway decent SLIME support in various Schemes, and none of them are even halfway as introspectable as the worst CL implementation
<phoe>
then that is going to work well
<_death>
thatpythonboy: maybe you should go to a non-CL channel then
<ecraven>
thatpythonboy: #lisp is actually
<ecraven>
#common-lisp
<beach>
thatpythonboy: It is not a great idea to call the topic of this channel a "mess". At least not if you want help.
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<alandipert>
Bless This Mess <3
Stargazer2005 has quit [Quit: Connection closed]
flazh has joined #lisp
rumbler31 has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
h4ck3r9696 has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #lisp
thatpythonboy has quit [Ping timeout: 240 seconds]
dbotton has joined #lisp
dbotton has quit [Client Quit]
<beach>
Strange one this "thatpythonboy" person. Maybe just a result of being uncomfortable and/or having some problems with English.
charles` has joined #lisp
amb007 has quit [Ping timeout: 246 seconds]
Alfr has joined #lisp
amb007 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
ebrasca` has joined #lisp
ebrasca has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 256 seconds]
cage_ has joined #lisp
dbotton has joined #lisp
catt has quit [Ping timeout: 240 seconds]
frodef has quit [Remote host closed the connection]
mmohammadi9812 has quit [Read error: Connection reset by peer]
mmohammadi9812 has joined #lisp
waleee-cl has joined #lisp
frodef has joined #lisp
<jmercouris>
format directive for a percentage?
thatpythonboy has joined #lisp
<jmercouris>
well, this is what I have resorted to: (format t "~0d%" (* 100 .01))
<jmercouris>
... :'(
<jmercouris>
ay yai yai
frodef has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
frodef has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
hnOsmium0001 has joined #lisp
bilegeek has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
dbotton has joined #lisp
thatpythonboy has quit [Ping timeout: 246 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
h4ck3r9696 has joined #lisp
theothornhill has joined #lisp
thatpythonboy has joined #lisp
v3ga has joined #lisp
madage has quit [Quit: leaving]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
thatpythonboy has quit [Ping timeout: 272 seconds]
nij has joined #lisp
theothornhill has quit [Ping timeout: 256 seconds]
aartaka has quit [Read error: Connection reset by peer]
aartaka_d has joined #lisp
<jasom>
jmercouris: if you need to do it a lot you can make your own printer function and use ~/
nij has quit [Remote host closed the connection]
<jmercouris>
I see
<jmercouris>
jasom: don't know how to do that, maybe I will learn it at some point
<jasom>
jmercouris: it comes at a cost of either polluting cl-user or having really long names
<jasom>
jmercouris: https://github.com/jasom/jtk/blob/master/ltk.lisp#L1089 <- example here. I like it very much for escaping because (format s "~A ~A ~A" x (escape y) z) is much harder to tell is correct than (format s "~A ~/ltk:esc/ ~A" x y z) (assuming the item in the 2nd position must be escaped and 1st and 3rd must not)
h4ck3r9696 has quit [Quit: Leaving.]
aindilis has quit [Remote host closed the connection]
<jasom>
totally OT, but the "correct" algorithm for escaping strings in TCL is *really* non-obvious, exposed in LTK by the fact that when I added this one, there were already 2 other escaping functions, one of which was super-linear in time and the other one of which was wrong.
<jackdaniel>
3 is a reasonable approximation of pi
<jackdaniel>
and it is a fixnum! :)
<_death>
it's also a good approximation of 2
<jackdaniel>
true that
<jasom>
it's a pretty darn good approximation of 0 in a lot of domains as well
<jackdaniel>
(zerop pi) ;-> T
<charles`>
on the cosmological scale, everything is nearby
<jmercouris>
(zerop pi) -> nil
<jmercouris>
not sure which version of CL you are using, must be a bug in ECL
<jasom>
(zerop (* 10 (round pi 10))) ;-> T
<_death>
jmercouris: ~D is for printing integers
<jmercouris>
yes, sorry
jeosol has quit [Quit: Ping timeout (120 seconds)]
karlosz has joined #lisp
tgbugs has quit [Ping timeout: 258 seconds]
tgbugs has joined #lisp
<jmercouris>
do (print element))(defparameter q '((a b c) (1 2 3)))
<jmercouris>
sorry, ignore that, starting over
<jmercouris>
(defparameter q '((a b c) (1 2 3)))
<jmercouris>
now I want to: (loop for element in q with a = (first element) do (print a))
<jmercouris>
the loop would print "a" and then "1"
<jmercouris>
possible? or do I need a let binding within the do?
<jackdaniel>
replace with with for
madage has joined #lisp
<jmercouris>
oh, thank you
<jackdaniel>
or replace replace with for
<jmercouris>
I confuse those
<jackdaniel>
eventually replace with for for
<jmercouris>
???
<jmercouris>
I'm now completely lost replace with for for?
<jackdaniel>
I was making a joke with the original "with with" that was /not/ a typo
aartaka_d has quit [Ping timeout: 258 seconds]
<jmercouris>
I see
<jmercouris>
11
<_death>
use let
<jmercouris>
_death:
<jmercouris>
why?
<_death>
you can also use FOR
<jackdaniel>
(loop for (i) in '((a b c) (1 2 3)) do (print i))
<jackdaniel>
so many ways
<jackdaniel>
(progn (print 'a) (print 1))
<_death>
if you get confused, others may find it confusing as well.. so if you're in doubt, just use the more primitive operators
<jackdaniel>
_death: this isn't a good argument for standard operators -- one would get confused why are you not using a designed operator to achieve something
<_death>
jackdaniel: well, here we're discussing LOOP.. there are many pitfalls with LOOP so I don't mind if I see someone using let there instead of other ways
<jackdaniel>
OK, that position could be defendable in context of loop, I've read it as a general advice
<_death>
jackdaniel: I think it may also stand as a general advice, but I'm not sure I want to defend that position
<jmercouris>
I have grown to love loop
<jmercouris>
maybe in time I will love format too
<jmercouris>
probably not for a long time
<_death>
jackdaniel: basically I'd rather read transparent, if a bit eccentric, code than confused code ;)
root____2 has joined #lisp
<jackdaniel>
me too. but I'd rather see defclass instead of bunch of interwingled closures
Major_Biscuit has quit [Ping timeout: 272 seconds]
<jmercouris>
I'm personally a master of obfuscating the purpose of my code via OO paradigms
<jmercouris>
I'm just joking of course
<jackdaniel>
interwingled is of course a mashup of intertwined and intermingled
<theothornhill>
Nilby: that almost looks like rust :)
* Nilby
*gasps*
rumbler31 has quit [Ping timeout: 240 seconds]
__jrjsmrtn__ has joined #lisp
<_death>
the last one is relevant to jmercouris's problem.. (format t "~{~1{~A~}~}" q)
_jrjsmrtn has quit [Ping timeout: 265 seconds]
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #lisp
mmohammadi9812 has quit [Read error: Connection reset by peer]
mmohammadi9812 has joined #lisp
catt has joined #lisp
anticrisis has joined #lisp
geospeck has joined #lisp
nij has joined #lisp
skapate has joined #lisp
skapata has quit [Ping timeout: 272 seconds]
skapate is now known as skapata
geospeck has quit [Remote host closed the connection]
heisig has quit [Quit: Leaving]
lowryder_ has quit [Ping timeout: 240 seconds]
luni has joined #lisp
alfred188 has joined #lisp
lowryder_ has joined #lisp
Sauvin has quit [Remote host closed the connection]
Christ0pher has joined #lisp
root____2 is now known as MrFantastik
nij has quit [Quit: ERC (IRC client for Emacs 27.1)]
<jasom>
jmercouris: only thing to remember with the loop FOR clause is that it *sets* the value, it does not make a new binding for each iteration
iskander- has joined #lisp
<jasom>
(mapcar #'funcall (loop for i from 1 to 10 collect (lambda () i))) ;-> (11 11 11 11 11 11 11 11 11 11)
<jasom>
compare to (mapcar #'funcall (loop for i from 1 to 10 collect (let ((i i)) (lambda () i))))
orivej has quit [Ping timeout: 240 seconds]
iskander has quit [Ping timeout: 264 seconds]
Josh_2 has joined #lisp
<Josh_2>
Hey, I am pretty sure I read a paper or blog post by someone in here regarding random testing?
iskander has joined #lisp
<Xach>
Josh_2: pfdietz has done a lot of work on the topic but i don't know of a paper or blog post about it by him.
<Josh_2>
I think thats the fella
iskander- has quit [Read error: Connection reset by peer]
aartaka has joined #lisp
pfdietz has joined #lisp
iskander- has joined #lisp
iskander has quit [Ping timeout: 258 seconds]
aartaka has quit [Ping timeout: 272 seconds]
xificurC has joined #lisp
mmohammadi9812 has quit [Remote host closed the connection]
mmohammadi9812 has joined #lisp
carkh has joined #lisp
tgbugs has quit [Ping timeout: 240 seconds]
mpontillo_ is now known as mpontillo
<xificurC>
is it possible to create an object that for all intents and purposes behaves like <X> but also has other capabilities? <X> = anything, e.g. string or list. E.g. I have a string holding a preprocessor template and depending on some configuration I later have to decide how to export it (escaped or not). I thought attaching the fact that it is a
<xificurC>
template as metadata would be a nice solution, since the exporter can get other, non-templaty strings as well.
<xificurC>
wrapping it in a special object deprives the rest of the code accessing that string as a string, which it really is
<Bike>
sounds like subclassing. you can't subclass string or list, though.
rogersm has quit [Quit: Leaving...]
<Nilby>
I made my own string class, but it's a lot of work, since it's below the "bolted on".
cods has quit [Ping timeout: 264 seconds]
cods has joined #lisp
<xificurC>
Bike you're right, it is subclassing basically. Thanks for the answers. I won't push against a wall then
<xificurC>
I thought it might be simple or that mop might allow it
theothornhill has quit [Ping timeout: 264 seconds]
tgbugs has joined #lisp
luni has quit [Quit: Connection closed]
<anticrisis>
Should this print without the SBCL version banner? echo '(write-line "Hello world")' | sbcl --no-sysinit --no-userinit --noprint --noinform
<Bike>
yeah so that ties in with the sort of confusing way sbcl command line options work
<Bike>
you need to specify --noinform before before the other options
<Bike>
because, when you run sbcl, you run the sbcl _runtime_, which loads the sbcl image which starts the sbcl _toplevel_, and then you can put options the user program can get at
<Bike>
--noinform is an option for the runtime while the others are options for the toplevel
<Josh_2>
is the :report keyword (when defining conditions) basically a shortcut for print-object
<Bike>
so, when you put --no-sysinit first, it thinks you haven't specified any runtime options, and --noinform is not a toplevel option so it's treated as a user option (I think)
<Bike>
Josh_2: yes. the clhs page gives the particular equivalence
<anticrisis>
Oh wow, and I was reading the man page
<anticrisis>
Nice, thank you
<Bike>
it's in the man page, though it's not a super detailed explanation
<anticrisis>
it might be nice to add to sbcl --help
<Bike>
i suppose the "Usage:" line in sbcl --help is supposed to indicate it
<Bike>
but --help is necessarily pretty brief
<Bike>
doesn't even mention noinform, huh
<anticrisis>
right :)
<anticrisis>
I just wanted to time it against the equivalent `node -e` to look at startup time
hiroaki has quit [Remote host closed the connection]
<_death>
xificurC: you could keep a hash-table associating that object with whatever you want.. you can have it weakly keyed
<xificurC>
startup time compared to node is really unfair
<anticrisis>
unfair to node?
hiroaki has joined #lisp
<xificurC>
yes, it's like comparing the fattest kid from the school to, well, any other kid
theothornhill has joined #lisp
<xificurC>
_death then it's a hash table, not a string anymore
<anticrisis>
I like to tease my node friend now and then
h4ck3r9696 has joined #lisp
<White_Flame>
your object is a key to the metadata table, instead of the metadata being on the object itself
<_death>
xificurC: no, you just use the hash-table to associate information with the object.. you pass the string as-is, and when you need to make a decision based on that information you check the hash-table.. but it could get tricky with mutable objects
<White_Flame>
of course, the object should be a heap object, too. if you have a fixnum or character or whatever, you're not going to be identifying that specific instance of that value, because it's not reified
theothornhill has quit [Ping timeout: 258 seconds]
<_death>
White_Flame: right
<xificurC>
ah, that makes sense and might be a viable alternative. Thanks _death and White_Flame
<White_Flame>
it's better than making everything inherit from my-object which piles on all the custom doodads you want on your stuff :-P
<White_Flame>
which is what you tend to end up with many other languages
<xificurC>
White_Flame I'd just put a hash-table in for storing metadata. It's a bit more convenient than having the metadata spread out in multiple hash tables, but it does the job
nij has joined #lisp
<_death>
you could have an object-plist (generalizing symbol-plist) accessor, sure.. with the caveats mentioned
VincentVega has joined #lisp
pfdietz has quit [Ping timeout: 240 seconds]
aindilis has joined #lisp
caret has quit [Read error: Connection reset by peer]
pfdietz has joined #lisp
[d] has joined #lisp
VincentVega has quit [Quit: Connection closed]
xificurC has quit [Quit: Connection closed]
cage_ has quit [Quit: Leaving]
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #lisp
Nilby has quit [Ping timeout: 258 seconds]
shka_ has quit [Ping timeout: 240 seconds]
red-dot has joined #lisp
liberliver has quit [Quit: liberliver]
liberliver1 has joined #lisp
nij has left #lisp ["ERC (IRC client for Emacs 27.1)"]
hnOsmium0001 has left #lisp [#lisp]
liberliver1 has quit [Ping timeout: 276 seconds]
<Josh_2>
If you kill a thread with destroy-thread I assume that (unwind-protect ..) doesn't matter?
h4ck3r9696 has quit [Quit: Leaving.]
narimiran has quit [Ping timeout: 240 seconds]
<no-defun-allowed>
It will not unwind, no.
<Josh_2>
Is there a portable version of SBCL's Timer subsystem?
Christ0pher has quit [Ping timeout: 240 seconds]
<no-defun-allowed>
I think a better idea is to interrupt the thread with a function which attempts to unwind, maybe by wrapping MAKE-THREAD so that the thread function is run in a dynamic environment with e.g. a CATCH tag or a handler for some error type. (Or can you (invoke-restart 'abort) in other threads?)
<Bike>
restarts are part of the dynamic context, so they're not copied for new threads
<Bike>
but implementations usually establish an ABORT or ABORT-THREAD restart in all threads
<Bike>
on sbcl for example, every thread function has an implicit (catch 'sb-thread::%abort-thread ...) around its body, and then when you abort it just throws, which naturally unwinds everything
<Josh_2>
no-defun-allowed: I normally just set a variable some place and the thread shuts itself down
<no-defun-allowed>
Right, then you could get stuck if the threads get stuck somehow. But the alternative is that, by unwinding, you could still violate the expectations the code author had w.r.t control flow, and break something.
<Josh_2>
if the threads get stuck the threads generally get yeeted
<no-defun-allowed>
(This is, in part, why the capability is only sent to the supervisor when something goes wrong.)
<Josh_2>
give 'em five seconds then yeet em
<Josh_2>
anyway I don't need to do that if there is a nice library that'll let me run a function in a thread every X amount of time
<Josh_2>
Trivial-timers :P
ukari has quit [Remote host closed the connection]
<no-defun-allowed>
Assuming your function returns instantaneously, (bt:make-thread (lambda () (loop until stopped? do (f) (sleep x)))) is pretty close.
<no-defun-allowed>
Adjusting the sleep time is an exercise for the reader.
ukari has joined #lisp
<no-defun-allowed>
Oh, also locking or CASing the stopped? variable, so that you don't get weird looks.
<Josh_2>
make it an object and use metalock
<Josh_2>
problem solved
aindilis has quit [Ping timeout: 240 seconds]
<Josh_2>
huh I just tried to quickload :trivial-timers and it failed
<Josh_2>
well rip I'll just do it myself
<no-defun-allowed>
I wonder what those locks are supposed to achieve.
<Josh_2>
what locks?
h4ck3r9696 has joined #lisp
<no-defun-allowed>
In metalock, specifically because they only make slot-value and (setf slot-value) atomic.
<Josh_2>
yes
<Josh_2>
well no it makes slot-value-using-class atomic
<no-defun-allowed>
Usually I find myself wanting to have exclusive access to slots for a while, e.g. with-lock-held. You could do unconditional sets with metalock, but you couldn't e.g. implement a counter properly.
<Bike>
no read-modify-write?
<no-defun-allowed>
That's the other option, yes.
<Josh_2>
anyway, it works as intended :P
<no-defun-allowed>
decentralise2 has a "locked box" structure for those kinds of things.
dbotton has quit [Quit: This computer has gone to sleep]
<Josh_2>
metalock has a metaclass for those kinds of things :P
<no-defun-allowed>
Empirically, it did work, but it's slow for concurrent access of course.
<Bike>
anyway, yeah, i wonder what the author of metalock is thinking. are there interesting thread safe data structures that don't need at least a RMW?
<Josh_2>
RMW?
<_death>
no-defun-allowed: but (incf (box-value box)) exposes a race condition
<Bike>
read-modify-write
h4ck3r9696 has quit [Quit: Leaving.]
<no-defun-allowed>
_death: Correct, use (with-unlocked-box (v box) (incf v))
<Josh_2>
Bike: I simply didn't want to have to call with-held-lock, thats all xD
<no-defun-allowed>
Perhaps (setf box-value) is a worse idea than box-value, but if your idea of concurrency is that of Josh_2, then it'll work fine. :D
<_death>
no-defun-allowed: so I'm not sure what the point of a box is? associate a lock with a value?
<Bike>
Josh_2: you don't understand what i'm saying. If you can only read or write slots, you cannot safely do things as simple as increment a counter.
<Bike>
Josh_2: If you read a slot and then write it, another thread could try to increment the slot value between those two operations, and then your write would undo that.
<Josh_2>
yes
<no-defun-allowed>
_death: Exactly that. And that it's harder to get at the value without locking.
<Bike>
okay, so what is that actually good for?
<Josh_2>
Not doing that
<Bike>
But what ARE you doing
<Josh_2>
Literally not having to called "with-lock-held"
<Bike>
I am asking what kind of thread safe algorithms don't need RMW or anything. I am curious.
<no-defun-allowed>
If you make (box <blah> :copier #'identity), then (modify! (box-value <that box>)) then it's game over, but it has made foot-shooting in concurrent programs a bit harder for me.
<no-defun-allowed>
I'm pretty sure it's only good for sharing "should I stop now?" variables which are set unconditionally.
<_death>
I think these things evolved into STM, which supports transparent composition.. (the other way is message passing)
<Josh_2>
generally I have just used it for a top level object that holds various other structures, such as a 'server' class etc
<Bike>
But what do you do with them if you can't write modifications back safely?
<no-defun-allowed>
I wasn't aware of STM when I started writing decentralise2, and I don't know how it would interact with hash tables, for example.
<_death>
no-defun-allowed: for counters and flags like that, atomic operations seem to work
<Josh_2>
I don't know what you mean
<no-defun-allowed>
You could have an ABA problem with metalock.
<Bike>
I don't understand what you're doing with the lcoks. In what situation would you want a "with-lock-held" as you put it to begin with?
<Bike>
I'm just asking what kind of synchronization you're actually doing.
<Josh_2>
a access is wrapped by a reader writer lock
<Bike>
i know what a rw lock is. i am asking about the higher level design.
<Josh_2>
what higher level design, there isn't any
<Bike>
I mean, look. Say I have an application with a bunch of threads. Each thread does some work and then increments a counter when its done. The main thread polls the counter to display a progress bar and then exits when it's maximized.
<Bike>
That's a higher level design. I think it's pretty simple but metalock can't do it. So I'm just kind of curious what sort of design you would use it for instead.
<Josh_2>
all that library does is change the default behaviour slot-value-using-class so that it performs It's read/write with a writer lock
pfdietz has quit [Quit: Connection closed]
<Josh_2>
or reader lock, it doesn't guarantee anything
<no-defun-allowed>
Exactly.
<Josh_2>
It's not meant to guarantee anything other than you won't read/write at the same time
gaqwas has quit [Ping timeout: 258 seconds]
<no-defun-allowed>
What can you achieve if it doesn't guarantee anything else?
<_death>
but blindly holding a lock when writing something doesn't get you much
<no-defun-allowed>
Suppose you have two threads A and B which run (setf (some-locked-thing) (1+ (some-locked-thing)), and (some-locked-thing) evaluates to 1 to start with.
<Josh_2>
yes
<no-defun-allowed>
One order of events is A reads 1, B reads 1, B sets 2, A sets 2. You want to lock for the whole SETF form, so that the whole computation is atomic.
attila_lendvai has quit [Ping timeout: 258 seconds]
<no-defun-allowed>
(i.e that it must be A reads 1, A sets 2, B reads 2, B sets 3, or that but with A and B swapped.)
<Josh_2>
Literally just guarantees that two threads wont write a slot at the same time
<Bike>
Yes but why. Why does it guarantee that and not more. What does that guarantee get you? What is it useful? I can't think of any thread coordination algorithms that only need that guarantee. That's what I'm asking. I don't understand what the usecase is. I understand what the guarantee is and you don't need to repeat that.
<Josh_2>
I have personally found it quite useful
<Bike>
for what?
<_death>
we have https://cliki.net/stmx .. though right now as I tried to load it, it got "stuck" until I C-c C-c'd, and at that point it resumed.. gasp
<Bike>
i remember that one did some pretty in depth sbcl stuff for the hardware STM
<Bike>
maybe it's out of date
<Bike>
er, hardware TM
<_death>
last commit was not long ago.. deleting the fasls it does the same, seems reproducible
<Bike>
i mean, in addition to that bt should have something. maybe the new api will
<_death>
right, it handler-case on condition
<no-defun-allowed>
Josh_2: that's only of any use for unconditional writes though, and it's of no use for exclusive access to mutable data.
<_death>
changing to (or warning error) does not help join-thread there for some reason.. but calling (stmx.lang::detect-thread-support) just works.. strange
<_death>
*evaluating in the repl
<Josh_2>
no-defun-allowed: yes
<_death>
ah, it could be the eval-always.. it does that while being compiled
pillton has joined #lisp
<_death>
it makes no sense to test for this while being compiled.. let me try :load-toplevel :execute
<_death>
much better.. loads fine and stmx.lang::*feature-list* looks good
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
minion has joined #lisp
specbot has joined #lisp
<_death>
hmm, but then it miscompiles start-thread etc. geez
<_death>
best to just remove that test and assume sanity :x
ebrasca` has quit [Remote host closed the connection]
Inline has quit [Ping timeout: 258 seconds]
galex-713 has quit [Ping timeout: 272 seconds]
bilegeek has quit [Remote host closed the connection]
bilegeek_ has joined #lisp
galex-713 has joined #lisp
vegansbane696 has quit [Remote host closed the connection]
ukari has quit [Remote host closed the connection]
Inline has joined #lisp
amb007 has quit [Ping timeout: 240 seconds]
vegansbane696 has joined #lisp
Inline has quit [Ping timeout: 256 seconds]
lalilulelo has joined #lisp
igemnace has joined #lisp
random-nick has quit [Ping timeout: 264 seconds]
gxt has quit [Ping timeout: 268 seconds]
rgherdt has quit [Ping timeout: 264 seconds]
hjudt has quit [Quit: leaving]
gxt has joined #lisp
hjudt has joined #lisp
theothornhill has joined #lisp
amb007 has joined #lisp
hjudt has quit [Ping timeout: 240 seconds]
theothornhill has quit [Ping timeout: 265 seconds]