gabiruh has quit [Quit: ZNC - 1.6.0 - http://znc.in]
EvW1 has quit [Ping timeout: 264 seconds]
Oladon has quit [Quit: Leaving.]
Posterdati has quit [Ping timeout: 265 seconds]
libertyprime has quit [Quit: leaving]
Posterdati has joined #lisp
superkumasan has quit [Ping timeout: 240 seconds]
dale has quit [Quit: dale]
Blukunfando has quit [Ping timeout: 265 seconds]
bitmapper has quit [Ping timeout: 245 seconds]
kamog has quit [Quit: ERC (IRC client for Emacs 26.3)]
dale has joined #lisp
jao has quit [Ping timeout: 240 seconds]
semz has quit [Ping timeout: 245 seconds]
iovec has quit [Quit: Connection closed for inactivity]
keep_learning has joined #lisp
semz has joined #lisp
fragamus has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
Aruseus has quit [Remote host closed the connection]
EvW has joined #lisp
fragamus has quit [Ping timeout: 245 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
mindCrime has joined #lisp
mindCrime_ has joined #lisp
mindCrime has quit [Ping timeout: 245 seconds]
vaporatorius has quit [Read error: Connection reset by peer]
ahungry has joined #lisp
EvW2 has joined #lisp
analogue has quit [Quit: Leaving]
EvW has quit [Ping timeout: 250 seconds]
EvW has joined #lisp
EvW2 has quit [Ping timeout: 246 seconds]
EvW has quit [Ping timeout: 246 seconds]
akoana has left #lisp ["Leaving"]
karlosz has joined #lisp
marusich has joined #lisp
marusich has quit [Ping timeout: 250 seconds]
marusich has joined #lisp
Oladon has joined #lisp
<beach>
Good morning everyone!
dddddd has quit [Remote host closed the connection]
<ahungry>
mornin
<sardonumpsa>
goo' mo' b'.
<beach>
I find the example/question of remexre impossible to follow because of all the oversimplifications. You can't change the class of a vector, nor of a bit or :mu.
Bike has quit [Quit: Lost terminal]
<beach>
sardonumpsa: Are you new here? I don't recognize your nick.
abhixec has joined #lisp
rople has joined #lisp
<loke>
I have a regression is clouseay
<loke>
Clouseau
<beach>
:(
<loke>
McCLIM from the 19'th of this month is fine, but the latest version throws an SBCL AVER when loading Clouseau
<beach>
You may want to inform #clim as well.
<loke>
It happens reliably when building Climaxima for Flatpak, but not on my laptop.
<loke>
Oops. Yes, that were I intended to post it.
p9fn has quit [Ping timeout: 250 seconds]
p9fn has joined #lisp
<beach>
remexre: If I understand what you are doing, it looks similar to what I do in Cluffer. Cluffer is a tree (representing a sequence) of editor lines stored in the leaves of the tree.
<beach>
At any point in time, one line is "open", so it is represented as a gap buffer for fast updates. Other lines are "closed", so they are represented as something more compact.
<beach>
When a closed line is about to be modified, the currently open line is first closed. Then I inspect the contents.
<beach>
If there are objects in it other than characters, I create a simple vector and move the contents of the gap buffer to it.
<beach>
If it contains only characters, but not only base characters, I create a simple string.
<beach>
And if it contains only base characters, I create a simple base string. Maybe I haven't implemented all these optimization yet, but that's the idea at least.
<beach>
remexre: But, since all these objects are instance of built-in classes, I can't reliably use change-class.
<remexre>
Okay, that sounds enough like my problem
retropikzel has joined #lisp
<remexre>
And I'd be using classes or structs wrapping the primitive classes
<beach>
I suppose you mean "standard classes". You can use change-class on one of those instances, but that won't change the representation of the wrapped object.
<beach>
Oh, since I mentioned Cluffer, the entire thing is defined as a bunch of CLOS protocols, allowing client code to customize how lines are represented, how they are opened, and how they are closed.
gravicappa has joined #lisp
fragamus has joined #lisp
retropikzel has quit [Remote host closed the connection]
<beach>
remexre: And by "primitive classes" I assume you mean "built-in classes".
sindan has quit [Remote host closed the connection]
sindan has joined #lisp
<loke>
beach: I don't know about his case specifically, but I think of “primitives” as being objects that fit in a single register. Such as fixnums, characters, etc.
Oladon has quit [Quit: Leaving.]
<loke>
I don't know if that's standard terminology though
marusich has quit [Remote host closed the connection]
Lord_of_Life has quit [Ping timeout: 240 seconds]
tomara has joined #lisp
<tomara>
:help
Lord_of_Life has joined #lisp
<beach>
tomara: What do you need help with.
<beach>
loke: That's not standard terminology, and I don't think that's what remexre means.
vlatkoB has joined #lisp
<remexre>
Er, yeah, I meant standard classes
caltelt has quit [Ping timeout: 246 seconds]
<loke>
remexre: That would be any class which has STANDARD-CLASS (or a subclass of which) as its metaclass.
<loke>
I.e. used-defined classes too
<loke>
user
<beach>
loke: I think you missed a bit what remexre said.
tomara has quit [Client Quit]
<beach>
loke: Both "classes" (meaning "standard classes") and "primitive classes" (probably meaning "built-in classes") were mentioned.
tomara has joined #lisp
davr0s_ has quit [Ping timeout: 240 seconds]
davr0s has quit [Ping timeout: 240 seconds]
<beach>
remexre: And, yes, I use the same trick in Cluffer. I wrap the line contents in a standard object that can be an instance of either CLOSED-LINE or OPEN-LINE, and I use CHANGE-CLASS on that standard object so as to preserve the identity. But I still need to replace the line contents "manually" when the line is opened or closed.
Inline has quit [Quit: Leaving]
Necktwi has joined #lisp
nostoi has joined #lisp
tomara has quit [Quit: tomara]
tomara has joined #lisp
nostoi has quit [Quit: Verlassend]
tomara has quit [Quit: tomara]
Intensity has quit [Changing host]
Intensity has joined #lisp
ljavorsk has joined #lisp
tomara has joined #lisp
tomara has left #lisp [#lisp]
Cymew has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
MichaelRaskin has quit [Quit: MichaelRaskin]
SaganMan has joined #lisp
nanoz has joined #lisp
<beach>
Question: When an attempt is made to transferred control to an exit point, it is possible that the exit point has been "abandoned", But is it also possible that an attempt can be made to execute the cleanup form of an UNWIND-PROTECT form even though the exit point corresponding to the UNWIND-PROTECT form has been "abandoned"? If so, I would like to see an example.
Ricchi has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 240 seconds]
<flip214>
beach: what do you mean by an "abandoned" exit point?
<beach>
I mean what the Common Lisp HyperSpec says.
<flip214>
beach: reading that chapter and thinking through a few (invalid) examples I believe that "abandoned" is meant as
<flip214>
"code flow won't get back to that point", so the corresponding U-P isn't relevant any more either.
<lieven>
it might be made unabandoned again. say you do a (go tag) in an unwind-protect
<lieven>
or for maximum fun, you have handed out #'(lambda () (go foo)) closures to downward functions. SERIES does that a lot and has brought forward bugs in implementations with it.
<beach>
flip214: No, it means that an attempt can be made to transfer to it, but that would be illegal.
<beach>
flip214: Consider a RETURN-FROM or GO inside an UNWIND-PROTECT.
ahungry has quit [Remote host closed the connection]
<beach>
flip214: So the question is whether such an attempt is possible when it comes to an UNWIND-PROTECT as opposed to a GO or a RETURN-FROM.
<beach>
lieven: Exactly.
vaporatorius has joined #lisp
<beach>
So I know that i need a VALID-P slot in an exit point that corresponds to a BLOCK or a TAGBODY, and I am trying to determine whether I need one in an exit point that corresponds to an UNWIND-PROTECT.
<beach>
I know SBCL does not check the validity of all its exit points, but that's not a bug, because the Common Lisp HyperSpec says it's undefined behavior.
<beach>
Obviously, in SICL, I want to be way more strict.
nanozz has joined #lisp
<loke>
What does it mean for an expit point to be VALID-P?
gxt has joined #lisp
<beach>
Not being "abandoned".
nanoz has quit [Ping timeout: 245 seconds]
<beach>
So the Common Lisp HyperSpec is not quite accurate.
<beach>
Because point 1 implies that the UNWIND-PROTECT exit points are abandoned.
<beach>
But then they are executed in point 2.
<beach>
So the question becomes: Is there a concept of an exit point corresponding to UNWIND-PROTECT being "abandoned", and if so, what does it imply and when is it done?
<beach>
I am thinking that it is abandoned once the cleanup forms have been executed (as opposed to initially as suggested by point 1), and I think it implies that the cleanup forms can not be executed a second time.
<beach>
And if I am right, my first question still stands, i.e. is it possible that such an attempt can be made, so that I have to represent this fact explicitly, and if so, what is the situation that can make such an attempt possible?
<beach>
I think the problem with the terminology is the definition of "exit point". The glossary includes UNWIND-PROTECT, but 5.2 seems to exclude such points.
jprajzne has joined #lisp
<beach>
Here is what I think. The cleanup forms of UNWIND-PROTECT are always executed starting with the most recently established ones.
Duuqnd has joined #lisp
<beach>
If an UNWIND-PROTECT does a non-local control transfer to an exit point that has not yet been abandoned, then only less recent UNWIND-PROTECT exit points are present in the dynamic environment. So they can't have already been executed. Hence they are not abandoned.
jello_pudding has joined #lisp
SaganMan has quit [Ping timeout: 265 seconds]
<beach>
So in conclusion, I don't think that UNWIND-PROTECT needs an explicit indication that it has been abandoned.
<beach>
I think what I will do is I will exclude UNWIND-PROTECT from the definition of "exit point" in my code. That way, 5.2 makes more sense.
fsmunoz has quit [Ping timeout: 250 seconds]
scymtym has joined #lisp
ltriant has quit [Quit: leaving]
jonatack has quit [Ping timeout: 276 seconds]
<beach>
scymtym: Do you have any opinions about this discussion about exit points?
<scymtym>
beach: sorry, i just got here. i'm reading the logs now
<beach>
No rush, and only if you have time.
varjag has joined #lisp
sz0 has joined #lisp
<beach>
We really, really should create this document/website called "Common Lisp for language implementers".
<scymtym>
beach: was this discussion in #lisp? i only see CHANGE-CLASS and a clouseau regression so far
<beach>
Ouch. Something wrong with the logs?
<beach>
Let me check...
<scymtym>
ah, no i just got to it, sorry
<beach>
Yes, it's in the Tymoon logs.
nanozz has quit [Ping timeout: 245 seconds]
jello_pudding has quit [Remote host closed the connection]
raghavgururajan has joined #lisp
<beach>
I so wish we had an "annotatable" Common Lisp HyperSpec the way we do with the CLIM specification.
karlosz has quit [Quit: karlosz]
nowhere_man has quit [Ping timeout: 240 seconds]
Posterdati has quit [Remote host closed the connection]
Posterdati has joined #lisp
<beach>
I mean, it wouldn't be *the* Common Lisp HyperSpec™, but a similar one.
<aeth>
beach: what features would you want in Common Lisp HTML documentation in general?
<no-defun-allowed>
beach: Is the situation you're asking for anything like this example in a scan of CLTL? It sounds similar to me but I'm not sure: https://i.redd.it/wf8yklonnph31.jpg
<beach>
Not sure I understand the question. I would like a document that explains the deep ideas of the standard where those are not clear from the existing document, and I would like a discussion about implementation strategies with pros and cons of each one, including the impact of every choice on the rest of the system.
<scymtym>
beach: reading 5.2, i had the same impression, that is UNWIND-PROTECT clauses don't seem to make sense as exit points in their own right. associating them with other exit points seems better. still thinking about the actual question
<beach>
no-defun-allowed: Yes, but that particular example I understand.
<beach>
no-defun-allowed: My question is specifically about exit points corresponding to UNWIND-PROTECT.
<beach>
scymtym: Thanks. Good to know that I am not completely off.
<beach>
scymtym: But I don't know what you mean by "associating them with other exit points".
shka_ has joined #lisp
holycow has joined #lisp
<scymtym>
i mean control is transferred to an exit point, not an UNWIND-PROTECT clause. but when transfer is transferred, there is a sequence of associated UNWIND-PROTECT clauses (not statically associated with the program point that established the exit point, of course). that's my understanding of 5.2
<beach>
OK, I see what you mean.
<beach>
I need to put this computer on a charger.
jao has joined #lisp
Posterdati has quit [Ping timeout: 252 seconds]
jonatack has joined #lisp
<beach>
Done.
gxt has quit [Quit: WeeChat 2.6]
<beach>
Oh, but wait...
<beach>
We have to be careful.
<beach>
Let's say the dynamic environment contains B1 B2 U1 U2 where B1 and B2 are BLOCK points and U1 and U2 are UNWIND-PROTECT points. and U2 is the most recent.
<beach>
Now, let's say we execute a transfer to B2.
<beach>
So we follow the steps in 5.2.
<beach>
We start by step 1, but there is nothing to do.
<beach>
So then we start doing 2 and 3.
<beach>
As part of that, we execute U2.
<beach>
Now suppose U2 does a transfer to B1.
<beach>
That's fine.
<beach>
As part of that transfer, we execute the cleanup forms in U1.
<beach>
But when we are done, we have to make sure that we do not return to the initial transfer, because we would then execute the cleanup forms of U1 again.
gxt has joined #lisp
<beach>
So, it looks to me like there is at most one occurrence of 5.2 possible at any point in time. They do not nest.
<scymtym>
i was thinking about the same example: (block outer (block inner (unwind-protect (unwind-protect (return-from inner) (print 1) (return-from outer)) (print 2))))
<beach>
Yeah.
<beach>
But we can't consider this situation illegal, so it makes no sense to mark U1 as abandoned and signal an error in the initial transfer.
Posterdati has joined #lisp
mingus has joined #lisp
<beach>
Or else, we have different concept of "abandoned" for UNWIND-PROTECT, meaning "don't execute the cleanup forms again".
<scymtym>
i was thinking about modeling the exit point/uwp stack more explicitly and turning 5.2 into an algorithm (or more than one, if there are multiple possible interpretations) to get a more formal grip
<beach>
Good idea. And that is basically what I am trying to do, because I am planning to implement this stuff for SICL. But you are right, an more formal algorithm is probably a good start.
<beach>
The other slight quirk is that, as a result of RETURN-FROM, the exit point is abandoned and cannot be used again. But as a result of GO, the exit point is still valid.
<beach>
More quirks: 5.2 says "Not that for go, the exit point is the form within the tagbody that is being executed at the time the go is performed;...."
<beach>
That description makes no sense to me what so ever.
hhdave has joined #lisp
<beach>
So if I have (tagbody (f) (g) out) and (f) happens to do a (go out), then the exit point is (f)?
<scymtym>
yeah, shouldn't the exit point be something related to the target label?
<beach>
Exactly.
<beach>
And the glossary contradicts this description.
<beach>
We really need to clean up these descriptions in WSCL.
<scymtym>
one could also argue the statement containing the GO form, but the GO form itself is strange
<beach>
Well, (f) is the kind of the statement, not "containing" but "executing" the GO.
<beach>
And that is strange too.
<beach>
So 5.2 says that exit points are forms, but the glossary says that they are points in a control form.
<beach>
So that begs the question: what is a "point"
<beach>
And "point" is not defined in the glossary.
libertyprime has joined #lisp
<beach>
It seems to me that a "point" is either before a particular form is about to be evaluated, or immediately after a particular form has been evaluated. Or something like that.
jonatack has quit [Ping timeout: 240 seconds]
<scymtym>
the static aspect sounds like program points. but the ability to abandon exit points requires some kind of attached dynamic state
jonatack has joined #lisp
<beach>
Yes, but "program point" is also not defined.
<beach>
I think what is needed is a description of each program point of every special form.
<beach>
For example, take LAMBDA.
<beach>
It should be defined somewhere that the program point corresponding to the end of the evaluation of the last form in the body is one where special variable bindings established by the lambda list are undone before control returns to the caller.
<beach>
Stuff like that.
<scymtym>
time to look into formal semantics for common lisp? i would be surprised if that hadn't been attempted before, though
<beach>
Oh, I am not going to attempt that.
<beach>
But something a bit less formal than the Common Lisp HyperSpec would be good.
<beach>
We had to make some of it formal in Cleavir (especially in version 2), where we have the concept of a "compilation context" that says how values are to be used, and what the successor forms are.
jao has quit [Ping timeout: 240 seconds]
<beach>
We also represent the dynamic environment explicitly there as part of the context.
<beach>
This was Bike's idea, for which I am grateful.
<beach>
Hmm, maybe if I just document what Cleavir2 does, while avoiding direct references to its data structures, it would be a good start.
<scymtym>
yeah, i said the above half-jokingly. some kind of middle ground in terms of formality may be best since formal semantics for all of common lisp seems daunting
<beach>
Then we are in perfect agreement.
<beach>
*sigh*, I think I just signed up for yet another huge task. But I can't put what I am doing on hold, so it shall have to wait, or I can do it in parallel with my current tasks.
hhdave has quit [Ping timeout: 246 seconds]
hhdave has joined #lisp
ljavorsk has quit [Ping timeout: 276 seconds]
prite has joined #lisp
holycow has quit [Quit: leaving]
JohnMS has joined #lisp
JohnMS_WORK has quit [Ping timeout: 264 seconds]
elinow has joined #lisp
<beach>
So at least I convinced myself that the previous example with B1 B2 U1 U2 is not a problem.
<beach>
The "unwinder", i.e. the procedure that executes the steps of section 5.2 is basically executed as a result of a function call.
<beach>
The last step of the unwinder is to make a non-local jump to the exit point.
<beach>
If U2 executes the unwinder again, that second invocation will end with a non-local jump to B1, and the first invocation of the unwinder will be automatically eliminated.
asdf_asdf_asdf has joined #lisp
chens has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
hhdave_ has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
hhdave_ is now known as hhdave
hhdave_ has joined #lisp
hhdave has quit [Ping timeout: 265 seconds]
hhdave_ is now known as hhdave
jazzslag has joined #lisp
Duuqnd has quit [Remote host closed the connection]
Duuqnd has joined #lisp
ralt has joined #lisp
jonatack has quit [Quit: jonatack]
jonatack has joined #lisp
adip has quit [Ping timeout: 276 seconds]
isBEKaml has joined #lisp
jonatack has quit [Read error: Connection reset by peer]
raghavgururajan has quit [Remote host closed the connection]
grokkingStuff has joined #lisp
grokkingStuff has quit [Read error: Connection reset by peer]
grokkingStuff has joined #lisp
grokkingStuff_ has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
grokkingStuff has quit [Ping timeout: 245 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
grokkingStuff_ has quit [Remote host closed the connection]
grokkingStuff has joined #lisp
SaganMan has joined #lisp
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
<isBEKaml>
How can I define optional arguments with default values in defuns? as an example: (defun factorial (n (acc 1)) ...) ?
<White_Flame>
&key makes keywords, with the same parmeter shape
<isBEKaml>
thanks, I was thinking &aux, although I should look that up now
<White_Flame>
acc = defaults NIL. (acc 1) = defaults 1. (acc 1 acc-p) = the acc-p boolean tells you if the caller actually included that parameter or not
<White_Flame>
the latter, because (factorial 3 1) is ambiguous as to whether the 1 was passed or defaulted
grokkingStuff has quit [Max SendQ exceeded]
<White_Flame>
from the callee's perspective
<isBEKaml>
White_Flame: yeah, I vaguely remembered seeing something like that in PG's ANSI CL book
grokkingStuff has joined #lisp
<White_Flame>
also, there's #clschool for basic questions, a lot of responses will get advanced here
<isBEKaml>
I'll go look up what &aux does
<isBEKaml>
White_Flame: I don't mind advanced answers, actually :-)
<White_Flame>
LET basically obsoleted &aux
<White_Flame>
it simply establishes new variables for the function context
<isBEKaml>
thanks, I have worked around my failing memory with labels in that factorial function now
<White_Flame>
the caller can't interact with them, iirc
<asdf_asdf_asdf>
(defun (a b) (declare (ignore a)) (+ b 2))
orivej has joined #lisp
xrash has joined #lisp
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
nanoz has joined #lisp
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
<no-defun-allowed>
What function are you defining?
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
raghavgururajan has joined #lisp
Necktwi has quit [Ping timeout: 240 seconds]
Necktwi has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
FreeBirdLjj has joined #lisp
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
grokkingStuff has quit [Max SendQ exceeded]
grokkingStuff has joined #lisp
grokkingStuff has quit [Remote host closed the connection]
<LdBeth>
∇a b b+2 ∇
<no-defun-allowed>
#apl is that way --->
<ecraven>
⍝ is what I like best
raghavgururajan has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
eSVG has quit [Ping timeout: 246 seconds]
igemnace has joined #lisp
otwieracz has left #lisp ["WeeChat 2.2"]
EvW has joined #lisp
chens has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 240 seconds]
rople has quit [Ping timeout: 268 seconds]
prite has quit [Read error: Connection reset by peer]
prite has joined #lisp
prite has quit [Read error: Connection reset by peer]
jeosol has quit [Ping timeout: 260 seconds]
JohnMS_WORK has joined #lisp
prite has joined #lisp
<beach>
To me, it is looking more and more like the authors of the standard had some very concrete implementation of the dynamic environment in mind, and that they tried to avoid such a concrete description in the standard, in favor of some more abstract language. The net result is a loss of precision, and also some contradicting terminology.
cpape` has quit [Quit: ERC (IRC client for Emacs 26.1)]
cpape has joined #lisp
<beach>
I am currently trying to recover that concrete description. And then I will try to find a better way of turning it abstract so that no precision is lost. I am not sure that I will be able to do that though.
prite has quit [Read error: Connection reset by peer]
JohnMS has quit [Ping timeout: 252 seconds]
prite has joined #lisp
kajo has quit [Ping timeout: 246 seconds]
ebrasca has joined #lisp
<beach>
It is interesting how one can think that one knows a language pretty well, but then when one tries to create an implementation of it, one discovers several holes in one's knowledge about it. And some holes in the specification of it as well.
<varjag>
cl-async is so nice but it has to grovel..
amerlyq has joined #lisp
elinow has quit [Read error: Connection reset by peer]
elinow has joined #lisp
dddddd has joined #lisp
hiroaki has joined #lisp
DGASAU has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
<ralt>
a simple single-threaded event loop using only lisp and some small cffi wrappers is not too hard to do
maxxcan has joined #lisp
<beach>
ralt: For what purpose?
<ralt>
replacing cl-async
<beach>
Ah.
<ralt>
the major thing you need to have cffi wrappers for is epoll_* stuff
sardonumpsa has quit [Remote host closed the connection]
superjudge has joined #lisp
jonatack has joined #lisp
skibo_ has quit [Quit: WeeChat 2.3]
manualcrank has joined #lisp
analogue has joined #lisp
fragamus has quit [Ping timeout: 265 seconds]
kajo has joined #lisp
LiamH has quit [Quit: Leaving.]
LiamH has joined #lisp
EvW has quit [Ping timeout: 264 seconds]
lxbarbosa has joined #lisp
asdf_asdf_asdf has quit [Quit: asdf_asdf_asdf]
ironbutt has joined #lisp
kajo has quit [Ping timeout: 252 seconds]
raghavgururajan has joined #lisp
<Xach>
i used epoll directly with sb-alien for a project and it was handy.
<Xach>
i used it to do async dns and async http to have bounded response times for a web app.
kajo has joined #lisp
Inline has joined #lisp
raghavgururajan has quit [Remote host closed the connection]
<ralt>
varjag: let me know if it still works
<ralt>
Xach: yes, that's my point, a custom single threaded one is fairly straightforward once you have epoll
<Xach>
ralt: and http/dns protocol processors :)
<ralt>
note that DNS is a rabbit hole because linux is, well... conventional?
<ralt>
like all this stuff with /etc/hosts etc
<Xach>
i cheated and didn't use the system resolver, just parsed resolv.conf and did direct networking myself. which does not work in all situations but did for me.
Kundry_Wag has joined #lisp
<ralt>
fair enough
fragamus has joined #lisp
Kundry_Wag has quit [Client Quit]
<varjag>
ralt: it attempts to on ccl/arm32 at least
<varjag>
ralt: that's why i didn't feel like groveling
<thijso>
what exactly is grovelling?
<dlowe>
parsing a C file to extract its contents for use in a foreign interface
<thijso>
Ah, ok, thanks, dlowe
<dlowe>
I have no idea how this got called grovelling - maybe it's basically a form of giving up and begging other languages to do things
eSVG has joined #lisp
<dlowe>
it's never a very clean process
Bike has quit [Ping timeout: 260 seconds]
Bike has joined #lisp
isBEKaml has quit [Quit: leaving]
dale_ has joined #lisp
dale_ is now known as dale
sunwukong has joined #lisp
hiroaki has quit [Ping timeout: 264 seconds]
jprajzne has quit [Quit: Leaving.]
jgcarvalho has joined #lisp
FreeBirdLjj has joined #lisp
mindCrime_ has quit [Ping timeout: 268 seconds]
jao has joined #lisp
milanj has joined #lisp
jao is now known as Guest92228
smazga has joined #lisp
nika has joined #lisp
BooAA has joined #lisp
eSVG has quit [Ping timeout: 250 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
fragamus has quit [Ping timeout: 246 seconds]
rippa has joined #lisp
Guest92228 has quit [Remote host closed the connection]
jao- has joined #lisp
cosimone has joined #lisp
superkumasan has joined #lisp
papachan has joined #lisp
yoeljacobsen has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
BooAA has quit [Remote host closed the connection]
xkapastel has quit [Quit: Connection closed for inactivity]
EvW1 has joined #lisp
raghavgururajan has joined #lisp
davr0s_ has joined #lisp
davr0s has joined #lisp
raghavgururajan has quit [Read error: Connection reset by peer]
mindCrime has joined #lisp
sunwukong has quit [Remote host closed the connection]
EvW1 has quit [Ping timeout: 250 seconds]
EvW has joined #lisp
smazga has quit [Quit: Lost terminal]
lxbarbosa has quit [Remote host closed the connection]
lxbarbosa has joined #lisp
vaporatorius has joined #lisp
lxbarbosa has quit [Remote host closed the connection]
elinow has quit [Read error: Connection reset by peer]
Oladon_work has joined #lisp
flamebeard has quit []
smazga has joined #lisp
fragamus has joined #lisp
analogue has quit [Quit: Leaving]
fragamus has quit [Ping timeout: 265 seconds]
hiroaki has joined #lisp
<beach>
Here is another question: Suppose we have a dynamic environment with entries C1 B C2 U, where C1 and C2 are CATCH entries with the same tag (say C), B is a BLOCK entry and U is an UNWIND-PROTECT entry. C1 is the oldest and U is the most recent. Now we do a RETURN-FROM B. So C2 is "abandoned". Then we run the cleanup forms in U. Suppose that U does a (THROW C). Is this operation invalid because C2 has been "abandoned", or is C1
<beach>
going to be a valid target for the THROW?
<beach>
I'll let you come up with some Common Lisp code that does that. It is not hard.
Denommus has joined #lisp
<beach>
(catch 'c (block b (catch 'c (unwind-protect (return-from b) (throw 'c (values)))))) or something like that.
<Bike>
that's kind of horrible. i... think it would throw to C1, though.
<beach>
Oh, it is definitely horrible.
<Bike>
the clhs page for throw says it goes to "the most recent outstanding catch". I think interpreting "outstanding" to mean "not abandoned" is reasonable, and there's nothing to force the abandonment of C1, which is not an intervening exit point
<Bike>
also "the cleanup clauses of an unwind-protect see the same dynamic bindings of variables and catch tags as were visible when the unwind-protect was entered" in 5.2.
<Bike>
...well, i guess that kind of contradicts the intervening points invalidated thing, doesn't it
<beach>
I am wondering whether this is the exact example shown in the THROW dictionary entry.
<beach>
I need to study it a bit more.
carenz has joined #lisp
<Bike>
which one?
<beach>
Nah. The (catch 'foo ...) one
<Bike>
No in that case the initial throw is to the same catch that the second throw ends up in - invalidation isn't relevant. i think.
<Bike>
the outer catch isn't hit at all
<beach>
Yeah.
<beach>
Not the same.
EvW has quit [Remote host closed the connection]
EvW has joined #lisp
carenz has quit [Client Quit]
<Bike>
i still don't really get the point of the "intervening exit points are invalidated" thing. the committee issue makes it seem like the point was to make it easier for implementations but that doesn't seem to actually be true
Duuqnd has joined #lisp
hhdave has quit [Quit: hhdave]
scymtym has quit [Ping timeout: 250 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
FreeBirdLjj has quit [Remote host closed the connection]
jazzslag has quit [Quit: Leaving]
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.2)]
<beach>
Bike: I think that it will be harder for some implementations with their chosen strategy. But then, they let the implementation choose by making it undefined behavior.
lxbarbosa has joined #lisp
orivej has joined #lisp
* beach
vanishes in order to fix dinner for his (admittedly small) family.
matijja has joined #lisp
EvW has quit [Ping timeout: 264 seconds]
prite has quit [Ping timeout: 265 seconds]
varjag has joined #lisp
hiroaki has quit [Remote host closed the connection]
yoeljacobsen has quit [Ping timeout: 245 seconds]
hiroaki has joined #lisp
proto has joined #lisp
<proto>
Hello
gabiruh has joined #lisp
hiroaki has quit [Remote host closed the connection]
<proto>
I can't figure out what makes functional programming better or even worth to use, rather than imperative programming. Functional programming restricts and establishes some guarantees, but this could easily be established with imperative programming languages as well.
hiroaki has joined #lisp
<dlowe>
that's great but common lisp isn't a functional programming language
<dlowe>
maybe you meant to go to #haskell?
<proto>
dlowe: oh?
<dlowe>
it's functional in that functions are first class objects, but it has iteration and global variables and stuff
<dlowe>
and, of course, you can use a functional paradigm if you want
<edgar-rft>
...and you can write imperative Common Lisp code, too
<proto>
but functional paradigm can be applied in C as well
<proto>
so why all the hassle?
karlosz has joined #lisp
<dlowe>
it's a way to manage complexity and cognitive load
<edgar-rft>
because in Common Lisp you can *combine* imperative, functional, OOP. whatever style in *one* program
<dlowe>
pure functions are also super easy to write tests for
<proto>
in C, you cannot write pure functions?
<shka_>
you can, in theory
<proto>
I think you can in practice as well
<dlowe>
You can, but the fact that you might screw it up means that your cognitive load is not reduced so much
<shka_>
but oh my god, writing large systems this way is impractical and i don't think i know anyone that does that
<proto>
so how difficult can it be? You just don't mutate stuff
<dlowe>
can you guarantee that every function you call *also* doesn't mutate stuff?
<proto>
of course
<shka_>
proto: functional programming without GC as bare minimum is just not practical
<dlowe>
no, you can't in fact guarantee that
<shka_>
closures are a next step required
karlosz has quit [Client Quit]
<shka_>
without those two things i would not even consider writing in functional style
<proto>
shka_: closures are just structs with methods?
<shka_>
proto: try passing void* as explicit closure every time and you will quickly loose your mind
karlosz has joined #lisp
<shka_>
also, you can't just (lambda (x) (+ x y)), you will have to define function elsewhere, and then the state, and then initialize the state…
<shka_>
not fun
<shka_>
so yeah, in theory you can say that it is possible to write functional C
<shka_>
in practice, nobody does that
<shka_>
because it generates more hassle to manage then abstracts away
<proto>
shka_: is closures so important?
<proto>
are*
Josh_2 has joined #lisp
<shka_>
yeah, i would say so
<proto>
shka_: give me the simplest example of a closure, and why they are far superior to a simple struct with methods.
<shka_>
(let ((y 5)) (lambda (x) (+ x y)) as a simplest
<shka_>
as why superior?
<shka_>
i want banana
<shka_>
not a gorilla holding a banana
<proto>
but gorilla is far superior
<proto>
haha
<dlowe>
proto seems to be just wanting an irc fight
<dlowe>
old-school trolling
<shka_>
oh i have a plenty fight in me!
<shka_>
come at me bro
<Bike>
this channel isn't for fights
<shka_>
just kidding, going back to wash my dishes
<shka_>
proto: thing is that your way of thinking is just example of turing tarpit
<proto>
No. I don't that at all. I am just applying doubt to obtain certainty and understanding.
<shka_>
everything is possible, nothing is easy
<shka_>
ok, afk
<proto>
I do not intend to troll*
<dlowe>
it's okay, "trolling" used to mean something less problematic.
<proto>
imho, conciseness is the pro
<proto>
and abstraction
gareppa has joined #lisp
proto has quit [Quit: leaving]
karlosz has quit [Ping timeout: 252 seconds]
gareppa has quit [Client Quit]
gareppa has joined #lisp
notzmv has quit [Ping timeout: 276 seconds]
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #lisp
raghavgururajan has joined #lisp
gareppa has quit [Quit: Leaving]
karlosz has joined #lisp
papachan has quit [Quit: Leaving]
Blukunfando has joined #lisp
karlosz has quit [Quit: karlosz]
nika has quit []
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #lisp
prite has joined #lisp
raghavgururajan has quit [Remote host closed the connection]
bitmapper has joined #lisp
varjag has quit [Ping timeout: 276 seconds]
matijja has quit [Remote host closed the connection]
ralt has quit [Quit: Connection closed for inactivity]
kajo has joined #lisp
scymtym has quit [Ping timeout: 265 seconds]
python476 has joined #lisp
Ricchi has joined #lisp
ggole has quit [Quit: Leaving]
vlatkoB has quit [Remote host closed the connection]
yoeljacobsen has quit [Ping timeout: 264 seconds]
Duuqnd has quit []
serge has quit [Remote host closed the connection]
cosimone has joined #lisp
Bike has quit [Quit: Bike]
gareppa has quit [Quit: Leaving]
shka_ has quit [Ping timeout: 268 seconds]
bitmapper has joined #lisp
gravicappa has quit [Ping timeout: 268 seconds]
Oladon_work has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
amerlyq has quit [Quit: amerlyq]
<jmercouris>
the advantage of a closure? honestly, I find it really rarely comes up in my workflows
<jmercouris>
that could just be a product of how I think though, maybe others find themselves using them much more frequently
<jmercouris>
when I say "rarely", I mean non-trivial usages of them
<jmercouris>
there are those contrived usages that I see occassionally to illustrate how clever they are, but I don't find them applicable oft
fragamus has joined #lisp
nowhere_man has joined #lisp
scymtym has joined #lisp
<Xach>
cl-ppcre uses closures in a nice way to compile its regular expression matchers without using cl:compile.
<LdBeth>
Ahead of time compilation
<LdBeth>
Actually there’s no point avoid call compiler at run time
python476 has quit [Ping timeout: 252 seconds]
<jackdaniel>
jmercouris: (defun start () (let ((app (make-app))) (bt:make-thread (lambda () (loop (poke-a-bear app)))) (run-app app)) ; comes to mind
<jmercouris>
jackdaniel: yeah, but that isn't like a super clever usage of a closure or anything
<jmercouris>
it's straightforward and very useful
<jmercouris>
I'm talking about people that would use it to made a function like "counter" or something that captures a value to know how many times it has been invoked
<jackdaniel>
I thought you've asked about usual workflow usages
<jmercouris>
still not terribly complex, but I've never found myself doing it
<LdBeth>
A good thing of closure is avoid putting things to global while sharing variables
<Krystof>
Xach: wow, that phrase brings back memories
<jmercouris>
Xach: yeah, but does it generate NFAs?
shka_ has joined #lisp
<jmercouris>
just to be clear, I'm making a joke here, I'm sure cl-ppcre makes a good usage of closures
<jmercouris>
we actually use them in Next quite a bit, specifically for candidate completion, we often build closures that capture some state and complete upon it in the minibuffer
<jmercouris>
to avoid continuosly polling whatever state we are completing against with every keypress
<jmercouris>
that makes the candidates stale of course, but the program much more responsive
ralt has joined #lisp
<aeth>
A closure is the only way to get true encapsulation in CL afaik... but you rarely need that.
<jmercouris>
closure oriented programming ;)
<jmercouris>
I guess if all of your objects were encapsulated in closures or something, you could have true OO in CL
<aeth>
I tend to prefer to have an explicit state argument to a function passed in as a higher order function over making a closure. I can see why you'd want to do it the other way because it makes the API cleaner, but it also makes it, well, less transparent each step.
<jackdaniel>
you can't implement OO with closures but that will be probably inefficient
<jackdaniel>
that said, doesn't CL have "true OO" - whatever "true" means
<aeth>
jackdaniel: CL isn't C++, therefore it isn't true OO
<jmercouris>
there are some principles of "true" OO, and yes, CL doesn't have them
<jackdaniel>
could you elaborate on these "principles"?
<aeth>
An OOP definition is basically "choose 4 of these 15 things from the list and turn it into your OOP definition"
<jmercouris>
"programming concept that binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse"
<jmercouris>
it's very clear that CL doesn't make this guarantee, like for example private in java, which does
<aeth>
You can encapsulate slots in CL in two ways... one, you can make the slot name a symbol like %foo and not export the symbol... if you trust your users
<jmercouris>
or do I mean protected?
<jmercouris>
I get confused all the time
<aeth>
two, you can gensym the slot name, if you don't trust your users
<aeth>
So I guess there's more than just closures
<jmercouris>
aeth: but can you not query an object for all of its slots
<jmercouris>
and then use slot-value to get the values?
<aeth>
jmercouris: MOP isn't standard, and even if that's the case, you can probably override the MOP in your metaclass to protect them!
<jmercouris>
well... fair enough :D
<jmercouris>
this is too far out my depth now
akoana has joined #lisp
<aeth>
At that point I'd consider it similar to using the debugger, though!
<jmercouris>
introspection is a lot like using the debugger
<jackdaniel>
I read it: so you can use functions to manipulate data without accessing it, not that you enforce lack of such access. that said I think that there was a very good post by Erik Naggum explaining why you are wrong with this "trueness"
<aeth>
(On the other hand, closure encapsulation might be safe from the debugger if (debug 3) isn't the current optimization level, because the private variables might be optimized away.)
<jmercouris>
I've always felt like introspection magic is dangeorus
<jmercouris>
s/dangeorus/dangerous
<jackdaniel>
either way I don't see how CL does not provide encapsulation with accessors
<jmercouris>
jackdaniel: well, there is no official governing authority on what is OO and what is not, I'm sure there is quite some debate
<aeth>
I'd personally consider defclass encapsulation using a slot definition like (%foo :accessor foo :initform 42) to be an acceptable encapsulation... at least for the user. The MOP and a few other things make things too dynamic for the compiler or interpreter
<jmercouris>
it doesn't provide encapsulation because you can always violate the encapsulation
<jmercouris>
it doesn't say "encourages", it says "prevents"
<aeth>
jmercouris: A definition that excludes Python, an extremely OOP language, is imo too strict. I think in Python you just make things private via names, like __foo__ or something
<aeth>
oh, just __foo
<jmercouris>
classes and OO in Python feel like a total afterthought
<aeth>
Even Wikipedia uses that Python example in its article
<jackdaniel>
also, it seems that the person writing this wiki entry indeed thinks that OO = C++
<jmercouris>
I would say the most OO'ish language I know is Java
<jmercouris>
however the lack of multiple inheritance, and having to use protocols instead, a bit of a bummer
<aeth>
Python is one of the most OOP languages out there.
<jmercouris>
s/protocols/interfaces to use the java terminology
<jmercouris>
I don't konw, Python is most probably a procedural lang that had OO bolted on
<aeth>
Java has things that violate its own OOP purism like having a separate 'int' type from 'Integer'
<jmercouris>
Yeah, primitive types are a crime in Java, however, performance...
<aeth>
You also don't have to force everything to live with a class to use OOP heavily, as both Python and C++ show
<jmercouris>
creating objects in Java is very expensive
<jmercouris>
at least in the current JVM implementations
<aeth>
jmercouris: Common Lisp has integer without harming performance, and is sometimes better than Java here
<jmercouris>
yeah I think object creation has a much lower cost in CL
<jmercouris>
method calling on the other hand, not so
<aeth>
well, fixnum is a subclass of integer, and can be handled as a special case without really existing as an "object" instance except when you do things like (class-of 42)
<aeth>
(or define methods)
<aeth>
So CL did find a way to have integers without an int vs. Integer divide
<aeth>
jmercouris: Method calling in CL is expensive because CL is (mostly) dynamically typed, so it can't optimize the call at compilation time, except perhaps if you add type declarations (although that's rare enough that I doubt that's optimized in most cases in most implementations)
<jackdaniel>
description on the wiki page of OO reminds me people confusing weak and dynamic typing
nanoz has quit [Ping timeout: 276 seconds]
<jmercouris>
you could edit it if you really disagree, however you'll have to provide literature...
<jmercouris>
for what it's worth, my textbooks are inline with the Wiki description
asdf_asdf_asdf has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jmercouris>
ah, message passing, good times in Objective-C
Ven`` has joined #lisp
<jackdaniel>
I could but I won't ;) all I'm saying is that I'd be careful with definite claims about "true" <whatever>
Ven`` has quit [Client Quit]
<jmercouris>
what's the point of defgeneric?
<jmercouris>
since if you don't use it, they are implicitly created anyways
<jackdaniel>
for one you may create a generic function with different metaclass
<jmercouris>
can you please provide a scenario in which one would wish to do that?
<aeth>
An object oriented programming language is only object oriented if and only if it has a metaobject protocol[1], thus making Common Lisp and Perl rare examples of object oriented programming languages. [1] source: my blog
<aeth>
time to edit Wikipedia...
<jmercouris>
aeth: lol
<jackdaniel>
i.e when I want to encapsulate (ha ha) some state in a function object
<jmercouris>
ah, :)
<jmercouris>
I'm going to sleep now, interesting conversation, goodnight
<jmercouris>
also I read the article, doesn't mention encapsulation :P
<jmercouris>
it is however a different definition of OO and says "object system" at the end
<jmercouris>
so there is that
raghavgururajan has joined #lisp
jmercouris has quit [Remote host closed the connection]
<jackdaniel>
I'm cure I've said (paraphrasing): you are wrong about that encapsulation defines trueness
<jackdaniel>
s/cure/sure/
<jackdaniel>
not that this mail treats about encapsulation
<aeth>
Anyway, encapsulation depends on the language local conventions if there isn't a "private" keyword or similar. In Python, it is good enough to do __foo for a private member. In CL, a private slot name is just %foo if %foo is not exported in the package. Pretty simple and straightforward.
<jackdaniel>
good night
<aeth>
I don't think that that is particularly controversial, although a C++ or Java programmer might dispute it
<jackdaniel>
aeth: one could even claim, that slot names are implementation details and using slot-value is in bad taste
mindCrime_ has quit [Ping timeout: 265 seconds]
<jackdaniel>
(not to mention, such name may not be exported from a package)
<aeth>
jackdaniel: I do, but I make that claim by making all of my slot names %foo style. Anything that isn't is an old-style defclass of mine and essentially a bug.
shka_ has quit [Ping timeout: 246 seconds]
<jackdaniel>
sure, %foo makes sense. also adding accessors with name %whatever to bypass "official" protocols with all auxiliary methods
<aeth>
jackdaniel: I sometimes do things like (%foo :accessor %foo :reader foo :initform 42) where %foo is the "internal" reader/writer (easier to have two readers than having a writer with a different name than the reader)
<aeth>
I find that that's better than even using slot-value at all internally
<jackdaniel>
I tend to agree
<jackdaniel>
I'm going to bed too, good night \o
<aeth>
good night
ebrasca has quit [Remote host closed the connection]
ebrasca has joined #lisp
adip has joined #lisp
fragamus has quit [Ping timeout: 250 seconds]
raghavgururajan has quit [Remote host closed the connection]
fragamus has joined #lisp
18WAAGH54 has joined #lisp
hiroaki has quit [Ping timeout: 250 seconds]
hiroaki has joined #lisp
jonatack has quit [Ping timeout: 265 seconds]
jonatack has joined #lisp
ljavorsk has joined #lisp
buffergn0me has left #lisp ["ERC (IRC client for Emacs 26.1)"]
varjag has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 246 seconds]
xrash has quit [Read error: Connection reset by peer]
grumble has quit [Quit: Whose thought XML was a good idea in the first place?]
grumble has joined #lisp
anewuser has joined #lisp
caltelt has joined #lisp
Bike has joined #lisp
ljavorsk has quit [Ping timeout: 268 seconds]
18WAAGH54 has quit [Quit: 18WAAGH54]
LiamH has quit [Quit: Leaving.]
ym has quit [Ping timeout: 265 seconds]
Denommus has quit [Remote host closed the connection]
EvW1 has quit [Ping timeout: 264 seconds]
fragamus has quit [Ping timeout: 252 seconds]
adip has quit [Ping timeout: 240 seconds]
niceplace has quit [Read error: Connection reset by peer]
niceplace has joined #lisp
anewuser has quit [Ping timeout: 246 seconds]
fragamus has joined #lisp
ltriant has joined #lisp
lnostdal has joined #lisp
jasom has quit [Ping timeout: 245 seconds]
asarch has joined #lisp
DGASAU has quit [Read error: Connection reset by peer]
notzmv has joined #lisp
jasom has joined #lisp
notzmv is now known as Guest87812
<asarch>
Any text conversor from UTF-8 to ISO-8859-1?