<rumbler31_>
trying to figure out uiop:with-temporary-file
<phoe>
what about it?
<rumbler31_>
what is the point of specifying :want-stream-p to be nil, the body runs after the stream is closed, but how is this useful if there was no way for user code to know what file handle was just created?
<rumbler31_>
in other words, it seems like you only want to do this if you want to simply create an empty temporary file, and the only thing I can think of is that you would then want to do something with this file, either in the body (like open it back up) or simply return the newly created pathname out of this form. Am I missing something?
rumbler31 has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
<rumbler31_>
it also looks like you can't nest them and include calls to :close-stream
rumbler31 has joined #lisp
l1x has quit [Quit: Connection closed for inactivity]
urek has joined #lisp
urek has quit [Remote host closed the connection]
<phoe>
where's :want-stream-p? I can't see it in WITH-TEMPORARY-FILE
<phoe>
I see it only in CALL-WITH-TEMPORARY-FILE
v88m has joined #lisp
varjag has quit [Ping timeout: 256 seconds]
<matta>
rumbler31_: uiop:want-stream-p requires a pathname if a stream isn't requested. CALL-WITH-TEMPORARY-FILE will close the stream before running the body as you said, but the path name will be available.
<rumbler31_>
sorry I was mixing my functions, in the macro to with-temporary-file, I meant the equivalent of specitying want-stream-p, which is to specify a value for the :stream parameter, but yes
<rumbler31_>
so once you have this file, what would you want to do with it that didn't require opening it up in the body, that also wouldn't require keeping it around and binding the pathname to a variable that was in scope after the body returns?
surabax has quit [Quit: Leaving]
<rumbler31_>
for example, after reading the macroexpands, I don't see a cleaner way to write the following https://pastebin.com/jWHC46J0
<matta>
I think it would be cleaner to call UIOP:RUN-PROGRAM within the WITH-TEMPORARY-FILE body.
<phoe>
but... wait a second
<phoe>
in with-temporary-file, you don't want the streams
<phoe>
but then you call with-open-file which opens the streams anyway
<phoe>
why
<phoe>
cannot you specify both :pathname and :stream in there?
rumbler31 has quit [Remote host closed the connection]
<matta>
Also, I think :keep t is an edge case for WITH-TEMPORARY-FILE. I'd suggest putting as much code as is reasonable within the body, for clarity -- including your call to uiop:run-program.
<phoe>
no streams, no keeps, no setq
andreyorst has quit [Quit: WeeChat 3.0]
<phoe>
only :if-exists :supersede that is required in this case because both files exist
<matta>
yes, exactly like phoe's paste.
rgherdt has quit [Ping timeout: 268 seconds]
gzj has joined #lisp
gzj has quit [Remote host closed the connection]
wxie has joined #lisp
gzj has joined #lisp
vutral has joined #lisp
cyraxjoe has quit [Quit: I'm out!]
wxie has quit [Ping timeout: 240 seconds]
wxie has joined #lisp
cyraxjoe has joined #lisp
voidlily has quit [Ping timeout: 264 seconds]
<rumbler31_>
phoe: so this started because I originally had all the code inside the body of two with-temporary-file calls
<rumbler31_>
I specified a parameter for both :stream and :pathname, and in the beginning of the body of the first call to with-temporary-file, I printed the string to the open stream. I then needed to close the stream to flush it to disk (and I don't need the stream open anymore) so I specified :close-stream
cyraxjoe has quit [Quit: I'm out!]
<rumbler31_>
before opening the next invocation of with-temporary-file, wherein I did the same thing. After the inner :close-stream label, I put the run-program call and specified the pathnames as arguments to the command. When I macroexpanded, I found that the innermost body was being carried up
<rumbler31_>
its easier to code up a few examples than explain it, but basically in the macro, if a :close-stream is called, the body before is stored in a gensym "before" and the after in a gensym "after"
voidlily has joined #lisp
<rumbler31_>
:close-stream "is specified" sorry
cyraxjoe has joined #lisp
<rumbler31_>
with nested macros with :close-stream labels, the innermost body was being stored in a place where it couldn't see all the bindings
<rumbler31_>
actually gimme a moment and I'll just write it up and paste it
<rumbler31_>
ok scratch all that. I wasn't fully reading my error messages
wxie has quit [Read error: Connection reset by peer]
wxie has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
rumbler31 has joined #lisp
Stanley00 has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
matryoshka` has joined #lisp
matryoshka has quit [Read error: Connection reset by peer]
shifty has quit [Ping timeout: 240 seconds]
wxie has quit [Ping timeout: 240 seconds]
* akoana
must be day or must be night
wxie has joined #lisp
Josh_2 has quit [Remote host closed the connection]
rumbler31 has quit [Remote host closed the connection]
thmprover has joined #lisp
vutral has quit [Quit: Connection closed for inactivity]
phireh has quit [Ping timeout: 240 seconds]
Alfr_ has joined #lisp
sm2n has joined #lisp
<beach>
Good morning everyone!
Alfr has quit [Ping timeout: 268 seconds]
<shinohai>
Buenas dias beach !
rumbler31 has joined #lisp
<pyc>
Good morning beach. Which timezone do you belong to?
<beach>
UTC+1
<pyc>
beach: wow! must be early morning there.
<beach>
Colleen: Time in Bordeaux.
<Colleen>
The time in Bordeaux. is 2020.12.31 05:11:00.
marusich has quit [Ping timeout: 260 seconds]
orivej has joined #lisp
marusich has joined #lisp
karlosz has joined #lisp
<mfiano>
Hello all. I have a programming problem here, and the answer is probably either row-major-aref or displaced arrays, but I'm unsure how to utilize them very well, and definitely not for this problem.
<mfiano>
I have a large 2D array of grid cell objects. I have a function that takes as input this grid, and a rectangle object. Inside the function, I convert the coordinates of each of the rectangles corners into grid coordinates, and I now need to loop over the sub-region of the grid denoted by these 4 coordinates, collecting the grid cell objects.
<mfiano>
Any help would be appreciated.
karlosz has quit [Ping timeout: 256 seconds]
<beach>
(loop for i from a below b append (loop for j from c below d collect (grid i j)))
bitmapper has quit [Quit: Connection closed for inactivity]
<mfiano>
Oh hmm, that might work. Though I can't really afford that append in there.
<beach>
Try nconc then.
<beach>
Or do it manually.
<mfiano>
Thank you beach.
<mfiano>
I was overthinking this at this late hour on the opposite side of the world.
varjag has joined #lisp
<beach>
(loop with result = '() for i from a below b do (loop for j from c below d do (push (grid i j) result)) finally (return (nreverse result)))
<mfiano>
did you just destructively modify a list literal? :)
<beach>
No.
<aeth>
In terms of style, I tend to use (list) there for exactly the reason mfiano brought up
<aeth>
even though obviously it doesn't modify a list literal
wxie has quit [Ping timeout: 256 seconds]
varjag has quit [Ping timeout: 256 seconds]
pfdietz has quit [Ping timeout: 245 seconds]
<mfiano>
I guess I'm still a little lost and probably need sleep. I have 8 variables, denoting the x,y coordinates of 4 grid locations.
<aeth>
absolutely
<aeth>
that's what I'd do in the situation
<aeth>
sleep solves all problems
<beach>
In terms of my loop, the corners would be [a c] [a d] [b c] [b d]
sjl has quit [Quit: WeeChat 2.2-dev]
wxie has joined #lisp
Jesin has quit [Read error: Connection reset by peer]
Jesin has joined #lisp
<akoana>
beach: just trying to follow, what would (grid i j) be? I get Undefined function: GRID
skapata has quit [Remote host closed the connection]
kenran has joined #lisp
MrNo1 has joined #lisp
MrNo1_ has joined #lisp
C-16 has joined #lisp
MrNo1_ has quit [Remote host closed the connection]
MrNo1 has quit [Ping timeout: 272 seconds]
frost-lab has quit [Quit: Connection closed]
villanella has joined #lisp
C-16 has quit [Quit: leaving]
bilegeek has quit [Quit: Leaving]
<kenran>
I've started reading PCL and I've just finished the chapter where he builds a small unit test framework. One question that popped into my mind is about the function (defun report-result (result form) (format t "something~a" result form)): Would it be possible to use a macro for that as well?
<kenran>
Or is it because 'result' is only known at runtime?
<phoe>
why use a macro
gutter has quit [Remote host closed the connection]
<kenran>
In general, I'm now wondering if/when to use macros where a normal function would do as well.
<phoe>
never
<phoe>
whenever a normal function does well, always use normal functions
<kenran>
that sounds like a good rule
<kenran>
thanks
quazimodo has quit [Ping timeout: 246 seconds]
<kenran>
At the moment, I'm just playing around to get a feeling for what can be done at macro-expansion time and what needs to be done at runtime. It's a bit mind-boggling :D
<kenran>
I've done some Clojure, but didn't really use macros at all there except for a few simple cases.
wxie has quit [Ping timeout: 272 seconds]
luckless has quit [Ping timeout: 240 seconds]
luckless has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
kaftejiman has quit [Remote host closed the connection]
gzj has quit [Remote host closed the connection]
_whitelogger has joined #lisp
jjong has joined #lisp
rumbler31 has joined #lisp
gutter has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
gaqwas has joined #lisp
rumbler31_ has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Ping timeout: 264 seconds]
amirouche has quit [Ping timeout: 260 seconds]
amirouche has joined #lisp
frost-lab has joined #lisp
orivej has joined #lisp
gaqwas has quit [Remote host closed the connection]
_whitelogger has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
hendursaga has joined #lisp
<sauvin>
Feh. I'm still trying to figure out how to (setq b a) in fun1 such that it's visible *nowhere* outside fun1.
<beach>
You are not allowed to use SETQ on undefined variables. Your Common Lisp implementation should have given you a warning.
<shka_>
hmmmm
rgherdt has joined #lisp
<shka_>
more like, you are advised against it
<shka_>
strongly
<beach>
shka_: It is undefined behavior.
<shka_>
really?
<beach>
Yes.
<shka_>
on lisp uses setq to define global variable...
<shka_>
bad Graham, bad
<beach>
Yes, so do some other books, and so does the Common Lisp HyperSpec in places.
<phoe>
yes
<shka_>
i suspect that there is story behind it, but it is pretty bad
paul0 has joined #lisp
<phoe>
the story is that old lisps used that to define global variables
<phantomics>
For the purpose of teaching, it's convenient to do it that way. Wrapping everything in a (let) form is confusing to new users
<shka_>
i suspected this
<phantomics>
Although it starts them out with a bad habit
<phoe>
and modern CL implementations preserve this behavior for backwards compatibility even though it's not CL-valid
<shka_>
this is evil
<phoe>
...but some of them issue warnings
<beach>
shka_: It is just that, in the past, we thought it was a good idea to help the programmer by doing "something reasonable". But then we got wiser because a simple typo can then create a lot of debugging time.
<beach>
shka_: Same with having DEFMETHOD implicitly create the generic function.
<shka_>
beach: the infamous good idea fairy
<phoe>
DWIM
<shka_>
defmethod creating generic is so nice when you forget to add the packagename to the function name
<shka_>
and it just implicitly creates THE WRONG METHOD
<shka_>
eh
<beach>
That's what I mean, yes.
<shka_>
this is actually worse then setq
<shka_>
because there is no reason to use setq instead of setf
<beach>
Using SETF on an undefined variable is also undefined behavior.
gaqwas has joined #lisp
gaqwas has joined #lisp
<shka_>
right
<sauvin>
Yes, it looks like let is what I'm looking for.
<oni-on-ion>
ouch
<beach>
oni-on-ion: What?
<sauvin>
When I say I have zero experience with lisp, I'm lying, but not by much: about twenty years ago, I did a couple of years of writing AutoLISP stuff.
<shka_>
beach: do you plan to error-out on setq that should not be?
<phoe>
autolisp isn't very close to CL
<shka_>
in sicl
<phoe>
and even the overall CL programming style has changed over the last twenty years
<oni-on-ion>
had thought; torah is like CLHS, the written version. now there is the oral "tradition" which is not written down, as the other half of the story. it feels like CL has this kind of situation as well =)
<beach>
shka_: Maybe so.
<phoe>
oni-on-ion: yes, the holy scriptures and their interpretations sort of situation
<oni-on-ion>
yeh
<sauvin>
I'm not counting AutoLISP as lisp experience for that very reason. It's not like what I believe I remember.
<shka_>
beach: if it won't prevent compilation of 99% of lisp systems? ;-)
<phoe>
but with CLHS the issue isn't because it's holy, it's because fixing it and ensuring backwards compatibility is a massive and time-taking and thankless task
<phoe>
and I say that as someone who tried
<oni-on-ion>
heh, fair
<phoe>
shka_: it sounds more like finding bugs in dependencies of 99% lisp systems
<phoe>
I'm all up for it
<beach>
shka_: I already catch things that others don't, like incorrect LOOP clause order.
<shka_>
phoe: heh, this is the same thing
<phoe>
:D
<oni-on-ion>
beach, i wanted to ask you earlier, what is main reason for new implementation? just curious
<beach>
oni-on-ion: The stuff that I want would be unacceptable to the maintainers of existing Common Lisp implementations, so that was my only option.
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<shka_>
oni-on-ion: clean room approach vs 50 years old code base?
<phoe>
writing in full CL as opposed to writing in subsets of CL and/or other languages
<beach>
oni-on-ion: Like first-class global environments, more use of CLOS, "cleaner" code.
<beach>
That too, yes.
<oni-on-ion>
ahh! very cool. and very fair
<oni-on-ion>
is it fun/worthwhile so far ? quite the undertaking
<beach>
oni-on-ion: It is a lot of work, but I am doing great progress. And I have had significant help.
<phoe>
it already has multiple benefits on the Lisp ecosystem, too
<phoe>
the project is highly modular and that's a big benefit, because we get e.g. Cleavir the compiler or Eclector the reader as fully portable and conforming libraries
<phoe>
and we can and do use them outside SICL.
<beach>
oni-on-ion: scymtym basically created Eclector (the reader). Bike and karlosz are working on the compiler. heisig did Trucler and the sequence functions. etc. etc.
<shka_>
clasp uses bits of sicl as well
<beach>
Indeed, Clasp uses the compiler and Eclector.
<oni-on-ion>
beach, ah awesome! very cool =)
<beach>
Thanks!
<oni-on-ion>
phoe, true; had noticed some of this
<oni-on-ion>
i've had gotten SICL and Clasp mixed up (not in name) and SICL is where my interest goes mainly. there seems to be much CL code that can be shared across imps
<beach>
That was my initial idea, yes.
<beach>
But as it turns out, it is not going to be easy.
<beach>
Since I use the full language to implement each module, most Common Lisp implementations can't use them. They must build up the system from a simple core, adding features for each new module.
<oni-on-ion>
have not seen Bike in a while
<beach>
He's on vacation probably.
<beach>
I don't have that problem with SICL, because of the way it is bootstrapped.
<oni-on-ion>
beach, ahh, hmm. i notice more and more SBCL-specific features happening. but no one wants to use them
pve has joined #lisp
<beach>
Such as?
<shka_>
oni-on-ion: because people like portable cod
<oni-on-ion>
shka_, i've rarely seen that in practice; but mostly in the form of "i like to keep another one around, CLISP or ccl or whatever, just to check make sure my code is portable"
<phoe>
what do you mean by SBCL-specific when you speak about type inference though?
<phoe>
type inference helps SBCL optimize otherwise portable code; there are not really many SBCL-specific declarations in there
amb007 has quit [Read error: Connection reset by peer]
<oni-on-ion>
phoe, i learned that SBCL has some kind of type inference, that others may not have. i am just about to google this now because i really like TI
<oni-on-ion>
eg: "new feature: SB-EXT:PRIMITIVE-OBJECT-SIZE can be used to interrogate the low-level size in memory of objects. (#1636910, reported by anquegi) "
amb007 has joined #lisp
<phoe>
that's not type inference though
<oni-on-ion>
im talking about 3 things at once
<phoe>
yes, I see
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
pve has quit [Ping timeout: 264 seconds]
pve has joined #lisp
<oni-on-ion>
the inferencing of types is sbcl, but done with CL portable code. this i understand =)
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<oni-on-ion>
but why i like TI does make a difference for developer (catching stuff early, even for eg. avoiding typo that takes a while to debug as beach mentioned a moment ago)
epony has joined #lisp
<oni-on-ion>
and i understand that nice/secure/performant code can be pure CL, but i am wondering -- why not use all the SBCL stuff ? i have not often seen the requirement of multiple implementations in the wild or in proprietary notes
orivej has quit [Ping timeout: 256 seconds]
<shka_>
oni-on-ion: not only portable between different implementations but also between different versions of sbcl
<shka_>
either back compatible, or forward compatible
luckless has quit [Ping timeout: 240 seconds]
<phoe>
oni-on-ion: future insurance
amb007 has quit [Read error: Connection reset by peer]
<phoe>
who knows if you won't want to run your code on ECL instead, e.g. for deployment on mobile devices
<shka_>
if you just write standard CL, avoid UBs and so one, it is possible to run it on both 1998 CL implementation and 2070 implementation
amb007 has joined #lisp
<phoe>
or on ABCL so it can benefit from real-time GC on the JVM
<phoe>
or on commercial implementations so it can benefit from their commercial goodness
<phoe>
or on CCL because you'll want to build against native macOS cocoa GUI
<phoe>
or on Clasp because you'll want to bind to C++
<phoe>
in all those situations, your #+sbcl is going to be sad
orivej has joined #lisp
galex-713 has joined #lisp
<shka_>
also notice, that stuff gets removed from sbcl
mrios222 has joined #lisp
luckless has joined #lisp
<phoe>
...unless you also have a matching #-sbcl
<phoe>
at which point you're inventing a tiny impromptu portability library
amb007 has quit [Read error: Connection reset by peer]
<oni-on-ion>
shka_, hm true, never thought of that (compat with versions of sbcl)
amb007 has joined #lisp
narimiran has quit [Ping timeout: 272 seconds]
narimiran has joined #lisp
<oni-on-ion>
phoe, hmm, is ECL still alive ? also, does JVM GC outperform SBCL GC?
<shka_>
yse and yes
<shka_>
*yes and yes
<beach>
ECL is maintained by jackdaniel.
<oni-on-ion>
ah. and ahhh
<phoe>
ECL is doing well and aiming for a new release right now
heisig has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
<oni-on-ion>
ah wonderful =)
amb007 has joined #lisp
luckless has quit [Ping timeout: 240 seconds]
luni has quit [Quit: Connection closed]
<oni-on-ion>
C has had its share of breaking changes; not sure if we will see many more of them if any in the coming decades
<shka_>
anyway, i suspect that C will continue to change no
<shka_>
w
<oni-on-ion>
hmm; and looking all all these, most of them were GNU in the first place. surely much of my C code relied on GNU (CC) extensions
<oni-on-ion>
thats probably true
<mrios222>
Hi, I have a question about POST requests made to Hunchentoot. If I send a JSON object as the body, then how can I access the JSON data using define-easy-handler?
<oni-on-ion>
whoa @ Type-generic expressions
amb007 has quit [Read error: Connection reset by peer]
<mrios222>
shka_ I get errors when I try to use the methods for *request*
cosimone has joined #lisp
<mrios222>
When I don't get 500 errors, all of the data comes up as NIL or the hexadecimal id for the request object
Inline has quit [Ping timeout: 260 seconds]
<mrios222>
When I do (post-parameters* *request*) I get NIL, even though I'm sure that I'm sending a body object that is stringified JSON
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<shka_>
hmmm
<shka_>
mrios222: sorry, can't help, it's been some time since i was using hunchentoot
<mrios222>
shka_ no problem
<mrios222>
I figured it out. I need to use (raw-post-data :force-text *response*) and then feed that into a json reader
<shka_>
hmm
<shka_>
*response*
<shka_>
ok, i guess?
frost-lab has quit [Quit: Connection closed]
oxum_ has quit [Ping timeout: 256 seconds]
surabax has joined #lisp
<pyc>
what does it mean when a system (like uiop) is part of ASDF? Does it mean that I can safely rely on it and it will work on all CL implementations without installing any additional dependency?
<oni-on-ion>
in this case i believe it means that uiop was initially part of asdf, then seperated into its own project; but as a subproject of asdf ?
<pyc>
oni-on-ion: is relying on uiop portable then? Is it guaranteed to be available in all CL implementations? (I am a newbie to CL)
jjong has quit [Ping timeout: 240 seconds]
<phoe>
pyc: it's a portability library, meaning, a library that bridges gaps across different Lisp implementations for non-standard behavior
<oni-on-ion>
i would feel safe to say yes - according to "UIOP is the portability layer of ASDF. It provides utilities that abstract over discrepancies between implementations, between operating systems, and between what the standard provides and what programmers actually need, to write portable Common Lisp programs. "
<phoe>
such like usocket for network sockets, bordeaux-threads for multiprocessing, trivial-gray-streams for programmable streams, etc..
<pyc>
phoe: okay. i am trying to understand if this library is guaranteed to be available on any CL implementation.
<phoe>
nope
<phoe>
but, if you use ASDF, then UIOP is there
<shka_>
pyc: uiop is likely to never go away
<shka_>
you can count on it
<phoe>
and you are very likely to use ASDF while doing Lisp.
<oni-on-ion>
"... to write portable Common Lisp programs. " as long as one's system/impl supports it perhaps.
<shka_>
which they do
<shka_>
all of them
<pyc>
does SBCL come with ASDF automatically? because I never installed ASDF explicitly myself but I see (uiop:read-file-string) works.
<phoe>
you have Quicklisp loaded, yes?
<phoe>
Quicklisp loads ASDF which loads UIOP
<pyc>
phoe: yes, i have quicklisp loaded and added to ~/.sbclrc. Is that why uiop is available too?
<phoe>
yes
<phoe>
try running SBCL without Quicklisp loaded!
<edgar-rft>
I'm not so sure about "all of them", there still exist exotic implementations like GNU Common Lisp.
<phoe>
GCL is dead though
<phoe>
(and AFAIR hasn't ever really been conforming)
<pyc>
phoe: you are right. without loading quicklisp, i get "Package UIOP does not exist."
<edgar-rft>
GCL is stil used by Maxima on Windows if I'm not totally wrong.
mindCrime has quit [Ping timeout: 264 seconds]
jjong has joined #lisp
<edgar-rft>
but sure, you can say all *sane* Common Lisp implementations use ASDF ande therefore also UIOP nowaways
* jackdaniel
expresses doubt whether using asdf and uiop is a sane choice, but oh well
<pyc>
I am reading a CL thread on Hacker News and I came across this comment: https://news.ycombinator.com/item?id=25586297 It says, "I have less patience with ... the churn found in many currently popular languages." What does churn mean in this context? Sorry, I am not a native english speaker.
<beach>
Type "define churn" to Google.
andreyorst_ has joined #lisp
<edgar-rft>
jackdaniel: ASDF and UIOP provide a level of insanity the ANSI specification lacks :-)
<pyc>
beach: I did and I found some meanings like "unplesant disturbed feeling" and I am not sure that applies here. I mean I am guessing it has something to do with nature of languages. There is some undesirable property known as "churn" that is present in other languages which is missing from CL.
luni has joined #lisp
<pyc>
"unplesant disturbed feeling" is quite vague. so I am hoping this channel can help me understand what "churn" is, how it is present in other languages but not in CL.
<pyc>
jackdaniel: why do you doubt asdf and uiop aren't sane choice. if you could elaborate it would help a beginner like me.
<phoe>
mostly because of the ideological difference between standard CL and UIOP
andreyorst` has quit [Quit: andreyorst`]
<pyc>
what's the ideological difference between CL and UIOP?
rumbler31 has joined #lisp
<heisig>
> churn out: To produce in an abundant and regular manner: churns out four novels a year.
mindCrime has joined #lisp
<phoe>
UIOP is a single-implementation library without a standard, CL is very much the opposite
<heisig>
If Common Lisp code had things in an "abundant and regular manner", you could introduce a macro to abbreviate it.
<phoe>
and for many purposes UIOP is the necessary evil
<phoe>
getting implementers to agree on an extension is a very *very* tough task to do, so UIOP, like many other portability libraries, just moved in while skipping this step wherever possible
<pyc>
oh! that makes sense. and that makes me wonder about standardization vs. pragmatism. I am learning CL because it is a standard and I want to write my code once and run for the next 30 years. I have had quite a bad time in Python where code I wrote 10 years ago broke with Python 3 upgrade. Sure, conversion from Py 2 to Py 3 can be automated but it is still additional work and hassle.
<phoe>
and the tough part is most people have a choice to e.g. not use bordeaux-threads or have them loaded in their image whatsoever
<phoe>
it's different with UIOP because then they cannot have ASDF.
<pyc>
so I have come to take refuge in CL where I am hoping I can write something once and it will run for the next 30 years without requiring a lot of maintenance. if UIOP can break that guarantee then I may want to avoid it.
<phoe>
there's also the question of inertia
<phoe>
if UIOP breaks backwards compatibility at some point then people simply won't upgrade the new version
<phoe>
that's the fate of e.g. Alexandria, too, which is probably the most popular CL library
<phoe>
s/upgrade/upgrade to/
rumbler31 has quit [Ping timeout: 256 seconds]
<phoe>
Alexandria's fate is worsened by the fact that it's heavily :USEd, too, which means that it cannot easily export new symbols without setting a lot of the CL world on fire
<phoe>
(because of import conflicts)
<pyc>
if people simply won't upgrade, then it is good news. but sadly in JS and Python world I see people are always ready to upgrade when something breaks. Upgrading is the norm. People like me who do not want to modify 10 year old code to make a new version of a package happy are the outliers.
<phoe>
so IMO these libraries are very unlikely to change in backwards-incompatible way, even from the practical or pragmatic point of view
<phoe>
well, there's many people in the CL world who think the same
<jackdaniel>
here an idea: export from all new libraries a symbol shadowed from cl (something irrelevant), then if someone uses your library and the cl package, then they will need to think twice
<phoe>
jackdaniel: I have been thinking about it
<phoe>
this is one of the ideas that sound really good and really evil at the same time
<heisig>
Speaking of UIOP, is there already a CL version of Python's pathlib? Because that one looks reasonable, and it has the advantage that many programmers are already familiar with the interface.
<jackdaniel>
evil?
varjag has joined #lisp
random-nick has joined #lisp
<pyc>
phoe: you mean people in the CL world also think that it is okay for upgrades to break old code? or they think that upgrades should never break old code?
<phoe>
yes, because it'll create some confusion
<phoe>
pyc: the latter
<phoe>
compatibility is pretty important in the CL ecosystem
<pyc>
phoe: thanks! that is a lot of relief. i feel good about converting my python tools to CL now.
<phoe>
and a piece portable and conforming CL code should NEVER be broken by a change in the implementation, because it means that either there was a bug in the implementation, or there was a bug in the code
<pyc>
btw, anyone can help me understand what it means there is a lot of churn in many popular languages?
oxum has joined #lisp
<phoe>
I guess some people just like rewriting stuff in the newest version of the framework that will be obsoleted by a week from now
<oni-on-ion>
heisig, afaik CL has path things
<phoe>
s/by//
<heisig>
oni-on-ion: The path things in CL are a mess. I think they even admitted that the CL standardization committee ran out of time when it came to paths and streams.
<phoe>
heisig: I saw such a thing some time ago, one second...
<phoe>
!
<oni-on-ion>
pyc, in that case above, churn i think is 'yak shaving'
<pyc>
phoe: oh, if that is what they mean churn, i absolutely hate that. i want to solve a problem, write a tool, and move on. after that I should just remain a happy user of the tool. i don't want to rewrite it again with whatever becomes fashionable in future.
<oni-on-ion>
pyc, yeah. main things about "other languages" (which is often referred to as 'Blub') which people complain -- each have compilation target (native, bytecode), libraries, package manager, release schedule, repository location, etc..
<heisig>
Thanks phoe. Unfortunately this an implementation of Python's os.path library, which is already out of fashion. I was told pathlib is the cool new thing.
<susam>
Yes! "I want to be a happy user of the tool," is exactly how I feel about programming in Common Lisp. I don't have the time to keep chasing the latest hotness. I would rather work on other important problems instead of rewriting stuff with the latest framework.
<phoe>
heisig: ...
<phoe>
no I mean uh
<phoe>
are you serious?
<heisig>
Serious about what? That the Python fashion cycles last only about four years? Dead serious :)
<edgar-rft>
oni-on-ion: cl-fad has turned out to be buggy, but stupidly I can't remember the details right now, Fare (author of UIOP) has written something about it
<phoe>
heisig: ....................
<phoe>
edgar-rft: cl-fad was kinda superseded by UIOP, according to UIOP authors
<phoe>
and, frankly, I like UIOP pathname stuff myself
<phoe>
never used it heavily, but it seems to Just Work™ all the time I use it
<edgar-rft>
phoe: there *were* problems with cl-fad, I myself had some with cl-fad and CLISP for example, I only can't remember what exactly
<phoe>
edgar-rft: wait, I meant that I like and used UIOP pathname stuff
<phoe>
I only used CL-FAD once or twice I think
<easye>
cl-fad's WALK-DIRECTORY doesn't have a direct replacement in UIOP I think.
luni has quit [Ping timeout: 240 seconds]
<oni-on-ion>
edgar-rft, ahh. *added to the oral history CLHS project*
<edgar-rft>
phoe: I meant it was not just simply superseded, there was a reason, that I stupidly can't remember :-(
<oni-on-ion>
"cliki" is a good place for the Oral Writ
<pfdietz>
I'm going through various lisp repos in quicklisp in descending order of popularity to see how well tested they are. I'm on cl-fad right now.
<oni-on-ion>
how testing? their individual test suites ?
<pfdietz>
Yes.
<jackdaniel>
when I'm defining a method that is specialized directly on the class (not on the name) -- what are the risks?
luckless has quit [Ping timeout: 240 seconds]
<jackdaniel>
(compared to specializing on the name that is)
<pfdietz>
(1) Do they even HAVE a test suite? (2) How well does it cover their code? (3) (to come) How well does it kill deliberately introduced bugs?
jjong has quit [Ping timeout: 256 seconds]
gutter has quit [Remote host closed the connection]
Inline has quit [Remote host closed the connection]
<pfdietz>
It appears to have the same behavior as just using the class name, if you redefine the class (or, if you set find-class on the name to nil and then redefine the class).
<jackdaniel>
ah, "Can't use anonymous [or undefined] class as constant", that's the gotcha
<pfdietz>
Ah, you were talking about an EQL specializer
Inline has joined #lisp
<jackdaniel>
no, about the class used as a specifier
<pfdietz>
That's allowed.
<pfdietz>
I suspect that could not be used in file compiled code though. Need to try that.
<jackdaniel>
yes, but when you load the fasl, the class is looked by name it seems
<scymtym>
"anonymous" in the error message suggests that the class in question does not have a name or is not associated with a name in the global environment. could that be the problem?
<pfdietz>
Right. You also can't use function objects as constants in file compiled code, as they cannot be serialized out.
jjong has joined #lisp
<scymtym>
(which different from being able to use the class instance as opposed to its name as a specializer)
<scymtym>
*which is
Inline__ has joined #lisp
Inline has quit [Read error: Connection reset by peer]
<jackdaniel>
I'm experimenting with ways for forward-referencing classes, so they may be finalized with a different name. if that's the only issue, then I can ensure that there is always a name
<jackdaniel>
(with a different name and a different metaclass, depending on circumstances)
<jackdaniel>
so the important part is that there always must be a name
Inline__ has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
Inline__ has joined #lisp
amb007 has joined #lisp
<jackdaniel>
I'm still pondering the forward referencing issue in McCLIM; I think that I have a solution which will work fine
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 265 seconds]
Inline__ has quit [Remote host closed the connection]
Inline__ has joined #lisp
Inline__ has quit [Client Quit]
dbotton has joined #lisp
amb007 has joined #lisp
jjong has quit [Ping timeout: 264 seconds]
<pfdietz>
You can give a class more than one name. (setf (find-class 'name2) (find-class 'name1))
<phoe>
depends on what you mean by "name"
<oni-on-ion>
whoa
<phoe>
is it the symbol by which you find-class?
<phoe>
or the value of class-name when called on a class object?
<jackdaniel>
setf find-class installs the class in the environment, there is one slot class-name though
<pfdietz>
(eql (find-class 'name1) (find-class 'name2)) ==> T
<pfdietz>
You can also reach a state where (find-class (class-name <class object>) nil) ==> nil
andreyor1 has joined #lisp
jjong has joined #lisp
<jackdaniel>
(and that's the state where fasl refuses to get loaded when such class object is a specializer)
<oni-on-ion>
would it be possible to remove stuff , and save image?
perrier-jouet has quit [Ping timeout: 260 seconds]
<jackdaniel>
like a class? you'd need to remove all references to it
<pfdietz>
Classes also show up in the DIRECT-SUBCLASSES slot of their immediate superclasses. That will keep them from being gced, even if the association the the name is lost.
<pfdietz>
with the
jjong has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
narimiran has quit [Ping timeout: 246 seconds]
contrapunctus has left #lisp ["Disconnected: closed"]
<oni-on-ion>
interestiong
contrapunctus has joined #lisp
lowryder has quit [Ping timeout: 256 seconds]
lowryder has joined #lisp
orivej has joined #lisp
Josh_2 has joined #lisp
Josh_2 has quit [Remote host closed the connection]
<pve>
I'd be interested in learning how to cleanly delete a class (that has no subclasses). My current best-effort solution is to remove the subclass link from the superclass, then remove all methods associated with the class, and finally do (setf (find-class 'myclass) nil).
<pve>
Could this be enough?
<pve>
I'm unsure of the environment entries jackdaniel mentioned..
<pve>
oni-on-ion: yes, or just wait for it to happen
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
neirac has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
attila_lendvai has joined #lisp
kaftejiman has joined #lisp
neirac 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]
amb007 has joined #lisp
MrNo1 has joined #lisp
isBEKaml has joined #lisp
<heisig>
pve: You could also attach a finalizer to check whether your class is actually being collected.
<oni-on-ion>
^ nice idea to add. always had this idea of being able to prune a lisp image
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
MrNo1 has quit [Remote host closed the connection]
skapata has joined #lisp
<pve>
heisig: great idea!
_jrjsmrtn has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
__jrjsmrtn__ has quit [Ping timeout: 260 seconds]
amb007 has joined #lisp
ym has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
luckless has quit [Quit: luckless]
zulu-inuoe has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
oxum has quit [Read error: Connection reset by peer]
luni has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<pve>
While we're on the subject, there wouldn't happen to be a way to cleanly delete a structure-class? SBCL at least lets me do (closer-mop:remove-direct-subclass (find-class 'structure-object) (find-class 'mystruct)), but can it be relied on?
<makomo>
yep, that's what i wanna know, is it a bug or not. i would have expected it to return T
<makomo>
maybe i should ask in #slime instead of opening a bug right away
amb007 has quit [Read error: Connection reset by peer]
cosimone has joined #lisp
amb007 has joined #lisp
rogersm has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<White_Flame>
one of the possible implementation-dependent criteria of interactive streams is the "normal input editing", which I don't think the stream perceives?
<White_Flame>
(but that's very interpretive)
dra has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 272 seconds]
<jackdaniel>
~/win 2
<_death>
pfdietz: hey.. was that PR meant for me?
<gendl>
Is Bordeaux Threads originally made by beach? Is that where the name comes from?
<_death>
the initial commit (and project description on cl.net) mentions bordeaux-mp by Dan Barlow
<phoe>
gendl: I recall beach mentioning it to me
<phoe>
AFAIR it is because the first version of the library was written in Bordeaux
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 272 seconds]
Lord_of_Life_ is now known as Lord_of_Life
bilalkhan has quit [Remote host closed the connection]
bilalkhan has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
PuercoPop has joined #lisp
judson_ has joined #lisp
amb007 has joined #lisp
rogersm has quit [Quit: Leaving...]
<edgar-rft>
maybe the library was influenced by lots of Bordeaux wine :-)
matta has joined #lisp
akoana has joined #lisp
hnOsmium0001 has joined #lisp
<slyrus_>
shka_: around?
Jesin has joined #lisp
luckless has quit [Ping timeout: 240 seconds]
luckless has joined #lisp
rlp10 has joined #lisp
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #lisp
<pfdietz>
_death: yes, I pushed up a tweak to your modified copy of cffi
lowryder has quit [Ping timeout: 246 seconds]
<pfdietz>
(which we are using with tree-sitter)
johs has quit [Ping timeout: 260 seconds]
<shka_>
slyrus_: yeah
cosimone has quit [Quit: cosimone]
<pfdietz>
That tweak reduced the run time of that by about 10%. eql hash tables are much faster than equal hash tables, I think because they can cache based on the previous key.
kini has quit [Read error: Connection reset by peer]
bjorkint0sh has joined #lisp
bjorkintosh has quit [Ping timeout: 260 seconds]
johs has joined #lisp
lowryder has joined #lisp
kini has joined #lisp
cyraxjoe has quit [Ping timeout: 272 seconds]
<slyrus_>
shka_: thanks for the comments on the github issues. I'll check out the rr thing. We need to focus on the developer experience. I'd like to make sure that we have easily understandable examples a la those on the teddy README page.
<shka_>
agreed
<shka_>
i will write some examples
<shka_>
especially since i may or may not broke it yesterday :-)
<shka_>
i mean, it will work fine as long as the lambda-list of bind-row is empty
ebrasca has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31_ has quit [Ping timeout: 240 seconds]
herlocksholmes has quit [Quit: Hasta la victoria, siempre!]
<shka_>
slyrus_: also, i presume that you find my explanation to be workable
herlocksholmes has joined #lisp
jealousmonk has joined #lisp
Lycurgus has joined #lisp
<_death>
pfdietz: well, it looks good to me (there's some extra whitespace & commented code though).. I can merge it, but perhaps you should also send a PR to cffi maintainers
karlosz has joined #lisp
X-Scale has quit [Ping timeout: 265 seconds]
X-Scale` has joined #lisp
X-Scale` is now known as X-Scale
<shka_>
slyrus_: btw, any thoughts on the filter?
<shka_>
I wanted to suggest implementing it by assuming that it needs to be in bind-row
danish has joined #lisp
<shka_>
slyrus_: i added docstrings for those slots in the STANDARD-HEADER
<shka_>
hope that helps
mindCrime has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
benjamindc has joined #lisp
l1x has joined #lisp
<benjamindc>
Every time I reload a file in the REPL in which I've used defconstant I get the redefinition warning. Is it possible to muffle this warning in my .sbclrc?
notzmv has quit [Remote host closed the connection]
<shka_>
benjamindc: there is a better way to do so
<shka_>
benjamindc: alexandria provides define-constant as a solution to this specific issue
<shka_>
just don't forget to provide proper test
<phoe>
^
<shka_>
phoe: good evening phoe
<phoe>
hey shka_
notzmv has joined #lisp
<contrapunctus>
.o(`define-constant`? What is this, Scheme? 😏)
<shka_>
contrapunctus: heh, yeah
<shka_>
but alexandria is so common that it very well be considered sudo standard
<shka_>
so here you
<benjamindc>
thank you shka_ I'll check that out
<shka_>
go
<shka_>
benjamindc: you are welcome
<shka_>
actually alexandria is based on utils described in "on lisp" and the author of the book is a notorious schemer
<shka_>
so it kinda makes sense that some of it bleeds into alexandria
<jackdaniel>
define-constant is a very nice lispy name, I don't find it more schemish than lispish
<slyrus_>
shka_: refresh my memory about the filter thing. We're talking about the macro I wrote yesterday, right?
<shka_>
yup
<slyrus_>
what's the question again :) ?
<shka_>
no question, just wanted to suggest that assuming that filter is supposed to be placed inside bind-row would make that macro significantly simpler
<shka_>
or rather
<shka_>
make it simple
travv0 has left #lisp [#lisp]
<slyrus_>
I see. My point is I want a macro that doesn't require bind-row :)
<shka_>
i was under that impression, yes
<shka_>
and i wanted to suggest something
<slyrus_>
bind-row is nice and efficient and all but I think we should provide "wrapper" functions that hide its use for things like filter.
hiroaki_ has quit [Ping timeout: 240 seconds]
<shka_>
slyrus_: i think that i need to study the real world use cases of filter
<shka_>
if filter is part of some longer sequence
<shka_>
it would probably be ok to assume that it needs bind-row variables
<shka_>
and perhaps write some macro that works accepts table, bind-row lambda-list and bind-row body as it's own &body
<shka_>
then you could write (filter ...)(something-else)(filter)(something-else)
<slyrus_>
if we take for a moment that we want something dplyr-ish (which is reasonable for my needs), the things I use a lot are the various df/tibble creation routines, select, filter, mutate, rename, inner_join, arrange, pivot_..., etc...
<slyrus_>
I'd like to see an interface like that exposed to developer/users that would presumably use bind-row under the covers
<shka_>
since drop-row performs non-local-exit, you can just stick every operations in bind-row
<shka_>
slyrus_: if one would really want to make it compact, i think that reader macro is the solution
<shka_>
that would allow you to skip writing lambda-list whatsoever
benjamindc has quit [Remote host closed the connection]
<slyrus_>
Why do we need a reader macro for that?
hiroaki_ has joined #lisp
<slyrus_>
Don't get me wrong, bind-row is cool and there are certainly going to places to use it, but I'd like to see a higher level interface as well.
<shka_>
slyrus_: this would allow writing stuff like
<slyrus_>
and why can't we just write (filter table (< column-name 0.5)) ?
<shka_>
well, how we can distinguish before a local variable and a column?
<shka_>
*between
<slyrus_>
This is a good question. dplyr has it's approach to this that works reasonably well. The poorly-articulated question that's running around my mind is can we do better in the lisp world given the tools at our disposal?
<shka_>
i really don't think so
<shka_>
without the first-class envs this seems to be destined to be hacky
<shka_>
but on the other hand, people are used to writing (lambda (something other-thing) ...) so why not imitate lambda?
<shka_>
that was the idea with bind-row
<shka_>
or, as i mentioned, add reader-macro
<shka_>
slyrus_: i personally consider this to be a minor inconvenience
<shka_>
let's just avoid imitating pandas
<shka_>
i don't agree with it's api design even a little bit
<shka_>
however, i a agree that higher level functionality is welcome
<shka_>
let's just not get too clever about it :-)
<shka_>
slyrus_: ok, have a good day, i will be online tomorrow
hiroaki_ has quit [Ping timeout: 264 seconds]
edgar-rft has quit [Quit: Leaving]
rumbler31 has joined #lisp
hiroaki_ has joined #lisp
luckless has quit [Quit: luckless]
rumbler31 has quit [Ping timeout: 264 seconds]
Walex has joined #lisp
mindCrime has quit [Quit: Konversation terminated!]
<slyrus_>
shka_: ok, thanks. happy new year!
Lord_Nightmare has joined #lisp
shka_ has quit [Ping timeout: 246 seconds]
andreyor1 is now known as andreyorst_
andreyorst_ has quit [Quit: WeeChat 3.0]
andreyorst has quit [Ping timeout: 256 seconds]
asarch has joined #lisp
andreyorst has joined #lisp
karlosz has joined #lisp
hiroaki_ has quit [Ping timeout: 260 seconds]
aorst has joined #lisp
Lycurgus has quit [Quit: Exeunt]
andreyor1 has joined #lisp
andreyorst has quit [Read error: Connection reset by peer]
aorst has quit [Ping timeout: 260 seconds]
karlosz has quit [Quit: karlosz]
orivej has quit [Ping timeout: 260 seconds]
pve has quit [Quit: leaving]
hiroaki_ has joined #lisp
imode has joined #lisp
mindCrime has joined #lisp
makomo has quit [Ping timeout: 256 seconds]
makomo has joined #lisp
l1x has quit [Quit: Connection closed for inactivity]