flip214 has quit [Read error: Connection reset by peer]
flip214 has joined #commonlisp
random-nick has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
s-liao has quit [Client Quit]
s-liao has joined #commonlisp
jstoddard has joined #commonlisp
pjb has quit [Read error: Connection reset by peer]
s-liao has quit [Ping timeout: 256 seconds]
omr has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #commonlisp
igemnace has joined #commonlisp
s-liao has joined #commonlisp
gaqwas has quit [Remote host closed the connection]
taiju has quit [Ping timeout: 240 seconds]
taiju has joined #commonlisp
jeosol has joined #commonlisp
omr has quit [Quit: WeeChat 3.3]
jstoddard has quit [Remote host closed the connection]
jstoddard has joined #commonlisp
Kyuvi has joined #commonlisp
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
perrierjouet has quit [Quit: WeeChat 3.4]
taiju has quit [Ping timeout: 256 seconds]
perrierjouet has joined #commonlisp
elderK has joined #commonlisp
perrierjouet has quit [Ping timeout: 256 seconds]
perrierjouet has joined #commonlisp
jgart has joined #commonlisp
euandreh has quit [Ping timeout: 250 seconds]
euandreh has joined #commonlisp
Kyuvi has quit [Quit: Client closed]
sjl has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
waleee has quit [Ping timeout: 252 seconds]
jstoddard has quit [Quit: ERC (IRC client for Emacs 27.1)]
perrierjouet has quit [Remote host closed the connection]
perrierjouet has joined #commonlisp
lottaquestions has joined #commonlisp
lottaquestions_ has quit [Ping timeout: 240 seconds]
s-liao has quit [Ping timeout: 256 seconds]
perrierjouet has quit [Ping timeout: 256 seconds]
<beach>
Good morning everyone!
shinohai[m] has joined #commonlisp
katco has joined #commonlisp
luis` has joined #commonlisp
sepanko has joined #commonlisp
etimmons has joined #commonlisp
edmrk[m] has joined #commonlisp
Mrtn[m] has joined #commonlisp
sp has joined #commonlisp
Gnuxie has joined #commonlisp
dieggsy has joined #commonlisp
saltrocklamp[m] has joined #commonlisp
nworb has joined #commonlisp
kakuhen has joined #commonlisp
MatrixTravelerbo has joined #commonlisp
Duuqnd has joined #commonlisp
CodeBitCookie[m] has joined #commonlisp
Arcsech has joined #commonlisp
loke[m] has joined #commonlisp
Spawns_Carpet[m] has joined #commonlisp
zbrown[m] has joined #commonlisp
opalvaults[m] has joined #commonlisp
linjian has joined #commonlisp
<Everything>
beach: !
<beach>
Everything: Are you new here? I don't recognize your nick.
<Everything>
beach: no, just changed it some ago. Another idea was Everyone
<beach>
Got it.
semz has quit [Ping timeout: 268 seconds]
<ck_>
Good morning
tyson2``` has quit [Remote host closed the connection]
ns12 has quit [Ping timeout: 256 seconds]
semz has joined #commonlisp
Everything has quit [Quit: leaving]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
perrierjouet has joined #commonlisp
nij- has joined #commonlisp
Kyuvi has joined #commonlisp
huckleberry has joined #commonlisp
taiju has joined #commonlisp
jealousm` has quit [Quit: ERC (IRC client for Emacs 27.1)]
<jackdaniel>
o/
<beach>
Hello jackdaniel.
hobo has joined #commonlisp
spiaggia has joined #commonlisp
huckleberry has quit [Quit: disconnected]
iamFIREcracker has joined #commonlisp
shka has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
shka has joined #commonlisp
aartaka has joined #commonlisp
Algernon69 has joined #commonlisp
Jing has joined #commonlisp
shka has quit [Read error: Connection reset by peer]
notzmv has quit [Ping timeout: 250 seconds]
shka has joined #commonlisp
frgo_ has joined #commonlisp
karlosz has quit [Quit: karlosz]
frgo has quit [Ping timeout: 268 seconds]
frgo_ has quit [Ping timeout: 256 seconds]
spiaggia has quit [Quit: ERC (IRC client for Emacs 26.3)]
Oladon has quit [Quit: Leaving.]
elderK has quit [Quit: Connection closed for inactivity]
s-liao has joined #commonlisp
pve has joined #commonlisp
frgo has joined #commonlisp
Kyuvi has quit [Ping timeout: 256 seconds]
frgo has quit []
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
OlCe has joined #commonlisp
epolanski has joined #commonlisp
attila_lendvai has quit [Ping timeout: 268 seconds]
massimo_zaniboni is now known as mzan
mrmr1 has joined #commonlisp
szkl has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
mrmr has quit [Ping timeout: 268 seconds]
mrmr1 is now known as mrmr
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pjb has joined #commonlisp
Shinmera has quit [Ping timeout: 250 seconds]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
Shinmera has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
ns12 has joined #commonlisp
amb007 has joined #commonlisp
Jing has joined #commonlisp
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
notzmv has joined #commonlisp
rogersm has joined #commonlisp
mrmr has quit [Ping timeout: 256 seconds]
mrmr has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
s-liao has quit [Quit: Client closed]
<moon-child>
has slime any affordances for reader macros, or must I modify its source code if I want it to be able to handle them?
<phoe>
the latter, I think
<phoe>
but I may be mistaken
<moon-child>
ok
<beach>
How would you have liked them to be "handled"?
kevingal has joined #commonlisp
<moon-child>
custom indentation
<moon-child>
that's the main thing. Syntax highlighting and autocompletion may also bend a bit, but I do not care so much about those
<beach>
I see.
igemnace has quit [Remote host closed the connection]
perrierjouet has quit [Remote host closed the connection]
s-liao has joined #commonlisp
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Jing has joined #commonlisp
mrmr has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
perrierjouet has joined #commonlisp
Everything has joined #commonlisp
mrmr has joined #commonlisp
cosimone` has joined #commonlisp
sterni has quit [Quit: WeeChat 3.3]
cosimone has quit [Ping timeout: 240 seconds]
sterni has joined #commonlisp
kuao has quit [Quit: Connection closed for inactivity]
Algernon69 has quit [Read error: Connection reset by peer]
<ns12>
What is the meaning of backslashes within a string? For example, (format t "1\2\3") prints "123". What happened to the backslashes?
Algernon69 has joined #commonlisp
<phoe>
\\ is an escape character inside strings
<phoe>
s/\\/#\\/
<phoe>
"123" === "\123" === "\1\2\3"
<beach>
ns12: Try "1\"23"
s-liao has quit [Quit: Client closed]
<phoe>
escape your backslash with a backslash to get a literal backslash in your string, like "1\\2\\3"
nij- has left #commonlisp [#commonlisp]
<ns12>
So "\1" is equivalent to "1"? So a backslash only has meaning for some characters that come after it?
<jackdaniel>
escape your backslash with a backslash to get a literal backslash to avoid metaphorical backslash from the formatter
<jackdaniel>
find which word has an additional s :)
<phoe>
ns12: the backslash escapes a character that comes directly after it only
<ns12>
Is this because the backslash is given special meaning by the reader?
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phoe>
yes, inside strings
<phoe>
when the reader is reading a string, there are only two special characters
<phoe>
the double quote, which ends string reading
<phoe>
and the backslash, which causes the next character to be read as a literal
<ns12>
I see. So this means that it is not possible in Common Lisp for "\" to have value "\" without somehow modifying the reader?
<phoe>
not inside strings, unless you devise a custom reader macro.
<phoe>
which you can do, even if it doesn't mean you should. :D
robin has quit [Ping timeout: 250 seconds]
<ns12>
Is it possible to modify how strings are read? For example, could I modify the string reader to use | instead of \ as one of the special characters?
Bi[m] has quit [Quit: Client limit exceeded: 20000]
<moon-child>
indeed
<moon-child>
you would have to write a reader macro
Bi[m] has joined #commonlisp
<moon-child>
(set-macro-character #\" (lambda (s c) (loop until (char= #\" (peek-char nil s)) for c = (read-char s) if (char= c #\|) collect (read-char s) else collect c finally (read-char s) (return ...))))
<moon-child>
err probably collect into
<moon-child>
and collecting into a list is slow (but pedagogically sound)
<ns12>
Oh wait. I actually know how to do that. Sorry. I didn't realize that I've actually done that before.
<moon-child>
(so is peeking)
<mfiano>
jackdaniel: lol
<ns12>
mfiano: jackdaniel: What's the joke? I didn't catch it.
<jackdaniel>
ns12: I was poking fun of multiple words 'backslash' in phoe explanation, and added "metaphorical backslash from the formatter" - it should be backlash.
<jackdaniel>
not a very funny joke, but if we take IRC standards of humour...
mrmr has quit [Ping timeout: 256 seconds]
<ns12>
jackdaniel: Thanks. I understand it now.
<mfiano>
I object. jackdaniel is known for his jokes.
<jackdaniel>
:)
<mfiano>
Such as ECL and McCLIM maintainence
* mfiano
ducks
<moon-child>
T_T
<jackdaniel>
that was funny, no need to duck ;p
<mfiano>
;)
Guest41 has joined #commonlisp
<mfiano>
I can't spell first thing in the morning apparently.
<White_Flame>
you certainly did spell it correctly
<jackdaniel>
from numerous quotes on McCLIM website my favourite is "McCLIM, the stuff that really boring dreams are made of." by Andy Hefner
Demosthe1ex is now known as Demosthenex
<jackdaniel>
the cose second is the quote by Nikodemus Siivola
<jackdaniel>
close*
tyson2 has joined #commonlisp
rotateq has joined #commonlisp
<ns12>
phoe: Thank you. Very interesting. Is :local-nicknames part of the official standard?
shka has quit [Remote host closed the connection]
Guest41 has quit [Client Quit]
<phoe>
ns12: nope, but it's an extension supported everywhere enough nowadays
<mfiano>
As Shinmera pointed out the other day, "enough" means that an implementation not supporting it would prevent the usage of a good portion of the library ecosystem nowadays.
<mfiano>
Which is even more of a reason to adopt it. It was one of |3b|'s more popular ideas apparently :)
<ns12>
On the subject of package renaming. Suppose I am using a third-party library with a long package name (e.g. com.example.the-most-amazing-library) and I get tired of typing the long name whenever I use a function from that library. Is :local-nicknames *the* way to rename the package?
<moon-child>
yes
<moon-child>
(well, I do not aver the superlative. But yes.)
<Shinmera>
It is if you don't want to break things :)
perrierjouet has quit [Quit: WeeChat 3.4]
<ns12>
So it's the only sane way that is mostly portable?
<mfiano>
CLISP hasn't had a release in what, 12 years now?
<moon-child>
ns12: in soviet russia, clisp does not support YOU
<moon-child>
hmm, portability.cl claims sicl does not support them, but afaik it does. Not that it makes sense to have a sicl column at all, but
<Shinmera>
you, too, can update the information should it be out of date.
<mfiano>
Shinmera: About your blog post: I find it funny that I often use PLN to make a _longer_ nickname of your "V" nickname for "VERBOSE", so that it doesn't conflict with my preferred "V" nickname for vectors :)
<Shinmera>
Yes, that is an unfortunate historical artefact.
<Shinmera>
I will remove that global nickname some day
random-nick has joined #commonlisp
<ns12>
Shinmera: You make pretty websites. Are they written in Common Lisp too?
<Shinmera>
Most of them, sure.
<Shinmera>
as much as one can write a website in lisp, anyway.
s-liao has joined #commonlisp
aartaka has joined #commonlisp
theothornhill has joined #commonlisp
<moon-child>
what does that mean?
<Shinmera>
in the end you still write html, css, and js.
<moon-child>
css sure. Html can be wrapped. And js can be compiled to
<Shinmera>
All of those things are always very thin wrappers
<moon-child>
(admittedly the latter is a somewhat less practical venture than the former. But)
<moon-child>
always?
<moon-child>
people have done latex -> html
<Shinmera>
The context is lisp.
<Shinmera>
I am not interested in this debat.
<mfiano>
I'd like to buy an #\e please.
Alfr has quit [Ping timeout: 256 seconds]
theothornhill has quit [Remote host closed the connection]
theothornhill has quit [Remote host closed the connection]
euandreh has quit [Ping timeout: 240 seconds]
theothornhill has joined #commonlisp
<phoe>
CLISP is no longer an implementation I consider supportable because it hasn't released in a decade even if it's possible to build it from source nowadays
<phoe>
and if AFAIR it's possible to auto-build it via roswell
theothornhill has quit [Remote host closed the connection]
theothornhill has joined #commonlisp
euandreh has joined #commonlisp
<mfiano>
and unresponsive developers apparently.
<ns12>
So what are we left with? SBCL and ...?
<phoe>
SBCL, CCL, ECL, Clasp, ABCL, LW, ACL
<phoe>
Mezzano and SICL and JSCL too, although they are incomplete and/or otherwise troublesome to use
<phoe>
JSCL, largely incomplete; SICL, incomplete but highly modular; Mezzano, because of its requirements
<phoe>
tl;dr "equality" is a poorly specified term so there can't be a one-size-fits-all solution
<phoe>
so, write your own one and tailor it for the problem you have
<phoe>
and if you do, then either (defun foo= (foo1 foo2)) or (defgeneric eqv (x1 x2)) is probably the way to go
<madnificent>
phoe: Glancing over that article, I find that to be a very fragmenting statement.
amb007 has quit [Read error: Connection reset by peer]
<mfiano>
What do you mean?
<mfiano>
I would read that article carefully. It is one of the best ones KMP wrote.
<phoe>
fragmenting, as in?
<madnificent>
Scanning through this article, it makes sense. But that does mean that every library will start defining their own equality predicate, rather than having something that could be shared and discovered.
amb007 has joined #commonlisp
<moon-child>
baker also has good things to say on equality predicates
<phoe>
madnificent: yes, and then you'll write your own custom equality predicates as the user of those libraries based on the APIs exposed by those libraries
<phoe>
equality in an impure language is surprisingly complex and one can't magically make it simple
<madnificent>
So we lack a common terminology or wiring across libraries. Even though imperfect, we don't have a shared language due to this.
<madnificent>
I am correct that I can't defmethod any of the equality operators, right?
<mfiano>
Correct
<madnificent>
predicates, sorry
<madnificent>
thank you
<phoe>
the standard ones? yes
<phoe>
you cannot defmethod them
<splittist>
dmv:car= and tyreco:car= are going to very different
theothornhill has quit [Remote host closed the connection]
<madnificent>
I would have expected there to be some library that exposed some method that said something like "if it's read the same way as it's written, then this should yield truthy". I could implement that and reuse a common language.
<phoe>
read the same way as it's written?
<madnificent>
Now I'll expose an equality operator somewhere in my library for my special case and I get to define my special rules. Rules which, in many cases, would conflate with other people's rules.
<moon-child>
written with *print-circle* as t or nil?
<phoe>
you mean that #< will break it?
<moon-child>
and what do you do about unreadable objects?
<madnificent>
phoe: Assuming you print readable objects. But it's just an example. Nothing in particular that interests me in this case.
<madnificent>
moon-child: right! When I define my own, I'll make haphazard decisions on these things and I'll likely be wrong. If a library would have defined a few terms, I could have chosen one and my decision would have been better than what I'll do now.
<moon-child>
madnificent: but this is the point we are trying to make. There are not wrong decisions, but _appropriate_ ones; and what is appropriate is highly contextual
<madnificent>
I'm now going to define an equivalence function. My definition will be full of holes (because I'm thinking of this one case). It will work. The next person reading it will probably wonder about some of the holes I didn't catch.
<moon-child>
those are not holes, but windows of inapplicability
<madnificent>
moon-child: no, they'll be drainfarts from my end.
<phoe>
if I (defclass foo () (bar baz)), what does it mean for two objects of class FOO to be equivalent?
<phoe>
or, in other words, what should be the body of (defmethod eqv ((x foo) (y foo)) ...)?
<madnificent>
phoe: Exactly! A library can give some common descriptions. I can implement one of them and we gain a shared vocabulary!
<moon-child>
comparing objects by enumerating their slots is the opposite of generality
<madnificent>
I agree that an implementation is hard to shove forward. The Semantic Web has a similar issue with definitions of what is the same and what is related. But having some form of definition helps create a shared language and at least we can combine datasets in a valuable way. Perfect? Nope, but we *can* roll our own.
<moon-child>
and a generic library can do no more
theothornhill has joined #commonlisp
<madnificent>
I'm not looking for a library with an implementation, but rather one with a set of possible specifications.
marcoxa has quit [Remote host closed the connection]
marcoxa has joined #commonlisp
<madnificent>
I agree that providing a generic implementation is ... not at all better than what we already have in CL.
<phoe>
the issue is that you can't specify equivalence ahead of time no matter how your generic function is going to look like because there's plenty of possibilities to define *distinct* equivalence classes for all sets of objects
<phoe>
so you'd need to have something like (eqv x1 x2 ...) where ... specifies the "sort" of equivalence that you are looking for
<madnificent>
phoe: and a library defining generic functions could describe in its docsctrings various options. Common sorts of equivalence.
<madnificent>
Combined with their intended use, ideally.
<splittist>
I think the library talk is a red herring; I can see the attraction of a shared vocabulary. e.g. slotwise-equivalent, read/write-equivalent
<madnificent>
phoe: I'm not looing for an implementation. I'm looking for generic functions.
<madnificent>
... and docstrings.
<moon-child>
madnificent: web has no pointers
<moon-child>
lisp does
marcoxa has quit [Ping timeout: 240 seconds]
<phoe>
madnificent: then (DEFGENERIC EQUIVALENT-OBJECTS (X Y INTENTIONAL-TYPE)) should work for a starting point
<madnificent>
moon-child: this is the exact same problem. There are two URIs, like memory locations, and they mean the same thing. owl:sameAs says "hey, these are actually the same". Not perfect, but a sort of description that puts people in the same place.
<madnificent>
phoe: yes, but in what package should that be?
<moon-child>
madnificent: nope
<moon-child>
on the web, all pointers are weak
<phoe>
madnificent: the one in which you place it as the library author :D
<madnificent>
moon-child: if I clone an object, the pointer is weak too?
<madnificent>
phoe: I could create it as a library indeed XD
<phoe>
madnificent: you *must* create it as a library if you want it to become a reality
<madnificent>
moon-child: Also, that's not how the semantic web works. You can reuse an identifier no problem.
<phoe>
you won't extend CL itself with it because the list of standard CL symbols is frozen
<madnificent>
phoe: LoL. Agree. Not the goal :P
<phoe>
so, a separate library you can make.
<madnificent>
phoe: I'm not even confident I'm the right person to jot down the library.
<mfiano>
Or contribute to generic-cl etc
eddof13 has joined #commonlisp
<phoe>
madnificent: make a decent test suite and I won't need to be confident in you since I'll be able to be confident in the tests :D
<phoe>
mfiano: also a good idea
Alfr has joined #commonlisp
<mfiano>
I think such a library would be subject to combinatorical explosion very quickly though.
<madnificent>
phoe: I don't think you can provide tests for something that has no implementation. At least no valuable ones. Ideally someone has researched equality in depth and has created categories of equality.
<madnificent>
I think generic-cl has a slightly different target, though the = operator could be used for this use indeed.
<phoe>
madnificent: that's why I wanted you to read kmp's article - it provides an example implementation, some example categories, and a rationale for both :D
<madnificent>
A context is indeed a welcome addition in some cases.
marcoxa has joined #commonlisp
<madnificent>
phoe: I saw those and that makes sense!
<phoe>
also, you can write implementations and tests for standard CL data structures to make your library immediatey useful
<phoe>
(and to immediately provide some code for your test suite)
<madnificent>
phoe: I'm only searching for the defgeneric portion in some library. I'm trying to avoid reinventing the wheel.
tyson2 has quit [Remote host closed the connection]
<madnificent>
It seems the CL community receives a lot of dirt for it, and I don't think I'm an exception.
<Shinmera>
I've written and used a lot lot lot of libraries and systems. There was maybe one point where I wanted a generic equality test, and in that case it was trivial to just write it for the cases that actually mattered.
<Shinmera>
Imo a generic equality thing is something that seems like a no-brainer, but is actually almost entirely superfluous at best, and actively confusing at worst.
Everything has quit [Quit: leaving]
<moon-child>
phoe: I already spot problems with that implementation :P
<Shinmera>
I don't even like equal/equalp, for instance, and instead wish hash-tables supported other tests like string= and string-equal.
<moon-child>
'epsilon' is always taken as absolute, when a relative epsilon may be wanted in some circumstances
<moon-child>
(and this demonstrates the difficulty in coming up with such functions ...)
<madnificent>
moon-child: that's the point of Kent, you want an extra specifier.
<madnificent>
and I agree with you on that. Though a shared known vocabulary is handy. Like alexandria provides tools, this could provide generic methods. I see that some have attempted a base implementation too.
<madnificent>
thanks for all the pointers and lovely argumentation moon-child, phoe, mfiano, Shinmera
<phoe>
there is one more problem with this way of defining EQUALS
<phoe>
what if in one part of my code I want to be sure that two slots of FOO refer to objects that are just EQUAL, because I only care about their value
<madnificent>
(my gut-feeling says that deep research would land at something that involves something like ContextL)
<phoe>
and in another part of the code I want them to be EQ, because I case about their identity
<madnificent>
phoe: I'm advocating for many generic methods
<madnificent>
or something extra to dispatch on.
<phoe>
and what if method for FOO is defined elsewhere and I cannot really redefine it or put an :around on it
<madnificent>
I'm searching for ways of making an informed decision, rather than assuming a single method can be implemented that works for all.
<phoe>
yes, I see
<phoe>
I'm just pointing out possible problems that have been discovered so far and that a Truly Generic Equality Operator® would need to take into account
<madnificent>
Yes. Perhaps it would be possible to define the strictnes of equality in a tree (but perhaps not!) and if that would be the case, then perhaps an extra argument could help in that regard. Perhaps objects could define their own "default" for equality and indicate they implement that. I don't know. I wonder though!
<Alfr>
madnificent, should 2 and 7 be equivalent?
amb007 has quit [Read error: Connection reset by peer]
eddof13 has joined #commonlisp
<phoe>
well, this already sounds like (setf (fdefinition 'foo-equal) (make-equality-predicate ...)) :D
s-liao has quit [Quit: Client closed]
<_death>
one issue is that the result of an extensible equality operator may change at different points in time.. (equals x y) => nil ... seasons pass and methods are added, (equals x y) => t ... often an equality operator is presumed to be a (mathematical) function, so this is undesirable
<phoe>
and that sounds like a lot of work for creating a framework/factory for different equality and equivalence predicates, whereas I'll do simply (defun my-equal (x y) (= (mod x 5) (mod y 5)))
<phoe>
which is likely what Alfr meant, but I might not be sure
<phoe>
could also be both being #'oddp
eddof13 has quit [Client Quit]
<phoe>
oh wait, sorry; both less than 10
<Alfr>
phoe, yes.
<mfiano>
Or maybe we want to compare how many pen strokes it takes for a human to write
<Alfr>
mfiano, I like how you think. :)
<moon-child>
phoe: both of those are expressible as an existing equality function with some key
<madnificent>
phoe: you could roll your own loop too. But that's what apparently is attributed to lisp being hard. It's too easy to roll your own things and there's too little consensus. Then again, that's by people outside of the community so what do I know.
<moon-child>
(mod 5), type-of, or oddp
<madnificent>
but really, what is worse: seeing (my-lib:equal 5 7) -> true, or seeing (shared:equal 5 7 'odd-p) -> true
<madnificent>
I'd be seriously surprised on the first result, but if there'd be a shared infrastructure I'd be only weary to see the second.
<_death>
(equal-parity 5 7)
<madnificent>
After this, the challenge becomes the definition of symbols like 'odd-p in the same namespace. Preferable ones the community sees value in.
Bike has joined #commonlisp
<Alfr>
madnificent, if it's necessary to pass along something extra to specify how two thing are to be tested for equivalence, then you could also simply pass along such a predicate function.
eddof13 has joined #commonlisp
<mfiano>
_death's solution has the added benefit that it can be variadic
<phoe>
the true challenge is that cl:oddp already exists as a symbol
<madnificent>
Alfr: true, but then I'm again at the situation where I don't have a place to discover what good options are for equality functions and what to think about.
<moon-child>
I was assuming (shared:equal 5 7 :key #'cl:oddp)
<moon-child>
which would turn into (shared:equal (funcall #'oddp 5) (funcall #'oddp 7))
<madnificent>
Alfr: My search was not for an implementation, but rather for defgeneric things so I can be more informed in my implementation, and so the community can have a shared vocabulary.
<phoe>
(equal 5 7 :key #'oddp :test #'eq)
<moon-child>
yeah
<madnificent>
phoe: although funny, that would defeat the purpose of a shared language.
<mfiano>
Are we no longer talking about a generic function which would not be able to portably dispatch on the value of a keyword argument?
attila_lendvai has joined #commonlisp
<phoe>
mfiano: dispatch on the value of a keyword argument? what do you mean?
<madnificent>
mfiano: I think we're joking to vent frustration and avoid the point of the discussion. But not sure.
<phoe>
(defun equal (x y &key z) (%equal x y z)) (defgeneric %equal (x y z)) ; here's your dispatch
<moon-child>
I interpreted (equal 5 7 :key #'oddp :test #'eq) as completely serious, and it seems reasonable to me
<madnificent>
mfiano: my gut-feeling says the keyword argument itself likely belongs to some form of inheritance.
<madnificent>
moon-child: Ah! I was looking for terms that conveyed a meaning. This suggestion conveys an implementation instead. Comparing two forms of equality based on their intention is harder that way.
<moon-child>
(though perhaps (eq-equal 5 7 :key #'oddp) would be slightly preferrable)
<mfiano>
Personally, I prefer slate gray for the bike shed.
<moon-child>
lol
<phoe>
:D
<mfiano>
On that note, I'm running away from this conversation.
<madnificent>
moon-child: That example would work for numbers, but you can hardly port it to objects of some kind. It lacks a higher-level meaning. An intention.
<Alfr>
madnificent, call it an equivalence relation? (And make sure it is one, otherwise unexpected things will happen that one does not expect from =, eql etc.)
<moon-child>
what higher-level meaning or intention could you possibly assign to 'have the same evenness/oddness'?
<Alfr>
madnificent, I think your underlying problem is that on a set of things you can define many such relations.
<Alfr>
madnificent, in particular every partition of the set corresponds to one such relation.
<madnificent>
moon-child: perhaps it's not the best candidate for an equivalence function then. Why would you use that function? Meaning comes from the use, rather than the implementation. With only an implementation it's hard to indicate a meaning for me.
<madnificent>
Alfr: Yes. But some common things likely pop up. It's valuable to share a vocabulary on those.
<madnificent>
Like: I jotted down a prolog thing at some point because I couldn't download the prolog compiler/runtime and I had to make a school assignment. I could use that if I'd find it back, but I'd rather share a solution.
<madnificent>
not even because of bugs, but also because it's makes things easier to read for others. When you see split-sequence:split-sequence you probably already know it. Similar for Alexandria.
Jing has joined #commonlisp
<_death>
you could create an equality function builder.. like (create-equality-function :atomic-test (disjoin (conjoin #'integerp #'oddp) #'eql) :descend-into '(vector list)) ;; or something
<_death>
well, #'equal-parity there..
<madnificent>
I could. But that still leaves open the whole issue of having a good description on the intended equality, which is what I was searching a solution for.
<_death>
the way to do that is by having a good name for the function
* madnificent
is not in the "tests are docs" camp
<moon-child>
mathematics disagrees with you :P
<Alfr>
madnificent, maybe simply a test key-argument? see tree-equal
<madnificent>
_death: somewhere in the beginning I pointed out that having a shared vocabulary is handy. it both helps you wire implementations together easily, as well as teach you good solutions (and shows pitfalls). like the statement Kent makes "you won't find one good equality, make sure you can have many"
<_death>
madnificent: in a create-equality-function case, a vocabulary is created.. terms for concepts like atomic or primitive test, descent into structures, etc.
<_death>
madnificent: the builder is a generic tool to create specialized equality operators
<madnificent>
_death: I doubt it would teach me what a good equality operator is and what should be taken into account for creating one. It could help define equality once that information was shared.
<_death>
here the vocabulary consists of equality definition operators like funcall/and/call/nest/store
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
<_death>
madnificent: well, logicians already had that covered with the definition of equivalence relation
<madnificent>
_death: for the few things that make sense to me (store doesn't immediately), that looks like a cool way of implementing various ways to compare things.
<madnificent>
On the upside, this discussion has made my docstring substantially better already! Thanks :D
marcoxa has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
tyson2 has joined #commonlisp
marcoxa has joined #commonlisp
jeffrey has joined #commonlisp
marcoxa has quit [Ping timeout: 240 seconds]
cranium has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
eddof13 has joined #commonlisp
amb007 has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Inline has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_73 has quit [Quit: ERC (IRC client for Emacs 27.2)]
_73 has joined #commonlisp
marcoxa has joined #commonlisp
waleee has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
eddof13 has joined #commonlisp
marcoxa has quit [Ping timeout: 268 seconds]
amb007 has quit [Read error: Connection reset by peer]
nij- has joined #commonlisp
amb007 has joined #commonlisp
pranavats has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
marcoxa has joined #commonlisp
cranium has quit [Quit: Leaving]
marcoxa has quit [Ping timeout: 245 seconds]
amb007 has quit [Read error: Connection reset by peer]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lagash has joined #commonlisp
marcoxa has joined #commonlisp
jeosol has quit [Ping timeout: 256 seconds]
<madnificent>
Hello again from the questions agancy. IIUC, cl-ppcre should be able to understand unicode characters thrown at it. Does that require any specific setting? I'm not getting expected results with character ranges.
eddof13 has joined #commonlisp
marcoxa has quit [Ping timeout: 240 seconds]
<mfiano>
Characters do not a unicode string make.
<mfiano>
I think SBCL encodes codepoints in UTF32, which is odd.
<White_Flame>
the encoding shouldn't affect anything
<White_Flame>
madnificent: best to use char-code to ensure that what you're testing with/against is what you expect numerically, since these are about ranges
<White_Flame>
if the string has combining forms, instead of single code points, that will muck with things as well
<White_Flame>
so you probably want to find a unicode normalization function first, too
<madnificent>
White_Flame: I convert from the hex code to a character when constructing the regex string and a string with ; matches [#x10000-#xEFFFF] which doesn't seem right.
<White_Flame>
you typed in the semicolon, and it passed a test for that range?
<madnificent>
Perhaps my assumption of using code-char isn't right
<madnificent>
White_Flame: That should only match if I explicitly entered the other semicolon and not one in the supplied range.
<madnificent>
It's not an external string. Just a query I wrote.
<White_Flame>
can you post code?
amb007 has quit [Read error: Connection reset by peer]
taiju has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
taiju has joined #commonlisp
nij- has quit [Remote host closed the connection]
gaqwas has quit [Remote host closed the connection]
<madnificent>
I found the bug. Thank you for confirming this should work!
<White_Flame>
ok
<madnificent>
If you try to replace #x[0-9A-F]{1,4} and expect #x10000 to match completely, you're o_O
* madnificent
is o_O
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<White_Flame>
heh
<madnificent>
It's open source though!
<frodef>
Hi all, I'm using DEX:REQUEST to download some HTTP. When there's network issues, it seems to just hang forever, despite DEX:*DEFAULT-READ-TIMEOUT* being set to e.g. 10. When I inspect the stack etc. at the point of hanging, there seems to be no timeout-mechanism that has trickled down to the lower abstraction layers. Does anyone happen to know about this?
<frodef>
(... this is SBCL on linux.)
<madnificent>
frodef: I don't know, but maybe maybe drakma does work? This isn't what you want to hear but the closest I get.
<frodef>
madnificent: "everybody" seem to say to transition from drakma to dexador.. :-)
<phoe>
;; until they go back to drakma
<frodef>
I seem to be able to provoke a "standard" read timeout, so I'm guessing it's a matter of the timeout mechanism not being consistently propagated to the lower I/O calls.
<White_Flame>
oh, it's fukamachi :-/ a lot of people end up looking for alternatives
_73 has quit [Ping timeout: 256 seconds]
marcoxa has joined #commonlisp
<mfiano>
welcome to fukamachiware.
<mfiano>
the lone wolf way of CL, cranking out code to satisfy personal requirements with no replies to issues
<mfiano>
I think it's been about 5 ot 6 years since my issues were posted and still waiting on replies
marcoxa has quit [Read error: Connection reset by peer]
marcoxa has joined #commonlisp
<frodef>
I suppose this does highlight a bit of the problem with the CL scene.. it's never quite clear what is the canonical thing (i.e. library).
<phoe>
whatever is maintained and merges PRs and bugfixes
<White_Flame>
right, cliki needs some form of rankings, IMO
rotateq has joined #commonlisp
<frodef>
phoe: yes, but it's a bit sad to include "what is the latest github checkin" in my search parameters for a HTTP library.
<frodef>
Anyhow, is Drakma the thing to go for, then? :)
<frodef>
(I actually recently switched from Drakma to Dexador.. sigh.)
<madnificent>
frodef: The only thing I've effectively seen work in communities is individuals putting in the time to check libraries and evaluate them.
<mfiano>
quicklisp has an http client built in.
<phoe>
;; though it's simple and can break for non-ql websites
<mfiano>
:)
Jing has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cosimone has joined #commonlisp
<mfiano>
Personally I use dexador, and make lots of hacks locally to fix things. Not a recommended way to go for fukamachiware for the sane.
<Xach>
heh
<Xach>
for wigflip.com i wrote both an http client and a dns client so i had fine control over fetching resources over the nasty net
<Xach>
didn't want dns timeouts to get stuck
<Xach>
(they both used epoll)
<frodef>
Maybe there should be some sort of semi-social mechanism overlaying quicklisp? Something to indicate confidence level in general, and particularly for a list of standard library functionality (e.g. http download)
<phoe>
you mean a unit test suite?
<White_Flame>
there were popularity lists posted, saying which QL systems were downloaded the most, at least
<Xach>
phoe: i've sometimes thought more like amazon product reviews except for libraries
<phoe>
White_Flame: there still are!
<Xach>
"FOUR STARS would cons again"
<frodef>
phoe: no, something that essentially says "86% of people use <this> for downloading HTTP", etc.
<White_Flame>
Xach: but those do change over time, too, so static old reviews aren't great here
<White_Flame>
phoe: cool, hadn't seen them in forever
<mfiano>
Inflated reviews are always indicative of good products.
<Xach>
White_Flame: yes, and if you leave one star, a foreign programmer will offer you a $25 amazon gift card to remove it
<yitzi>
Or bad ones.
<Xach>
download stats are also easily gamed
<Xach>
damned CI systems
<phoe>
White_Flame: you can download and print them yourself using this system
_73`` has joined #commonlisp
<phoe>
no need to depend on Xach's time to post download stats.
<phoe>
or you can automate formatting them into HTML and posting them if you feel like it
_73` has quit [Ping timeout: 240 seconds]
gioyik has joined #commonlisp
<frodef>
I suspect the thing is, CL lacks the Benevolent Dictator that most others have (or at least had while building community).
robin has joined #commonlisp
jayant has quit [Read error: Connection reset by peer]
jealousmonk has joined #commonlisp
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
marcoxa has quit [Ping timeout: 240 seconds]
<phoe>
herding lispers is a full-time job, herding lisp projects is at least another two
_73`` has left #commonlisp [ERC (IRC client for Emacs 27.2)]
<frodef>
hm.. Apparently Drakma doesn't have READ-TIMEOUT at all.
<madnificent>
frodef: no bug! sorry
<semz>
The BD comes with his own set of problems. Just look at van Rossum crippling functional programming in Python.
Algernon91 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
Algernon69 has quit [Ping timeout: 240 seconds]
jstoddard has joined #commonlisp
thomaslewis has joined #commonlisp
robin has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
etimmons has joined #commonlisp
Guest58 has joined #commonlisp
Guest58 has quit [Client Quit]
<frodef>
madnificent: sorry, what did you mean?
<frodef>
madnificent: ... that the missing READ-TIMEOUT is a bug?
<jeffrey>
frodef, are you using HTTPS instead of HTTP by any chance? When I try `(time (nth-value 1 (dex:get "https://httpbin.org/delay/10" :read-timeout 2)))` without HTTPS I get the error
<jeffrey>
after the wanted time
marcoxa has joined #commonlisp
<frodef>
jeffrey: yes, I think it's an SSL issue.
<jeffrey>
yooo
<jeffrey>
solved it
<jeffrey>
put the (when read-timeout after (if (string= scheme "https"
Devon77 has quit [Ping timeout: 256 seconds]
<jeffrey>
oops
<jeffrey>
wrong error
marcoxa has quit [Ping timeout: 268 seconds]
eddof13 has joined #commonlisp
<madnificent>
frodef: I was joking. I meant that if there is no such feature in drakma, then it can also have no such bug. It was not helpful. Sorry.
rain3 has joined #commonlisp
tyson2 has joined #commonlisp
robin has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gioyik has quit [Ping timeout: 276 seconds]
<frodef>
madnificent: np
jeosol has joined #commonlisp
eddof13 has joined #commonlisp
marcoxa has joined #commonlisp
<Xach>
i guess the ql http client takes a lot from the wigflip one
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marcoxa has quit [Ping timeout: 250 seconds]
eddof13 has joined #commonlisp
marcoxa has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #commonlisp
gioyik has joined #commonlisp
Devon has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phoe>
does anyone know of a utility that produces a string-output-stream for a given string with indefinite extent?
<phoe>
something like (with-output-to-string (stream string) ...) except where STREAM is not DX
<Alfr>
phoe, how about make-string-output-stream and get-output-stream-string?
<phoe>
Alfr: I want to provide my own string to vector-push-extend chars into
<Alfr>
phoe, then I don't know about something appropriate, sorry.
ec_ has joined #commonlisp
ec_ is now known as ec
<frodef>
Seems to me that CL+SQL just doesn't deal with timeouts.
Catie has joined #commonlisp
<marcoxa>
frodef: "deals with timeouts" is quite a statement given any CL implementation period. With or without SQL.
<frodef>
marcoxa: You're saying none of them deal with timeouts properly?
karlosz has joined #commonlisp
<frodef>
Anyhow, seems to me that SB-SYS:WITH-DEADLINE serves the purpose.
<frodef>
...except it leaks file-descriptors. Sigh.
aartaka has quit [Ping timeout: 256 seconds]
Algernon91 has quit [Read error: Connection reset by peer]
<lisp123>
edgar-rft: But Planet Lisp is only the human incarnation of secret alien technology ;)
varjag has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<frodef>
seems to me that the state of "alien technology" is that I simply cannot reliably download some files over HTTPS. (sorry, I'm just slightly frustrated by this..)
rain3 has quit [Ping timeout: 240 seconds]
tsiolkov has joined #commonlisp
karlosz has quit [Quit: karlosz]
<rotateq>
frodef: "Hello IT. Did you try turn it off and on again?" :D
pk has quit [Ping timeout: 260 seconds]
<frodef>
rotateq: That's pretty much how I expect these things are usually solved in practice. Kill the process and start over. The ultimate Garbage Collection.
<rotateq>
Yes and no. :D
<theothornhill>
frodef: I'm sure I'm totally missing the point, but did you try trivial-download?
<rotateq>
what are you using over there?
gaqwas has joined #commonlisp
marcoxa has joined #commonlisp
<frodef>
theothornhill: That seems to be something built atop Drakma?
<theothornhill>
yeah
<theothornhill>
Not sure what your problem is, but I use that in a utility to download pdfs all the time
marcoxa has quit [Read error: Connection reset by peer]
marcoxa has joined #commonlisp
<frodef>
theothornhill: my problem is what happens when the network hangs, or rather when a timeout occurs.
<theothornhill>
frodef: I see
<frodef>
I really thought CL was supposed to excel at Exceptional Situations.
cage has quit [Quit: rcirc on GNU Emacs 27.1]
<aeth>
when you have to interface with the rest of the world, you're going to have to deal with a messy situation, and potentially error codes
<theothornhill>
And connection-timeout isn't helping you? Sorry if this is just looping over things already mentioned
<aeth>
even 100% native CL isn't going to help you with networking because the network protocol isn't going to be written with CL objects in mind
<aeth>
(but usually, the issue is CFFI, not networking)
<aeth>
you'll also potentially face type mismatches
<frodef>
theothornhill: I need read-timeout, not just connection-timeout. And the latter is just ignored for SSL with Dexador.
karlosz has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
<theothornhill>
frodef: Oh, and that's only available on lispworks, it seems?
<frodef>
aeth: Sure, but dealing with "messy things" is kinda what I was hoping CL and its culture was supposed to deal with well.
<frodef>
theothornhill: don't think so, I'm using sbcl on linux.
<theothornhill>
I'm in drakma now... I'll show myself out
<aeth>
frodef: the problems of CFFI (or asm OS access if the OS has a stable API, but only Linux does afaik... the rest want you to go through C), DBs, and networking are just inherently messy
<aeth>
Only X11 tries to think about the existence of languages other than C or C++
<aeth>
I guess networking these days is mostly just "Do you have a JSON parser?", but they have subtle incompatibilities with each other and none of the CL JSON parsers are particularly good imo
<frodef>
aeth: I know that stuff is messy, and I can accept there are corner cases that can't be dealt with well. But this is just a plain download, dealing with a plain network outage.
<aeth>
I couldn't find something satisfactory with my IRC programming, either
<aeth>
the problem there is with usocket
<marcoxa>
frodef: I am saying (w.r.t. timeouts) that no semantics has been completely claified in any implementation. We had a long discussion on th epro mailing list some time ago.
<aeth>
in particular, there is no READ-BYTE-NO-HANG (just READ-CHAR-NO-HANG) so if you read bytes (which you should, since the encoding over the network is unlikely to be exactly what your CL implementation expects)... you can... you know... hang
<marcoxa>
and yes... the issus came out about the use of usocket. I don't remember the details.
<aeth>
You can guard the hanging with a check to LISTEN, but that does not give an error on the loss of the connection (it's defined not to, iirc)
<aeth>
So you either do a hanging read and get an error on connection loss (I guess a background thread makes that possible), or you do a non-hanging read (manually, by checking LISTEN first) and only READ-BYTE when LISTEN is T, but it doesn't tell you when there's a detected disconnection... So you can be waiting forever on a dead connection
<yitzi>
aeth: What deficiencies do you see with existing JSON parsers?
<theothornhill>
frodef: *default-read-timeout* is a no-go, at least. It is only defined, not used anywhere as far as I can tell
<aeth>
yitzi: for starters, about 80% of them if not 100% of them don't understand the CL type system, preferring to treat NIL as null rather than as false
<aeth>
(by default, but everyone knows that defaults matter because virtually everyone uses the defaults)
<aeth>
if NIL isn't properly considered, then JSON encoding/decoding won't round trip
<aeth>
since NIL could be null (terrible idea; just use :null or 'null) or could be false or could be the empty list
<aeth>
oh, and if you use plists/alists for JSON objects now you have an additional ambiguity
<yitzi>
jzon and shasht both use nil for truth
<aeth>
theothornhill: that at least considers round-tripping type mappings
<frodef>
Given the state of "Enterprise Software", I've found that the performance of JSON parsers is actually important. They need to gobble up megabytes...
<aeth>
that does something that almost every JSON library doesn't do (by default)
<yitzi>
That is the default mapping for both jzon and shasht.
<yitzi>
Both of which pass the JSON test suite, unlike most other CL JSON parsers.
<aeth>
both libraries are (probably) fairly new
<aeth>
and only need to exist because the first 5 or so didn't even round trip
<theothornhill>
jzon not in quicklisp yet, at least
<aeth>
now you have the issue, though, of (1) getting it in Quicklisp and (2) getting everything that uses JSON to move over to one of the conforming and round-trip libraries
<aeth>
not easy considering how widespread JSON is
<aeth>
especially jzon, which would require a lot of lists to be converted to simple-vectors
<yitzi>
I wrote shasht about 1.5 years ago. jzon is about the same age.
<aeth>
what's worse is when a library reads/writes its own JSON
<aeth>
because now moving it to a conforming library might break the stored data
<aeth>
ones that simply read someone else's JSON don't have to worry about that
Oladon has joined #commonlisp
<aeth>
I would say that the two biggest issues historically have been (1) no serious JSON library, (2) poor support for encrypted networking (e.g. HTTPS)
<theothornhill>
Does lispworks parse json? Or was json largely ignored?
lisp123 has joined #commonlisp
<lisp123>
I'm suprised how often JSON comes up in Lisp circles, I never thought it would be that hard to parse
<yitzi>
That the spec is ambiguous and ill defined does not help. And in my opinion it is not hard to parse, just that most of the parsers are just slightly flawed...IMHO.
nature has joined #commonlisp
<lisp123>
It seems like there is something slightly missing from each. YASON has suited me well enough, but tbh I prefer just using XML were I need an independent format for serialization
thomaslewis has joined #commonlisp
<lisp123>
(but JSON can't be avoided much when working with the web, ofc)
<frodef>
JSON and HTTPS, indeed.
Kyuvi has joined #commonlisp
eddof13 has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
karlosz has quit [Quit: karlosz]
<jstoddard>
I think I have a similar problem to what frodef is facing. I put together a simple Gemini client (so not HTTP per se, but using usocket and cl+ssl in any case) and don't really have a way to deal with read timeouts.
<jstoddard>
I haven't thought about it much, though. I'm a noob to socket programming (higher level libraries hid that stuff from me before), so I have only been worrying about getting something working for the most part. I figured I would worry about making it more robust later.
<jstoddard>
I appreciate the heads up that it might not be so easy...
dec0d3r has quit [Quit: Leaving]
<fe[nl]ix>
luis: do you want to blog/announce that CFFI issues are now on Github, or should I ?
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lisp123>
jstoddard: off topic, but I was JUST reading about Gemini :)
eddof13 has joined #commonlisp
<jstoddard>
lisp123: I'm entirely new to the protocol, but putting together a client for it seemed like a simple way to try out some network programming in Common Lisp and get some practice with McCLIM while at it.
<fe[nl]ix>
if I were to need an HTTPS client to use in production (say a startup), I'd look into resurrecting cl-curl
<lisp123>
jstoddard: Nice stuff. Good luck with it (and yeah networking is always tough ;))
<aeth>
lisp123: the problem with JSON isn't parsing it, it's that it only really cleanly maps to languages like Lua, JSON, Python, etc. Most of the "scripting languages", excluding a few (e.g. Perl)
<aeth>
(not 100% there, either, though)
<fe[nl]ix>
drakma is nice as a simple HTTP/1.1 client, but it has major drawbacks
<fe[nl]ix>
aeth: one should not be obsessed with having to "cleanly map" to a language
<aeth>
fe[nl]ix: it just makes the task easier or harder
<aeth>
the problem with most JSON libraries is that if poorly designed, CL->JSON->CL->JSON is a lossy process
<aeth>
I suppose order isn't necessarily preserved for JSON objects, but that's not as bad as turning false into null or [] or whatever
<fe[nl]ix>
round-tripping is an actual problem, mapping json types to language types is hardly one
<aeth>
round-tripping follows, though
<aeth>
in particular, Common Lisp doesn't have a null while JSON does, which leads some people to use the poorly-named NIL (which is false and the empty list, but not a proper null and can't be because it's false) improperly
<fe[nl]ix>
you can have round-tripping by parsing each JSON type as a CLOS type, no built-in types
<aeth>
NIL->null or NIL->{} or NIL->[] will create the issues with CL's JSON libraries
<aeth>
(well, most of them)
<fe[nl]ix>
myjson:json-map -> {}, etc...
<aeth>
that abstraction just moves the issue one layer back
<fe[nl]ix>
there's no more issue that way
<aeth>
the user will still wind up with issues if they, at some point, associate NIL with null, {}, or [] instead of false unless they're very careful to distinguish between NIL-as-list (into [] or even {} if plist/alist) and NIL-as-false
<aeth>
the only issue is that the user is encountering that when translating it into the object rather than when translating it into JSON
karlosz has joined #commonlisp
<aeth>
and sometimes, the user who does this will associate NIL-as-false with JSON's null, which is... not ideal if anyone other than the original user needs to see the JSON
<fe[nl]ix>
nope, if a library gives a strict mapping between Lisp types and JSON, the problem is gone
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fe[nl]ix>
that some people might want to use NIL instead of an empty map (or hash table), is irrelevant
eddof13 has joined #commonlisp
<fe[nl]ix>
note that the root of the problem is the expectation that language objects be self-describing
<fe[nl]ix>
if you require a schema for encoding, like for protobufs, the problem goes away
<fe[nl]ix>
NIL will have an unambiguous encoding to the target type
nature has quit [Ping timeout: 240 seconds]
<drakonis>
gcl has surprisingly decent documentation, wow.
<drakonis>
even if i'm not using gcl, its still pretty useful
<etimmons>
Shinmera: What's the best practice for skipping tests in parachute that signal errors. SKIP seems to still evaluate the test and if it errors (e.g., a function is missing for the implementation), parachute marks it as failing.
euandreh has quit [Ping timeout: 240 seconds]
<Shinmera>
Hmm
<Shinmera>
I think that's more of a bug
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Shinmera>
not that it still runs it, but that it doesn't always skip it
<Shinmera>
Actually the issue is more nuanced, still
<Shinmera>
In general parachute works the way it does because it wants to avoid catching errors in the *test definition itself*
<Shinmera>
so anything that is not explicitly within an is/true/etc. form will bubble up and produce the warning you see
<etimmons>
I've seen that issue as well. But in that case, the report has a status of passed even though the summary says there's a failure
<Shinmera>
Oh, right, and you're using the SKIP form rather than the option
lisp123 has quit [Ping timeout: 256 seconds]
<etimmons>
If there's an explicit ERROR within a skip form, the summary will show a failure _and_ the report object will have a failure status
<Shinmera>
What's your simplified case?
<etimmons>
one sec
<Shinmera>
because (skip (error "foo")) should and will error and mark it failed.
<Shinmera>
but (skip (true (error "foo")) should not
<etimmons>
oh... interesting
<Shinmera>
again, the former is an error in the test definition as you wrote it
<Shinmera>
so it's a problem with your tests, not the implementation you're testing
<etimmons>
I'm doing the former, effectively
<Shinmera>
right, so there's no bug here.
<Shinmera>
If you want to skip that, then just use reader conditionals.
shka has quit [Ping timeout: 256 seconds]
<etimmons>
OK, I'll do that for now.
<Shinmera>
alternatively, whatever form you have that's bugging out, you could potentially wrap that in (finish ...) to get the proper skip behaviour
<etimmons>
I think I like that better
<Shinmera>
note that most forms like finish/is/etc return their result, so they can still be used in normal flow.
<Shinmera>
err, by result I mean the resulting value of the form they wrap
<etimmons>
My actual use case is I have a macro with-open-tar-file and then inside the body of that macro I do a lot of tests. The error comes from deep within the code the macro inserts. (One of the libraries I use signals an error on ABCL for some non-implemented functionality)
<drakonis>
oh wait this isnt gcl, its the hyperspec lol
<drakonis>
welp
<drakonis>
its the hyperspec in texinfo form
<etimmons>
So I think I'll go the finishes route now that I know how skip is supposed to work
<Shinmera>
I see
<jeffrey>
frodef, replacing the `progn` for the `(string= scheme "https")` in dexador's `(defun-careful request` /src/backend/usocket.lisp with https://dpaste.com/64SEHPWEF makes the ssl-stream kill itself after :read-timeout of passed time
<frodef>
jeffrey: btw where did you find any documentation on -deadline for CL+SSL? I looked for that and couldn't find it...
nij- has joined #commonlisp
rotateq has quit [Quit: ERC (IRC client for Emacs 27.2)]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Kyuvi has quit [Quit: Client closed]
<jeffrey>
I don't think I can reproduce the full rabbit hole, but it went something like this: dex:request -> cl+ssl:make-ssl-client-stream -> (make-instance 'ssl-stream -> which has a `deadline` accessor. Also: cl+ssl:make-ssl-client-stream calls `ensure-ssl-funcall`, which applies the `deadline`. Along the way, I found https://common-lisp.net/project/cl-plus-ssl/ (of which the second mention points to support) and somewhere in parallel I stumbled
<jeffrey>
upon the aforementioned hunchentoot issue, of which the latter essentially does the same as the hack I wrote. Though, confirmation on how to use the `deadline` I found with an `ag` through the cl+ssl code, which has a test for the `deadline` in ssl-verify-test.lisp (in cl+ssl package) after which I knew it was the correct way.
Algernon69 has joined #commonlisp
attila_lendvai has quit [Ping timeout: 240 seconds]
<frodef>
...somehow a RATIO gets passed to SB-SYS:DECODE-TIMEOUT. I find this code pretty much impossible to follow.
dra has joined #commonlisp
<nij->
Anyone aware of CL libraries that deal with "SXML"? Not the existing S-XML or XMLS. For SXML, see the following for a neat example: https://en.wikipedia.org/wiki/SXML
<jeffrey>
frodef, if you exclude the :read-timeout and do something like this: `(time (nth-value 1 (dex:get "https://httpbin.org/delay/13")))` you should get the same anyhow
<frodef>
jeffrey: apparently cl+ssl::seconds-until-deadline calculates a value using CL:/ which tends to produce a ratio. amazaing.
<frodef>
jeffrey: I didn
<frodef>
..n't understand your "should get the same".
<frodef>
..the problem goes away if you ignore network hangups, of course..?
<jeffrey>
nvm, I thought if I recompile without the hack and dex:get httpbin delay for 13s it would type-error the same way, but httpbin has a max of 10s delay
<jeffrey>
But two handler cases is fine right?
<frodef>
sorry, I don't follow.
<jeffrey>
one for https type-error and the other for http io-timeout? I mean its not great, but if it works :p
<frodef>
I rather suspect the fd leakage would still be an issue.
djuber has joined #commonlisp
<frodef>
I'm trying to remember a word.. it's the more generic concept that is similar to :around methods, only for any function..?
<Krystof>
advice
<frodef>
right, thanks
* Krystof
waves
<frodef>
hi!
pranavats has left #commonlisp [Error from remote client]
<frodef>
No advice mechanism in sbcl, it seems.
<nij->
phoe: Oh.. thanks. I apologize for my search-foo.