deng_cn has quit [Read error: Connection reset by peer]
deng_cn has joined #lisp
DataLinkDroid has joined #lisp
DataLinkDroid has quit [Client Quit]
smokeink has joined #lisp
zbir```` has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
Karl_Dscc has joined #lisp
BlueRavenGT has quit [Ping timeout: 256 seconds]
asarch has joined #lisp
<beach>
Good morning everyone!
orivej has quit [Ping timeout: 264 seconds]
<asarch>
Bonjour monsieur Beach, comment allez-vous? :-)
<beach>
I am fine thanks, but that's off topic. :)
<beach>
I am still very pleased with the blazing fast incremental parser we now have for Second Climacs.
<asarch>
That's great!
<beach>
Yeah. And it again shows that the right data structure (even without any low-level optimization) beats a mediocre data structure with lots of micro optimization.
<beach>
Perhaps this is a good time to point out that it is pure Common Lisp. No FFI involved.
Bike has quit [Quit: Lost terminal]
<asarch>
Do you have some kind of RFC's for that?
<asarch>
Drafts about the next to implement in CL?
<beach>
Yes, I know what an RFC is. But I don't know what subject you are interested in. Incremental parsing? Second Climacs? Using good data structure? Not using FFI?
<asarch>
I mean, the new technology that will eventually available in CL
<beach>
There is no new technology here.
<beach>
Only the implementation in pure Common Lisp of a particular data structure.
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<asarch>
Oh :-(
<beach>
Nothing to add to Common Lisp.
<asarch>
I thought there was a centralized place where someone could send "suggestions" about a specif topic and then eventually be part of the standard
<asarch>
Why?
<asarch>
Is it abandoned?
epony has quit [Read error: Connection reset by peer]
epony has joined #lisp
<beach>
That's a different topic entirely.
<beach>
I have a project called WSCL with the purpose of creating a standard with fewer cases of undefined behavior. But the only suggests I take are in that direction. I do not intend to add anything to the language.
fikka has joined #lisp
dented42 has joined #lisp
wxie has quit [Remote host closed the connection]
wxie has joined #lisp
Karl_Dscc has quit [Remote host closed the connection]
ebzzry_ has quit [Ping timeout: 240 seconds]
vtomole has joined #lisp
<asarch>
I see
smokeink has quit [Remote host closed the connection]
nullman has quit [Ping timeout: 256 seconds]
nullman has joined #lisp
Guest80386 has quit [Ping timeout: 246 seconds]
fourier has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
fikka has joined #lisp
FreeBirdLjj has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 264 seconds]
SaganMan has joined #lisp
<SaganMan>
Morning peeps
<SaganMan>
Happy Weekend!
damke has joined #lisp
fourier has quit [Remote host closed the connection]
damke_ has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
<beach>
I am not sure how we should address the concerns of some of these referees. The editor that is mostly used for Common Lisp code is Emacs. When it parses Common Lisp code, it does not take into account the readtable, the package, the role of an expression, or anything like that.
siraben has quit [Ping timeout: 240 seconds]
<beach>
Our incremental parser does a much better job. But then the referees worry about what happens when there is a form in the buffer that changes the readtable, so that the wrong readtable might be used for the rest of the buffer. So essentially they are criticizing us for not solving the halting problem at typing speed, whereas apparently what Emacs does is acceptable.
FreeBirdLjj has joined #lisp
shka_ has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Sick_Life has joined #lisp
fikka has joined #lisp
arpunk` has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 240 seconds]
tempestnox has quit [Quit: WeeChat 1.6]
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
pootler has joined #lisp
wigust has joined #lisp
jdz has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Kevslinger has quit [Quit: Connection closed for inactivity]
smokeink has joined #lisp
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has joined #lisp
pootler has quit [Ping timeout: 264 seconds]
dented42 has joined #lisp
dented42 has quit [Client Quit]
fikka has quit [Ping timeout: 240 seconds]
asarch has quit [Quit: Leaving]
fikka has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
tomlukeywood has joined #lisp
yaewa has joined #lisp
moei has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
fikka has joined #lisp
moei has joined #lisp
siraben has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
yaewa has quit [Ping timeout: 276 seconds]
mareskeg has quit [Quit: mareskeg]
siraben has quit [Quit: ERC (IRC client for Emacs 26.0.91)]
DataLinkDroid has joined #lisp
Satou has joined #lisp
safe has quit [Read error: Connection reset by peer]
fikka has joined #lisp
<myrkraverk>
what referees is beach talking about?
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shrdlu68 has joined #lisp
fikka has joined #lisp
tomlukeywood has quit [Quit: tomlukeywood]
milanj has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
shka_ has quit [Ping timeout: 256 seconds]
holycow has quit [Quit: Lost terminal]
fikka has joined #lisp
_paul0 has joined #lisp
paul0 has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
Satou has quit [Quit: Cya soon guys!]
DataLinkDroid has joined #lisp
deng_cn1 has joined #lisp
deng_cn has quit [Ping timeout: 264 seconds]
deng_cn1 is now known as deng_cn
fikka has joined #lisp
pierpa_ has joined #lisp
pierpa has quit [Ping timeout: 260 seconds]
pierpa_ is now known as pierpa
fikka has quit [Ping timeout: 276 seconds]
pjb has joined #lisp
siraben has joined #lisp
random-nick has quit [Remote host closed the connection]
siraben has quit [Remote host closed the connection]
pierpa has quit [Ping timeout: 260 seconds]
wxie has joined #lisp
random-nick has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
Quetzal2 has joined #lisp
pyx has joined #lisp
pyx has quit [Client Quit]
shrdlu68 has quit [Ping timeout: 240 seconds]
rann has quit []
rann has joined #lisp
Quetzal2 has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
wxie has quit [Quit: Bye.]
<phoe>
beach: "we at least handle the readtables, as compared to emacs"
pierpa has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
damke_ has quit [Read error: Connection reset by peer]
chatchatt has joined #lisp
chatchat1 has quit [Ping timeout: 240 seconds]
vtomole has quit [Ping timeout: 260 seconds]
<pierpa>
Anyone knows what the lisp machine editor does wrt non-default readtables? Like emacs or better? (I have the manuals, but not at arm's reach. I will check them later)
damke_ has joined #lisp
Louge has joined #lisp
Quetzal2 has joined #lisp
zch has joined #lisp
<beach>
phoe: Yeah. I'll think of something to write. Right now I am still amused.
<beach>
pierpa: I would be interested in that information.
<beach>
Interestingly, no referee thought this information had to be included.
pierpa_ has joined #lisp
shrdlu68 has joined #lisp
pierpa has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
<phoe>
beach: well, you can do your research now. See how LM editors did in these cases.
Quetzal2 has quit [Remote host closed the connection]
Quetzal2 has joined #lisp
Karl_Dscc has joined #lisp
<phoe>
Anyway, you're fine to say that you won't handle that case. No one previously seemed to solve the halting problem at typing speed, so at least your solution doesn't worsen the situation.
Ven`` has joined #lisp
Louge has quit [Quit: Louge]
fikka has joined #lisp
DataLinkDroid has quit [Quit: Ex-Chat]
<_death>
(defun haltp (program) (y-or-n-p "Here is ~S; Does it halt?" program))
shrdlu68 has quit [Ping timeout: 263 seconds]
<pjb>
(incf _death)
<pjb>
this is the future: collaboration between AI and HI.
mareskeg has joined #lisp
<Shinmera>
I mean, for sufficiently easy programs the computer can answer that question just as well as a human.
<Shinmera>
For sufficiently complex ones I don't know if either can :)
<pjb>
Shinmera: anyways, it's not the right question to ask. The remaining universe life is only 15 billion years.
<pjb>
The right question to ask, for programmers, is whether the program finishes in time for the customer to pay us.
fikka has quit [Ping timeout: 264 seconds]
<pjb>
Do haltp is useless. with-timeout is useful.
<pjb>
s/Do/So/
Ven`` has quit [Read error: Connection reset by peer]
<_death>
many times the customer is interested in programs that never halt
<pjb>
Indeed. And the funny thing is that those programs don't implement an algorithm, but a process :-)
<pjb>
Algorithms must finish.
disumu has joined #lisp
Ven`` has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
damke_ has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
dddddd has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
damke_ has joined #lisp
pagnol_ has joined #lisp
d4ryus1 is now known as d4ryus
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Naergon has joined #lisp
markong has joined #lisp
tomlukeywood has joined #lisp
TCZ has joined #lisp
kotrcka has joined #lisp
scymtym has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
pjb has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Intensity has quit [Ping timeout: 260 seconds]
gabiruh_ has joined #lisp
pjb has joined #lisp
gabiruh has quit [Ping timeout: 264 seconds]
Intensity has joined #lisp
<pierpa_>
beach: the Zmacs manual does not mention anywhere read-tables, and ignores completely the topic of editing non-standard syntaxes. In this respect it appears to offer about the same functionality as emacs.
tomlukeywood has quit [Quit: tomlukeywood]
<beach>
Thanks. I am not that surprised actually. Good to know though.
<pierpa_>
(Genera 7.0, July 1986)
shka_ has joined #lisp
tomlukeywood has joined #lisp
tomlukeywood has quit [Quit: tomlukeywood]
Bike has joined #lisp
pacon has quit [Ping timeout: 268 seconds]
damke_ has quit [Read error: Connection reset by peer]
damke_ has joined #lisp
pacon has joined #lisp
Satou has joined #lisp
TCZ has quit [Quit: Leaving]
milanj has joined #lisp
scymtym has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
TCZ has joined #lisp
didi has joined #lisp
trocado has joined #lisp
nowhere_man has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
<didi>
I just noticed that /topic claims SBCL is on 1.4.0, but the latest version is 1.4.5.
<Xach>
It seems likely that the url in the request is wrong, but maybe there's some other way forward
<phoe>
it seems Shinmera did not move the project over to the Shirakumo github organization
nowhere_man has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
TCZ has joined #lisp
* Xach
will wait and see
TCZ has quit [Client Quit]
trocado has quit [Ping timeout: 248 seconds]
nowhere_man has quit [Ping timeout: 246 seconds]
random-nick has quit [Remote host closed the connection]
Sick_Life has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
<jeosol>
Got this error with SBCL: " run-program error processing :output argument: couldn't duplicate file descriptor: Too many open files". Any one has idea of what the maximum number of open file ?
FreeBirdLjj has quit [Remote host closed the connection]
random-nick has joined #lisp
FreeBirdLjj has joined #lisp
<jackdaniel>
jeosol: this is per-process limitation
<jackdaniel>
you may set it with ulimit
<jackdaniel>
(nothing sbcl-specific)
fikka has quit [Ping timeout: 240 seconds]
<jeosol>
Thanks jackdaniel. I get that error when running parallel code with each thread opening files, etc. With serial, no problems.
<jeosol>
how to set it with ulimit? is there somewhere I can more info about this?
<jackdaniel>
there is a limit of how many descriptors process may have opened
<jackdaniel>
I bet typing ulimit file descriptor limit in your favourite search engine will yield something
fikka has joined #lisp
oleo has joined #lisp
<jeosol>
Merci @jackdaniel
dddddd has quit [Ping timeout: 260 seconds]
dddddd has joined #lisp
<jackdaniel>
proszę @jeosol ,-)
quazimodo has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
smokeink has quit [Remote host closed the connection]
disumu has left #lisp ["..."]
Arcaelyx has joined #lisp
fikka has joined #lisp
<jeosol>
You guys are the man. I get stuff resolved quickly here. I tried comp.lang.lisp but some folks seem to be posting troll/crap messages there lately
<phoe>
jeosol: for some broad definition of "lately"
<pierpa_>
cll stopped being useful many years ago
<jeosol>
It's been a while I have been there. I set google alert to daily just to see what's up. Early on in my project, I have gotten many problems resolved there, and I am grateful for those inputs
DVSSA has joined #lisp
<jeosol>
I see some things about politics, drug adverts, some posts in arabic, etc
<phoe>
and gavino shitposts
<jeosol>
yeah, who is that dude by the way
<jeosol>
posts about oracle cancer, lisp startups, etc
<jeosol>
I don't get it
<jeosol>
I guess I am not in the loop regarding some things.
<pierpa_>
self-regulation has not worked out for usenet
<jeosol>
@jackdaniel, found in my system, some file stream not getting closed.
<scymtym>
how is the case of exponent markers determined when printing floats? i cannot find anything conclusive in the spec
<jackdaniel>
usually it is best to have file operations wrapped in with-open-file (instead of calling open/close manually)
<jeosol>
That is true @jackdaniel, I use that mostly. There is functionality I added, where I have to pass a stream somewhere, forgot to clean up the code properly
<scymtym>
i also wonder whether *PRINT-CASE* plays a role in this
nowhere_man has joined #lisp
EvW has joined #lisp
<jackdaniel>
I think it is just used to indicate the letter, not its case. Similar (but reverse) to how symbol names are printed in the spec (i.e lowercase while in fact they are upcase)
chatchat1 has joined #lisp
chatchatt has quit [Ping timeout: 240 seconds]
<jackdaniel>
n the spec (i.e lowercase while in fact they are upcase)
<jackdaniel>
sorry, touchpad glitch
FreeBirdLjj has joined #lisp
<scymtym>
could be. i guess portable code be prepared to handle both cases, thanks
<scymtym>
sadly, this makes the printer less useful for interfacing with other software when it comes to floats
damke has joined #lisp
<pierpa_>
are there softwares which require a particular case for floats?
<scymtym>
i guess one could use e.g. (format nil "~(~E~)" FLOAT) for that
damke_ has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Ping timeout: 264 seconds]
<scymtym>
pierpa_: i think i had this problem once, but i can't remember now
<makomo>
pjb: i dug up this old thread https://groups.google.com/forum/#!topic/comp.lang.lisp/iLo1ti6rQIw where you conclude that DEFVAR doesn't really define anything because the definition of "to define" according to CLHS is to "create a binding in a namespace"
FreeBirdLjj has joined #lisp
<phoe>
pjb: DEFVAR without a second argument just proclaims a symbol as special
<makomo>
right, i was just about to add that
<makomo>
it is important that there is no second argument
<Bike>
so, what is the operational effect of this distinction
<makomo>
however, if you evaluate (describe 'defvar) in SBCL for example it says "Define a special variable at top level."
<makomo>
that's the first sentence at least
<makomo>
but this isn't always true, right?
<makomo>
if you ommit the initial value, DEFVAR doesn't define anything (using "define" according to CLHS), it only makes the symbol special
raynold has quit [Quit: Connection closed for inactivity]
<makomo>
omit*
<jackdaniel>
Bike: amusement leading to astonishment - as we all know this is critical to stay focused on not doing useful things ;-)
* Bike
nods sagely
<makomo>
:-)
<pjb>
makomo: trying to define the formal semantics of CL…
FreeBirdLjj has quit [Ping timeout: 265 seconds]
<pjb>
notice that even with a second argument, if the variable is already bound, it create a binding either.
Satou has quit [Quit: Cya soon guys!]
fikka has quit [Ping timeout: 264 seconds]
<makomo>
is there a "doesn't" missing?
thodg has joined #lisp
<makomo>
if the variable is already bound, then by definition a binding already exists
<makomo>
DEFVAR wouldn't create a binding in that case because it already exists
<pjb>
makomo: indeed, +doesn't
<makomo>
good, i think it's clear to me now :-)
<pjb>
makomo: indeed, contrarily to eg. LET: (let (x) (let (x) #| this creates a new binding! |#))
<makomo>
right, and in both cases it binds it to NIL
warweasle has joined #lisp
tomsen has joined #lisp
<makomo>
so lisp's usage of "variable" steers away from the "conventional" meaning of "a memory location you can put stuff into"
<Shinmera>
I don't think that's conventional. That's C.
<makomo>
well yeah, put that's something i would call conventional
<makomo>
although i don't really know why, so i put it in quotes lol
<Bike>
and it's still not true of C because C has register variables wheeeee
<makomo>
hah yeah, true, let's call it "simplified C" then :^)
knicklux has joined #lisp
<makomo>
lisp's usage of "variable" refers to the "binding" or just an entry in the lexical/dynamic environment
<Bike>
if anything i'd say it's tricky because lexical and dynamic variables are very different things that happen to have similar syntax.
<makomo>
so the analogue to lisp's "unbound" state in something like C would be almost like "the memory location doesn't exist"
<makomo>
yeah, it is :^(
fikka has joined #lisp
<jackdaniel>
eulisp had specified different syntax for dynamic variables
<Bike>
i've seen other languages with dynamic variables but that use functions
mareskeg has quit [Quit: mareskeg]
<makomo>
welp i better write all of this down before it escapes my mind
<pierpa_>
Any lisp designed after CL has a different syntax for special variables
<Shinmera>
Bike: Curiously enough, JS has dynamic variables. Well, it has exactly one, called `this`, and it leads to lots and lots of confusion.
<Bike>
this? like in methods?
<Bike>
why is it dynamic?
<Shinmera>
Because JS
<phoe>
this.foo() and such things
<Bike>
time for more sage nodding
<makomo>
Shinmera: hmm true, good point
nowhere_man has quit [Ping timeout: 264 seconds]
nowhereman_ has joined #lisp
asarch has joined #lisp
spergatory has joined #lisp
FreeBirdLjj has joined #lisp
mareskeg has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
hhdave has joined #lisp
varjag has joined #lisp
hhdave has quit [Read error: Connection reset by peer]
BitPuffin has joined #lisp
TCZ has joined #lisp
TCZ has quit [Quit: Leaving]
spergatory has quit [Ping timeout: 240 seconds]
spergatory has joined #lisp
fikka has quit [Ping timeout: 263 seconds]
milanj has quit [Quit: This computer has gone to sleep]
Patternmaster has quit [Ping timeout: 264 seconds]
hhdave has joined #lisp
fisxoj has quit [Quit: fisxoj]
asarch has quit [Quit: Leaving]
Oberon4278 has joined #lisp
fisxoj has joined #lisp
roca has joined #lisp
Naergon has quit [Ping timeout: 276 seconds]
fisxoj has quit [Quit: fisxoj]
fikka has joined #lisp
earl-ducaine has quit [Read error: Connection reset by peer]
trocado has joined #lisp
hhdave has quit [Read error: Connection reset by peer]
roca has quit [Quit: roca]
roca has joined #lisp
hhdave has joined #lisp
earl-ducaine has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
roca is now known as lroca
amerlyq has joined #lisp
fikka has joined #lisp
<amerlyq>
hi, what is correct idiom for resource deallocation in CL ? Something akin Python "with", C++ "shared_ptr" ?
lroca has quit [Quit: lroca]
<amerlyq>
Currently I approximate it with Haskell's "DO monad" i.e. (defun resource (unwind-protect (funcall ctor) (funcall dtor)), which is used as (resource (lambda (...) @ctor) (lambda (...) @dtor)), but it's too cumbersome
<makomo>
oh wow, andy wingo, ludovic courtes and sacha chua are going to be at els, interesting!
fikka has quit [Ping timeout: 264 seconds]
<pjb>
amerlyq: use or write a with- macro.
<pjb>
amerlyq: if you write one, use unwind-protect in its expansion.
<Bike>
yeah, when i've translated python 'with' it was like that.
<amerlyq>
pjb: is it your own suggestion or recommended practice? I suppose lisp uses its own wordset for this technique and I couldn't find anything useful in google
<Bike>
unwind protect is to ensure that the resource is deallocated even if the body is exited abnormally. it's important.
<Bike>
with- macros are also common, including in the standard library
<phoe>
WITH-FOO macros usually expand to unwind-protect, anyway.
pjb` has joined #lisp
pjb has quit [Ping timeout: 246 seconds]
<amerlyq>
so, writing "with-" per each resource as macro is preffered way, alright
pierpa_ has quit [Ping timeout: 260 seconds]
<Bike>
you could make a general thing like python's "with" if you wanted, but it would expand similarly for any given resource
disumu has joined #lisp
<amerlyq>
I was looking for some standart "(make-with (type ,type) dtor)" which would produce such "with-*" allocators for me, as resource management is rather common task and I expected it to be in ANSI
hhdave has quit [Quit: hhdave]
<phoe>
amerlyq: allocators? what do you mean?
<Bike>
well, unwind protect is basically specifying the destructor.
<Bike>
dunno what you have in mind as far as types go.
<Bike>
as far as i understand python's with, you define a class that has one method that's called on entry to the with, and one that's called on exit.
<Bike>
so it's pretty much the same deal as unwind protect, but with methods because that's how python rolls.
<phoe>
if you mean C++-style destructors, you don't have these automatically called when a locally defined variable falls out of scope.
<amerlyq>
Bike: About "types" I meant analogy to how "setf" works -- when through (defsetf smth set-smth) you can specify default setf action for "smth" field accessor. So I thought about similar thing for resource to declare ctor/dtor.
<Bike>
ah, i see.
<Bike>
well that basically amounts to instead of having (with-resource ...), you'd have (with resource ...)
<Bike>
which, like i said, is basically doable... but i don't know that anyone's set up a system like that
Sick_Life has joined #lisp
fikka has joined #lisp
<phoe>
hm
<phoe>
I see
<amerlyq>
You know, I come to CL with great deal of idioms from other languages, so my "wants" may be silly in long term, therefore question about "prefferable for CL way" -- before I started reimplementing other languages in CL
<phoe>
you want a generic WITH, or something like that
<random-nick>
you can always write a macro to write with macros
<Bike>
i'm not complaining or anything. it might be useful.
<Bike>
i've never had enough with- macros to want it myself, though.
<Shinmera>
Same
<Bike>
i think people find python's with a bit arcane too.
pierpa has joined #lisp
<amerlyq>
phoe: it's more like I want "root of resource mgmt" whatever it means :) Maybe there is no need to manage resource scope in CL so tightly at all -- simply in my practice "with" in Python allowed to reduce resource scope greatly, which enhanced code comprehension.
<beach>
amerlyq: It depends on the kind of resource you are thinking about.
pagnol_ has quit [Ping timeout: 240 seconds]
<beach>
amerlyq: Certainly, open files are such a resource, which is why Common Lisp has WITH-OPEN-FILE.
<phoe>
if it's database connections, you'll want to have one that's pretty persistent between operations - in that case, store it as a dynamic variable
jmercouris has joined #lisp
<phoe>
if it's "local" resources like open files and such, the canonical way is to use WITH-FOO macros
fikka has quit [Ping timeout: 260 seconds]
DVSSA has quit [Ping timeout: 264 seconds]
<beach>
amerlyq: What kind of resource do you have in mind?
<amerlyq>
beach: different treatment of resources "per resource name" increases complexity, but different treatment "per lifespan" reduces it. E.g. files, sockets, dbconnections, xlib resources -- they may be short term and long term in different contexts.
<amerlyq>
phoe: about global vars -- is it the only way for semi-persistent objects? Is there common pattern for "dependency injection" idiom?
<phoe>
amerlyq: dynamic doesn't essentially mean global, as dynamic vars can be rebound.
comborico1611 has joined #lisp
<Bike>
last time i tried to figure out what dependency injection was it seemed to be, like, passing functions as arguments
<Shinmera>
isn't dependency injection just a really fucking stupid name for passing an object/closure to another object/closure.
<phoe>
amerlyq: what do you mean by "dependency injection"
<jmercouris>
why might someone do (defun |someFunction () ...)?
<Shinmera>
eg in java you pass an object into a constructor, "injecting" the dependency.
<beach>
Who the hell invented that term?
<jmercouris>
s/|someFunction ()/|someFunction| ()
<Bike>
jmercouris: they like lowercase?
<phoe>
java junkies who were dependent on some tough stuff that they injected into themselves - hence dependency injection /s
<beach>
jmercouris: I would guess because they use some FFI that requires the right case.
<jmercouris>
Shinmera: No, dependency injection has other connotations as well
fikka has joined #lisp
<phoe>
but basically you can do it with CLOS/MOP
<jmercouris>
beach: Bike: Ok, that makes a lot of sense now, I was wondering about that. The case is important because these are "method" names for xml-rpc which uses camel case
<beach>
*sigh*
<jmercouris>
beach: why so?
<phoe>
for a simple java @Inject, if you want to look for all concrete subclasses of X that is an "interface" class of yours, you can get that from the Lisp system, and once you have that, you can instantiate one of these subclasses
<beach>
jmercouris: More non-Common-Lisp stuff.
<phoe>
which isn't really the best way to do it, but eh, it would work
<Bike>
jmercouris: just to be clear, || is escape syntax. it means among other things that the characters within won't be automatically upcased like usually happens.
<jmercouris>
Bike: I see, thank you, I seem to remember that now
<jmercouris>
beach: ah, always a good time :)
<Shinmera>
Could also write \s\o\m\ef\u\n\c\t\i\o\n :^)
fikka has quit [Ping timeout: 240 seconds]
<jmercouris>
I'll stick with pipes :D
damke_ has joined #lisp
<amerlyq>
phoe: what I generally meant by "Dependency Injection" for C++/Python/Java is to 1) get rid of global singletons 2) deterministic order of init/deinit (impossible for singletons) 3) allow multiple independent global dependencies (too hard with singleton -> multiton)
<amerlyq>
So, using dynvars is akin to using singletons in my opinion here
<phoe>
amerlyq: 1) is done in Lisp via dynamic vars, 2) is doable because you have explicit control over when you bind dynavars to what, 3) is done with dynavars
fikka has joined #lisp
<Shinmera>
Except it isn't because you can bind them, well, as their name says, dynamically.
<phoe>
yep, exactly this
damke has quit [Ping timeout: 265 seconds]
<Shinmera>
Also singletons are juuuust fine because you can inspect your system wholly at any time.
<amerlyq>
phoe: so re-binding dynvar in lexical scope will propagate it into all nested body calls, right?
<Shinmera>
There is no lexical with dynamic variables. the binding is dynamic, run-time!
<beach>
amerlyq: Well, technically it is not a lexical scope then.
<amerlyq>
Shinmera: alright, I see the point. Dynamic binding is really way to go here. I simply grumble about "hard to track consequences looking in code"
<amerlyq>
Deps-injection may be shitty
<Shinmera>
All those things like singletons aren't a big deal in Lisp because you can inspect your environment
<Shinmera>
You can change it and look at it while it runs.
nowhere_man has joined #lisp
<beach>
amerlyq: I think that you will find that many design patters that are required, in other languages are solved differently in Common Lisp. And CLOS with its generic functions often play an important role here.
<beach>
amerlyq: I had never heard the term "dependency injection" before, and I am guessing that it requires a name just because it is not trivial in most languages.
<Shinmera>
It's needed if you have a particular idea on how to make your code more modular.
<beach>
I see.
<phoe>
The call to DEFVAR proclaimed the symbol *X* as globally special. in other words, all variables named *X* are now dynamic.
<Shinmera>
The idea is that something needs to do some stuff, but you'd like to decouple how that stuff is done, so you give it a parameter that is used to do that stuff with. Thus, "injecting" the "dependency"
<Shinmera>
So for instance you have a generic kind of object to parse things with, and you can pass it another object that knows how to read things.
<amerlyq>
Shinmera: I disentangled many shitty projects in C with global vars and C++ with singletons written in spur of customer bidding. And it's brain-boiling to make them nice when they break from breathing at neighbor's room. So I treat Deps-inject as "nice" -- because it reduces scope of deps and gathers them in single place, right on the spot.
<Shinmera>
It's incredibly basic and most of the time you don't even think about doing it
<Shinmera>
but for some reason it got a name that makes it sound like something huge
nowhereman_ has quit [Ping timeout: 268 seconds]
<beach>
Shinmera: That is also the impression I got from the Wikipedia page.
<beach>
Oh well.
oxo1o1o1o has quit [Ping timeout: 276 seconds]
<Shinmera>
amerlyq: That's nice and all, but this is neither C nor C++
<beach>
It sounds like something a good Common Lisp programmer would do "naturally".
Oladon has joined #lisp
<Shinmera>
When you learn a language you should drop your preconceptions.
<beach>
amerlyq: Is it that you are trying to make a decision as to whether to learn and/or use Common Lisp?
<amerlyq>
I know, so are my questions here were born. Dropping preconceptions is impossible -- after all I think about "what I want to achieve" by combining already known blocks/idioms. I can't combine unknown ones from other languages -- only find analogy and then to drop that analogy in long term after finding new, that lang-specific idiom.
<phoe>
amerlyq: actually "what you want to achieve" is a good question, and you can answer that
<phoe>
what is that you want to code?
<amerlyq>
beach: nope, I simply never written in CL nothing big, forget picolisp scripts.
<phoe>
it'll be hard to learn Lisp without writing Lisp and having it reviewed, so for writing Lisp, you'll need a goal to try and achieve by writing Lisp
<beach>
amerlyq: Then I think the best way is to invest in learning it. Then you will see how your problems can be solved with the features that Common Lisp provides.
Satou has joined #lisp
DVSSA has joined #lisp
<amerlyq>
I started writing WM with external socket controls and resource management was first big problem I encountered when tried to refactor my messy attempts.
<amerlyq>
So, actually, I'm in the process
<jmercouris>
within the defpackage macro there is import-from, is there a way to do something like :export-to? I don't see it anywhere in CLHS on defpackage
Pixel_Outlaw has joined #lisp
<jmercouris>
I am asking because I need to add some symbols to a package that I have not defined
<jmercouris>
if you look in the documentation for s-xml-rpc the following line appears "You can export additional functions from the server by importing symbols in the package contained in *xml-rpc-package* (by default, this is the package S-XML-RPC-EXPORTS). " (https://common-lisp.net/project/s-xml-rpc/)
<phoe>
jmercouris: wait
<phoe>
export *to*?
<jmercouris>
phoe: yes, to
<phoe>
you don't export anything *to* anything
<phoe>
you export symbols out of a package
<phoe>
and you import symbols from a package to another package
<phoe>
you don't export-to, you import-from.
<jmercouris>
how can I add symbols to a package without being *in* the package?
DVSSA has quit [Ping timeout: 240 seconds]
<Shinmera>
intern?
<beach>
jmercouris: That is a very nasty thing to do.
<jmercouris>
and since they've already defined s-xml-rpc-exports, I can't :import-from my own package
<phoe>
these seem like mostly normal defpackages
<pierpa>
jmercouris: what you want is called IMPORT
<amerlyq>
Thanks, phoe, Bike, Shinmera, beach. So, current way to go is to write my own "with-" macros to use inside function scope and dynvars to extend resource scope over multiple functions.
<jmercouris>
pierpa: I'd still have to (use-package :s-xml-rpc-exports) though, correct?
<phoe>
yep, more or less
<phoe>
jmercouris: no, why?
<phoe>
you can import only specific symbols
<phoe>
USEing a package imports everything, as opposed to IMPORTing only specific symbols
<beach>
amerlyq: I can't tell whether that is the way to go. I think you need to learn more about Common Lisp, and then figure out how to use the full language to accomplish what you want.
<jmercouris>
phoe: I meant to say "in-package"
<jmercouris>
sorry about the confusion
<jmercouris>
so something like (in-package :s-xml-rpc-exports) (import ...)
<beach>
jmercouris: That is a very nasty thing to do. You are messing with someone the interface created by someone else.
<beach>
s/someone//
<jmercouris>
beach: Unless I am misunderstanding, the author suggests that to add methods to the server, you have to export symbols to the package
<jmercouris>
"You can export additional functions from the server by importing symbols in the package contained in *xml-rpc-package* (by default, this is the package S-XML-RPC-EXPORTS). (use-package :common-lisp :s-xml-rpc-exports) makes all of Common Lisp available via xml-rpc."
<pierpa>
jmercouris: no. Give s read at the doc for IMPORT, please
<jmercouris>
maybe I am not understanding the meaning of this specific paragraph then
orivej has quit [Ping timeout: 260 seconds]
<beach>
jmercouris: You can define methods on a generic function without writing your code in the package that contains the name of that function.
<jmercouris>
pierpa: aha, I see the optional package, nice
<pierpa>
!
<jmercouris>
beach: there are just some defuns in the package
eazar001 has quit [Quit: WeeChat 2.1]
<jmercouris>
beach: out of curiosity, it is also possible to (defun s-xml-rpc-exports:some-function-name () ...)?
<jmercouris>
seems impossible according to the repl
<phoe>
why impossible?
<pierpa>
To use a:b the symbol must already exist and be ecported
<jmercouris>
complained that the symbol some-function-name was not found in that package
<jackdaniel>
(defun foo::some-funciton-name () ) ; but once again, you pollute someone else's package
<phoe>
yep, that's correct, you need to use ::
<jmercouris>
ah, because it is not exported
mareskeg has quit [Quit: mareskeg]
<phoe>
but unless the author explicitly told you to do that, which is ugly, you should not mess with other people's packages.
<jmercouris>
Yes, the author says that
<jmercouris>
that is how one adds functions to the s-xml-rpc server
<phoe>
:shrug:
<jmercouris>
it is not my design, so please, no more pitchforks :D
<phoe>
oh well, if that is what was intended, then do it
<jmercouris>
I am sure the author thought about it, I probably would have had some sort of (register-end-point) function which accepts a url and a symbol
<jmercouris>
or maybe not a symbol, that is not so smart, but anyways
<phoe>
"go define a function in my package" is a very weird of exposing external interfaces
<jmercouris>
the author has two packages within their system
<phoe>
I'd rather go with "go define a function and push/set it to this dynamic variable whose symbol I export from my package"
<jmercouris>
and one of these packages is dedicated for that
<jackdaniel>
truth to be told imo Common Lisp package abstraction lacks in being intuitive, with supporting plugins, forward references and such
<jackdaniel>
what leads to many confused programmers coming here
<jackdaniel>
also refactoring systems split in many packages is a pain until you get used to it and stop noticing
Patternmaster has joined #lisp
oleo has quit [Quit: Leaving]
milanj has joined #lisp
pierpa_ has joined #lisp
pierpa has quit [Ping timeout: 260 seconds]
Baggers has joined #lisp
oipyvjkt has joined #lisp
fisxoj has joined #lisp
Sick_Life has quit [Ping timeout: 240 seconds]
DVSSA has joined #lisp
<dim>
is there anything at all in CL that would be intuitive?
<dim>
it's all hard learnt knowledge right?
<Shinmera>
intuition is relative to your expectations
<Shinmera>
so if you have the right expectations everything can be intuitive.
DVSSA has quit [Ping timeout: 248 seconds]
fisxoj has quit [Remote host closed the connection]
<jackdaniel>
sophistry once more?
fisxoj has joined #lisp
<Shinmera>
I have never had the intention to deceive anyone in here
<jackdaniel>
dim: well, after wrapping my head around lisp I find many things intuitive, but packages are awkward even when I've gotten well familir with them
<Shinmera>
And frankly am offended by the implication.
<jackdaniel>
well, sorry for that, I'll keep shut next time you come up with "everything is relative" mantra in that case
<Shinmera>
I come up with it because the question is unanswerable without further context.
Kevslinger has joined #lisp
sysfault_ has joined #lisp
<dim>
yeah well some things are quite intuitive in the sense that you can derive them from first principles, like everything is a expression, return values, bindings, then you can do many things
<dim>
but the flexibility of the whole language is still amazing to me
<Shinmera>
For instance, to me it is "intuitive" that numbers turn to bignums, but to someone expecting modular arithmetic it would not be.
<dim>
it's only been something like 6 years I'm using CL now, that said
<dim>
anyway, I should stop picking on those loose topics ;-)
<jmercouris>
jackdaniel: it is a bit confusing yes, I still have trouble because mentally I keep trying to map things to information I have from other languages
<jmercouris>
using prior knowledge is a great way to accelerate learning, normally, but sometimes it can result in "false friends"
<jmercouris>
I can't speak of the rationality of cl packages, because I don't really understand them in a deep sense, but just my 2c
<Shinmera>
CL packages are definitely surprising to a lot of people in that they deal with names rather than bindings.
<Shinmera>
At least we observe such surprise a lot in this channel.
<jmercouris>
I don't want to suggest "dumbing down our conversations", but I think if we all spoke more casually, it might lighten the atmosphere
comborico1611 has quit [Quit: Konversation terminated!]
<dim>
I think the goal of this channel isn't friendly chat so much as helping each other get things done with Common Lisp
<dim>
tho we're mainly friendly people of course, I guess
<jmercouris>
dim: before we stray off topic, one can be friendly and helpful, or unfriendly and helpful
<random-nick>
dim: there's always #lispcafe for chatting
tomlukeywood has quit [Quit: tomlukeywood]
pjb` has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
oipyvjkt is now known as Sick_Life
<pierpa_>
Packages are neither difficult not nonintuitive. The problem is that to most this is a *boring* part of CL, they skip learning how packages work and prefer play by ear
<Xach>
There is a package guide that purports to enlighten but reinforces a "these are dumb and badly made but here's how to understand"
Oddity has quit [Changing host]
Oddity has joined #lisp
<Xach>
Practical Common Lisp is pretty good on the topic though
earl-ducaine has quit [Read error: Connection reset by peer]
scymtym has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<pierpa_>
CL recipes is good too for this
FreeBirdLjj has joined #lisp
earl-ducaine has joined #lisp
fisxoj has quit [Remote host closed the connection]
DVSSA has joined #lisp
<jackdaniel>
just ftr: I don't think they are dumb or badly made
FreeBirdLjj has quit [Ping timeout: 256 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
slyrus has joined #lisp
nowhere_man has joined #lisp
fisxoj has joined #lisp
fisxoj has quit [Remote host closed the connection]
DVSSA has quit [Ping timeout: 240 seconds]
fisxoj has joined #lisp
fisxoj has quit [Remote host closed the connection]
fisxoj has joined #lisp
<pierpa_>
Xach: if you mean the document by RG, then I agree. If it's not that one, then I don't want to know :)
scymtym has joined #lisp
earl-ducaine has quit [Read error: Connection reset by peer]
wigust has quit [Ping timeout: 268 seconds]
<Xach>
I think back to Peter Seibel's observation on a similar topic
earl-ducaine has joined #lisp
<Xach>
That from a "modern" perspective the assumption is that the designers of CL just didn't know any better when they did something that seems imperfect, but his review of contemporary discussions usually showed they knew the "good" options but had to make compromises or other hard decisions. Rarely was something done out of ignorance or lack of discussion.
pagnol_ has joined #lisp
<beach>
That has always been quite evident to me.
<beach>
I can tell, because the pushed the envelope of what the language can do as much as they possibly could while being certain that it could be implemented in an efficient way (as far as it was known at the time).
<Xach>
It helps me understand why some old timers are still mad about when the hard decisions go against their preferences.
damke has joined #lisp
<beach>
Heh.
<Xach>
"uppercase is bad, let's have modern lisp instead"
wigust has joined #lisp
damke_ has quit [Ping timeout: 263 seconds]
DVSSA has joined #lisp
DVSSA has quit [Ping timeout: 268 seconds]
fikka has quit [Ping timeout: 240 seconds]
oleo2 has joined #lisp
oleo2 has quit [Max SendQ exceeded]
nika has quit [Quit: Leaving...]
varjag has quit [Ping timeout: 276 seconds]
fikka has joined #lisp
Satou has quit [Quit: Cya soon guys!]
DVSSA has joined #lisp
makomo has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 264 seconds]
varjag has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
knicklux has quit [Quit: Leaving]
oleo2 has joined #lisp
inoperable has quit [Quit: ZNC 1.6.6 - http://znc.in]
<aeth>
uppercase is bad, let's (setf *print-case* :downcase) and pretend CL is case-insensitive so that works all of the time.
fikka has joined #lisp
makomo has joined #lisp
jmercouris has quit [Ping timeout: 260 seconds]
fikka has quit [Ping timeout: 248 seconds]
oleo has joined #lisp
inoperable has joined #lisp
fikka has joined #lisp
jmercouris has joined #lisp
SamSkulls has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
<stacksmith>
From an old Davey and Goliath episode... Davey: Can you heal my leg, doctor? Doctor: No, Davey, I can set the bone, but only God can heal you.
<phoe>
loginoob: programming logic? what do you mean?
fikka has quit [Ping timeout: 240 seconds]
<stacksmith>
I think loginoob is trying to ask how to play chess after you learn how pieces move...
mgsk has quit [Quit: WeeChat 1.9.1]
tomlukeywood has quit [Quit: tomlukeywood]
Arcaelyx has joined #lisp
oleo2 has joined #lisp
fikka has joined #lisp
<jackdaniel>
loginoob: you should read paradigms of artificial intelligence programming