jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
mrcom has quit [Ping timeout: 265 seconds]
zooey has quit [Remote host closed the connection]
mrcom has joined #lisp
zooey has joined #lisp
<mfiano> Anyone here use the antiquated thing that is structure-object a lot?
<Xach> mfiano: sort of
<mfiano> I am running into some difficulty
<mfiano> I have 2 packages. In package A, I have a structure FOO with 1 slot called BAR. In package B, I have another structure that includes it with (:include a:foo), and this one has a conc-name of nil. When I define the second struct in package B, I get a function redefintion warning, redefining A::BAR and A::(SETF BAR). Is this expected?
* Xach cannot help sorry
<mfiano> Package A doesn't even use conc-name NIL
<mfiano> So unsure how it is created to be redefined...
galex-713 has quit [Ping timeout: 272 seconds]
<Xach> mfiano: i don't think i see the same behavior, but maybe i'm not trying it right. do you have a file i could load to try it?
<mfiano> Xach: I don't have an isolated case, but if you want to try loading my project I'd appreciate any pointers
<Xach> i can try
<mfiano> One sec
cchristiansen has joined #lisp
galex-713 has joined #lisp
<mfiano> Xach: Sent the link to you in private
phireh has joined #lisp
mr-iznogud has joined #lisp
<charles`> For tail call optimization, are the stack frames still supposed to appear in the debugger?
<Xach> charles`: no
<charles`> hmm, I have a recursive function, that I thought was tail call optimization, but it is getting stack overflow (not infinite). How do I go about finding where it can't be optimized.
<charles`> If I have a (let (...) (recur)), that is still optimizable right?
<Alfr> charles`, not if you bind special variables.
hendursa1 has joined #lisp
<Xach> charles`: not sure, sorry. it's not something that always happens in Common Lisp even if it is possible.
<charles`> Alfr, no special binding here, good point though.
hendursaga has quit [Ping timeout: 268 seconds]
<charles`> Xach, is that just because of the lack of labor on the compilers?
<Alfr> charles`, not mandated by the standard. An implementation may choose to never optimize tail calls.
<Xach> charles`: no. it's because sometimes you don't want it. like if you want all the frames to debug.
<Xach> In my experience compilers document when it can be done and what settings to use to do it when possible.
johnjay has quit [Ping timeout: 240 seconds]
<Xach> It is not done unconditionally whenever possible in all circumstances.
<Xach> some compilers do it under the default settings, some do it only under certain compiler settings, and some don't do it under any circumstances.
<charles`> It seems I must unroll it manually
<Xach> charles`: can you share the code?
mrcom has quit [Ping timeout: 265 seconds]
charles` has quit [Ping timeout: 264 seconds]
akoana has left #lisp ["Leaving"]
<Nilby> The CMU compiler manual says, it can't do tail recursion when there is a special binding, catch or unwind-protect, block or tagbody with a go closure, or when debug quality > 2.
hendursaga has joined #lisp
hendursa1 has quit [Ping timeout: 268 seconds]
thijso has quit [Ping timeout: 265 seconds]
fubbiquantz has quit [Ping timeout: 240 seconds]
mrcom has joined #lisp
thijso has joined #lisp
anticrisis has quit [Quit: Leaving]
<Josh_2> jasom: Thanks for the information!
aeth has quit [Ping timeout: 256 seconds]
madage has quit [Remote host closed the connection]
aeth has joined #lisp
madage has joined #lisp
mrcom has quit [Ping timeout: 265 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
mrcom has joined #lisp
semz has quit [Ping timeout: 260 seconds]
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #lisp
pfdietz has joined #lisp
X-Scale has quit [Quit: HydraIRC -> http://www.hydrairc.com <- It'll be on slashdot one day...]
dbotton has quit [Quit: This computer has gone to sleep]
semz has joined #lisp
mrcom has quit [Ping timeout: 265 seconds]
dbotton has joined #lisp
abhixec has joined #lisp
Bourne has joined #lisp
mrcom has joined #lisp
charles` has joined #lisp
Josh_2 has quit [Ping timeout: 264 seconds]
renzhi has quit [Ping timeout: 272 seconds]
dbotton has quit [Quit: Leaving]
phireh has quit [Ping timeout: 240 seconds]
prxq_ has joined #lisp
fubbiquantz has joined #lisp
prxq has quit [Ping timeout: 240 seconds]
charles` has quit [Ping timeout: 264 seconds]
ym has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
zaquest has quit [Remote host closed the connection]
mrcom has quit [Ping timeout: 265 seconds]
zaquest has joined #lisp
rozenglass has joined #lisp
anticrisis has joined #lisp
Guest7312 has joined #lisp
Guest7312 has quit [Client Quit]
mrcom has joined #lisp
pfdietz has quit [Ping timeout: 240 seconds]
ikrabbe has quit [Ping timeout: 256 seconds]
mrcom has quit [Ping timeout: 265 seconds]
<beach> Good morning everyone!
<fubbiquantz> morning
Alfr_ has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
Alfr has quit [Ping timeout: 260 seconds]
ukari has joined #lisp
pillton has quit [Ping timeout: 264 seconds]
holycow has joined #lisp
ym has quit [Ping timeout: 240 seconds]
mrcom has joined #lisp
Nilby has quit [Ping timeout: 264 seconds]
charles` has joined #lisp
karlosz has joined #lisp
mgsk has quit [Ping timeout: 240 seconds]
ffwacom has quit [Read error: Connection reset by peer]
splittist has quit [Read error: Connection reset by peer]
mjl has quit [Read error: Connection reset by peer]
ffwacom has joined #lisp
mjl has joined #lisp
splittist has joined #lisp
mgsk has joined #lisp
theothornhill has joined #lisp
aartaka has joined #lisp
theothornhill has quit [Ping timeout: 256 seconds]
aindilis has quit [Ping timeout: 264 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
pankajsg has joined #lisp
cchristiansen has quit [Ping timeout: 264 seconds]
pillton has joined #lisp
<flip214> jasom: how would I use the bivalent streams to get a ub8 vector in RAM?
ukari has quit [Ping timeout: 240 seconds]
ukari has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 240 seconds]
pillton has quit [Quit: ERC (IRC client for Emacs 27.1)]
toorevitimirp has joined #lisp
johnjay has joined #lisp
seeg12344 has quit [Quit: The Lounge - https://thelounge.chat]
seeg12344 has joined #lisp
thmprover has quit [Quit: ...and miles to go before I sleep.]
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
theothornhill has joined #lisp
theothornhill has quit [Remote host closed the connection]
asarch has joined #lisp
<charles`> can It always be avoided to repeat code in a macro?
<charles`> I want some code to run and conditionally have a destructuring-bind around it
<beach> Use a function to avoid the repetition?
<charles`> but I also am inside a tagbody
<charles`> also If I have a function, the variables defined in the destructuring-bind wouldn't be available in the function
<beach> If the function is defined in the body of the destructuring-bind, they would.
sauvin_ has joined #lisp
<beach> It is hard to give general advice since the solution depends a lot on the exact structure of the code. Maybe you can post your version with repetition, and we can analyze it.
<beach> A macro may be the only reasonable solution.
sauvin has quit [Ping timeout: 265 seconds]
shka_ has joined #lisp
sauvin_ is now known as Sauvin
<beach> Are you referring to the (progn ,@optimized) as the repetition?
<beach> If so, that's repeated only in the generated code, not in the source.
<charles`> yes, that is what I refer to. is that not a big deal?
jprajzne has joined #lisp
ralt has joined #lisp
gioyik has quit [Quit: WeeChat 3.0]
buffergn0me has joined #lisp
<beach> No, and the compiler will regularly duplicate code anyway, in order to speed it up.
heisig has joined #lisp
<beach> Like inlining, loop unrolling, etc.
asarch has quit [Quit: Leaving]
<charles`> Very cool, thanks.
<beach> Sure.
gaqwas has joined #lisp
gaqwas has joined #lisp
<beach> ... and I am still not sure whether you were referring to the repeated source code, or the repeated generated code.
<charles`> I was worried about repeated generated code
<beach> Oh! Yes, then you can totally forget about the issue. :)
iamFIREc1 has joined #lisp
<charles`> I also just realized that I can do my initial destructuring-bind inside the macro-lambda-list
jonatack has joined #lisp
iamFIREc1 has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
ikrabbe has joined #lisp
rgherdt has joined #lisp
theothor` has joined #lisp
theothor` has quit [Ping timeout: 246 seconds]
anticrisis has quit [Read error: Connection reset by peer]
prxq_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
prxq has joined #lisp
iamFIREc1 has joined #lisp
charles` has quit [Ping timeout: 264 seconds]
johnjay has quit [Ping timeout: 272 seconds]
hjudt has joined #lisp
gj has joined #lisp
<gj> hello everyone
<beach> Hello gj.
<gj> oh hi there! i do have a lisp question today.
<beach> Go right ahead.
abhixec has quit [Quit: leaving]
skapata has quit [Remote host closed the connection]
<gj> hmm, i am trying to think about how exactly to word it... english is not my first language so it might take a while.
<beach> Take your time.
<beach> My guess is that the same holds true for most #lisp participants.
ljavorsk has joined #lisp
<shka_> gj: spit it out, we can figure out what you mean together :-)
holycow has quit [Quit: Lost terminal]
<gj> im trying to figure it out myself!! i think i am almost there.
<gj> if not, of course i will ask for help
luni has joined #lisp
<shka_> ok
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<Inline> morning
<beach> Hello Inline.
<Inline> heya beach
pankajsg has quit [Quit: Konversation terminated!]
pankajsg has joined #lisp
luni has quit [Quit: Connection closed]
pve has joined #lisp
buffergn0me has left #lisp ["ERC (IRC client for Emacs 26.2)"]
orivej has joined #lisp
voidlily has quit [Ping timeout: 264 seconds]
anotherone9999[m has quit [Quit: Idle for 30+ days]
hendursa1 has joined #lisp
hendursaga has quit [Ping timeout: 268 seconds]
hendursaga has joined #lisp
theothor` has joined #lisp
hendursa1 has quit [Ping timeout: 268 seconds]
jonatack has quit [Read error: Connection reset by peer]
voidlily has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #lisp
aartaka has joined #lisp
imode has quit [Quit: Sleepy sheepy..]
aartaka_d has quit [Ping timeout: 240 seconds]
gaqwas has quit [Remote host closed the connection]
gaqwas has joined #lisp
gaqwas has joined #lisp
luis has quit [Quit: Ping timeout (120 seconds)]
hineios has quit [Quit: Ping timeout (120 seconds)]
aartaka has quit [Ping timeout: 264 seconds]
hineios has joined #lisp
luis has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
nmg has quit [Ping timeout: 265 seconds]
Lord_of_Life has quit [Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine]
amb007 has joined #lisp
nmg has joined #lisp
markasoftware has quit [Quit: No Ping reply in 180 seconds.]
Lord_of_Life has joined #lisp
markasoftware has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
sauvin_ has joined #lisp
Sauvin has quit [Ping timeout: 264 seconds]
sauvin_ is now known as Sauvin
aartaka has joined #lisp
surabax has joined #lisp
logoman has joined #lisp
gingerale has quit [Quit: WeeChat 1.6]
logoman has quit [Quit: Connection closed]
karlosz has quit [Quit: karlosz]
Blukunfando has joined #lisp
voidlily has quit [Ping timeout: 268 seconds]
villanella has joined #lisp
gingerale has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 265 seconds]
theothor` has joined #lisp
jello_pudding has quit [Ping timeout: 265 seconds]
voidlily has joined #lisp
prxq has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ikrabbe has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
theothor` has quit [Ping timeout: 264 seconds]
gj has quit [Quit: Connection closed]
theothor` has joined #lisp
jello_pudding has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
galex-713 has joined #lisp
gingerale has quit [Quit: WeeChat 3.0.1]
gingerale has joined #lisp
random-nick has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
vegansbane6963 has quit [Quit: The Lounge - https://thelounge.chat]
dhil has joined #lisp
theothor` has joined #lisp
theothor` has quit [Ping timeout: 246 seconds]
puchacz has joined #lisp
puchacz has quit [Client Quit]
drl has quit [Quit: Leaving]
theothor` has joined #lisp
vegansbane6963 has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
jonatack has joined #lisp
theothor` has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
theothor` has quit [Ping timeout: 246 seconds]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
nij has joined #lisp
gaqwas has quit [Remote host closed the connection]
<nij> Is there any Lisp program's documentation is wiki-like.. an autogenerated collections of html that mimicks the experience of inspecting objects in slime/sly?
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
kam1 has joined #lisp
aeth has quit [Ping timeout: 264 seconds]
kam1 has quit [Read error: Connection reset by peer]
prxq has joined #lisp
aeth has joined #lisp
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
aartaka_d has quit [Read error: Connection reset by peer]
aartaka has joined #lisp
<luis> nij: there's an HTML5 backend for CLIM and an inspector written in CLIM
<luis> McCLIM rather.
drl has joined #lisp
drot has joined #lisp
varjag has joined #lisp
nij has quit [Remote host closed the connection]
nij has joined #lisp
<scymtym> *prototype backend
<luis> ^-- prototype backend author
Nilby has joined #lisp
kam1 has joined #lisp
jurov_ has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
kam1 has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
jurov has quit [Ping timeout: 246 seconds]
nij` has joined #lisp
ljavorsk has quit [Remote host closed the connection]
nij has quit [Ping timeout: 240 seconds]
ljavorsk has joined #lisp
jurov_ has quit [Ping timeout: 256 seconds]
jurov has joined #lisp
Bourne has quit [Ping timeout: 272 seconds]
nij` has quit [Remote host closed the connection]
nij` has joined #lisp
theothor` has joined #lisp
<nij`> luis: I haven't started to learn CLIM yet.. If I have a lisp program already that happily works without a GUI, does it take many steps for me to generated a HTML5 backend doc?!
nij` is now known as nij
<contrapunctus> nij: I've been thinking about different ways of interacting with programs, outside of the traditional file-based ways. Any reason you wouldn't want to just use SLIME/Sly itself, instead of making a web app which mimics them?
theothor` has quit [Ping timeout: 264 seconds]
jonatack has quit [Read error: Connection reset by peer]
alfred188 has quit [Quit: WeeChat 3.0]
<nij> contrapunctus: tbh my plan is vague
<nij> I'm writing math papers and books. And in math.. technical terms are really OBJECTS.
<nij> In traditional writing, there's even no hyperlink. The reading experience is super bad.
<nij> Nowadays, there are more and more wiki-like articles. But it's still superficial.
<nij> Really, based on set theory, all math concepts can be written as some sort of Lisp objects.
<nij> Once that's done, we should be able to automatically generate a wiki for users to dive in.
<nij> So why not just SLIME/SLY themselves? 1. We need latex rendering (or even more, idk for now). 2. More users can read it.
<nij> (e.g. look at https://ncatlab.org/nlab/show/group+completion .. there are lots of links.. but they lack of "structures")
Bike has joined #lisp
<nij> And it's not just math I guess. In general, having web like doc is useful.
nij has quit [Remote host closed the connection]
Guest30620 has joined #lisp
nij has joined #lisp
Guest30620 has quit [Remote host closed the connection]
nij has quit [Client Quit]
nij has joined #lisp
Sheilong has joined #lisp
euandreh has quit [Ping timeout: 272 seconds]
euandreh has joined #lisp
zulu-inuoe has joined #lisp
euandreh has quit [Ping timeout: 240 seconds]
euandreh has joined #lisp
lambdanon has joined #lisp
<lambdanon> Hi, I'm trying to figure out how to use CLX to try making my own window manager, but the brief tour shown in the manuals I find are broken; there's an undefined function called `menu-present`. Are there up-to-date manuals? Are there better X frameworks in CL?
shifty has joined #lisp
<ralt> lambdanon: maybe try looking at how stumpwm does it
<ralt> it's a window manager using CLX
<contrapunctus> nij: hm...would notebooks meet your needs? From what little I know of them, they seem to be the mix of interactive environment and document that you want.
<nij> contrapunctus: lemme put it this way.. can we generate a pile of htmls (or a notebook.. which im not familiar with) from an asdf system?
<Bike> lambdanon: if you're looking at "A Quick Tour of CLX", it looks like the actual code has menu-present defined
<lambdanon> Bike: That's odd. I C-f through the document, and it's not there?
<Bike> yeah, i don't think the manual has the entire program
<lambdanon> Bike: thanks, that clears a lot up
<lambdanon> ralt: I'm trying to do a dynamic window manager that feels like DWM, but with stumpwm's extensibility. I'll try checking out the source code, hopefully it'll show how they do it
<lambdanon> Right now I'm thinking of designing the program with something like
<ralt> lambdanon: maybe you want to take a look at this first https://github.com/stumpwm/stumpwm/pull/851
<contrapunctus> nij: I think I've seen libraries for that. But mind, I'm just a newbie in CL. Have a look here. https://github.com/CodyReichert/awesome-cl#documentation-builders
euandreh has quit [Ping timeout: 272 seconds]
<lambdanon> ralt: That looks cool. although I'll probably end up using this dynamic management in stumwpm, I'm also making this project out of my own sense of curiosity, learning how to manage asdf systems, packages, etc
euandreh has joined #lisp
theothor` has joined #lisp
rumbler31 has joined #lisp
<nij> contrapunctus: among them mgl-pax seems interesting! thanks for sharing! (taking a look)
theothor` has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Remote host closed the connection]
euandreh has quit [Ping timeout: 265 seconds]
lambdanon has quit [Remote host closed the connection]
<zxq2> any good resource for learning about fixed point combinators?
euandreh has joined #lisp
<zxq2> specifically for doing recursion
jonatack has joined #lisp
<beach> You mean like the Y combinator?
<beach> I would think a boot about lambda calculus.
drl_ has joined #lisp
holycow has joined #lisp
<zxq2> yeah
sjl has joined #lisp
<holycow> #lispcafe
drl_ has quit [Client Quit]
<holycow> sorry about the noise
drl_ has joined #lisp
euandreh has quit [Ping timeout: 268 seconds]
<beach> s/boot/book/
<beach> *sigh*
euandreh has joined #lisp
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #lisp
<beach> zxq2: The subject is a bit off topic for this channel, though.
orivej has joined #lisp
drl_ has quit [Quit: Leaving]
theothor` has joined #lisp
theothor` has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #lisp
<nij> IMO don't try to learn to intuition. Instead, learn the rules of lambda calculus. And pick a Y-comb version of "factorial", expand it yourself and see why you get (fact 3) = 6.
<nij> Many blogposts sell on "explaning it".. but unfortunately some syntatical/algebraic experience can be only acquired by doing it.
ym has joined #lisp
<nij> Slightly related, supporting my point, the MU puzzle: https://en.wikipedia.org/wiki/MU_puzzle
<nij> In short, you can discover a lot of things by playing with the puzzle. And while you try to explain the experience to people, people will most likely be confused.
<nij> But as beach said, it's a bit offtopic here. So I'll cut it here :/
pfdietz has joined #lisp
<zxq2> yeah that's kind of what i've been doing. i've been experimenting with the U-combinator (lambda (f) (f f)), which is a bit simpler, in racket.
Josh_2 has joined #lisp
<Josh_2> Hi
iamFIREcracker has joined #lisp
<nij> zxq2 make it a goal to compute (fact 3) = 6 by your hand!
<nij> After that you'd understand!
<zxq2> i've been watching a lecture where lisp features are built from scratch using primitives from the lambda calclus (e.g. church numerals, etc). https://www.youtube.com/watch?v=VSnZzunIELs
<zxq2> everything else clicked pretty quickly.
<Josh_2> https://plaster.tymoon.eu/view/2302#2302 can someone take a look at this? The top is the C and the bottom is my attempt at sending the correct args in CL, I don't get any errors when I run the function it just blocks and never returns
<jasom> flip214: oh, I missed that you needed an in-ram stream. https://edicl.github.io/flexi-streams/
iamFIREc1 has quit [Ping timeout: 256 seconds]
fubbiquantz has quit [Ping timeout: 256 seconds]
sjl has quit [Ping timeout: 272 seconds]
theothornhill has joined #lisp
<nij> A question: can I call a method f on a Lisp object x in a succinct syntax like `x.f` in python?
<beach> Luckily no. And you don't call objects in Common Lisp, you call generic functions.
<jasom> Josh_2: that's not how I would do it, and you can't rely on CFFI's automatic conversion of strings for *output* pointers.
<Josh_2> jasom: how would you do it? this is my first time messing with CFFI
<beach> Er, I mean, you don't call METHODS in Common Lisp.
<theothornhill> nij: Isn't (f x) pretty succinct?
<beach> nij: That syntax is really bizarre, because it distinguishes one particular argument from the others. CLOS did a great job of fixing that problem.
<nij> theothornhill: I might run into things like "a.b.c.d.e.f.g"
<theothornhill> nij: oof
<nij> Bases: sage.algebras.quantum_groups.representations.CyclicRepresentation e.g. https://doc.sagemath.org/html/en/reference/algebras/sage/algebras/quantum_groups/representations.html
<beach> nij: Then I would say you have a problem with software architecture.
shifty has quit [Ping timeout: 272 seconds]
<nij> beach: ? it's not about programming but math
<nij> but how does CLOS solve this?
<theothornhill> nij: you could use arrows though: (-> g (f) (e)) etc
<beach> nij: Solve what?
shifty has joined #lisp
<nij> uh.. i mean "fixing that problem"
<beach> What problem?
<beach> I see no problem.
<jackdaniel> nij: in common lisp methods live in a generic function, not in an object
<nij> You said there's a problem solved by CLOS 3 min ago.
<nij> theothornhill: ah right.. that's a bit better
<theothornhill> nij: I can sympathize though with the nested accessor thing. Same thing with `aref` and arrays, but that's just lisp
<beach> Oh, that. The problem where one argument is distinguished. It solves it by not distinguishing between the arguments, so (f x y z) rather than x.f(y,z)
<nij> i see
hendursaga has quit [Quit: hendursaga]
<nij> or just use #'reduce i guess
<jackdaniel> how about compose?
hendursaga has joined #lisp
<theothornhill> annoying to write (aref (aref (aref x 3) 2) 1)
<jackdaniel> well ,scratch that
<nij> jackdaniel: in lisp2 you need #'funcall which is annoying
<jackdaniel> what is annoying about funcall?
<nij> x.f.g.h.j.k.l should be written like (reduce :init x '(f g h j k l))
<jackdaniel> (setf (fdefinition 'foo) (compose 'list 'list))
<beach> nij: In languages with that bizarre syntax, a method can specialize only to the first distinguished parameter. In CLOS, a method can specialize to any subset of the required parameters.
<nij> jackdaniel: it's long and not elegant.. probably i should create a user read macro for that myself
<jackdaniel> there, now: > (foo 15) ; --> ((15))
<nij> beach: I sort of got your point
<theothornhill> nij: you don't need a reader macro though. You could just create a normal macro
<theothornhill> also, you could check out rutils
<_death> theothornhill: so write (naref x 3 2 1) .. we have procedural abstraction
* nij wishes common-lisp were lisp 1.
<Josh_2> use scheme then
<jackdaniel> what an attracious wish ,p
<theothornhill> _death: :-O
* beach is grateful it is not.
<nij> wait why? isn't lisp 1 clearer syntactically?
<nij> s/clear/clean
<theothornhill> _death: ah misread. Yeah, I know and have sometimes, but now I thought you meant it was builtin :)
<_death> theothornhill: everything is built in once you build it in :)
<jackdaniel> it is more minimal, but minimal doesn't always mean clear
<beach> nij: Only for the case that Lisp-1 people like to emphasize.
<theothornhill> _death: :)
<pfdietz> Lisp 1 requires you keep track of the interference between the two namespaces.
<pfdietz> (the two namespaces that you have smashed together into one namespace)
<nij> Why are there two?
<theothornhill> Also, the explicit funcalling at least makes it very explicit that you are calling a function.
<nij> There shouldn't be any distinguishment between a normal object and a function..
<theothornhill> and that can be nice
<beach> nij: Actually, there are more like 7
<Josh_2> I think that CL has more explicit syntax because functions and variables don't share the same namespace
<jackdaniel> every time you create a hash table you define a new namespace
<pfdietz> Because variables and functions are typically used in different ways.   The crossovers are not very common, so the syntactic overhead of that crossing is small.  I remember looking at the frequency of occurence of FUNCALL in Quicklisp systems -- just 0.4% of lines.
<ecraven> ah, sometimes I envy Lisp, that you can just call a variable `list' and don't break anything.. then I envy Scheme, that you can just (apply foo params), and don't need to think about what foo might be...
<pfdietz> This may be a CL style thing, at least in part.
<nij> I think it stems in the mindset whether functions should be treated as completely first-clsas or not.
<beach> nij: That's an orthogonal issue.
<theothornhill> jackdaniel: Oh? What do you mean?
<jackdaniel> theothornhill: what is a namespace?
<jackdaniel> a mapping from a name to a value
<theothornhill> Right now I'm thinking I have no idea :P
<jackdaniel> (for a generous definition of 'name')
<pfdietz> So, if one were to imagine a CL that was a Lisp-1, one would have to think about shadowing function names at every variable binding.   I contend the mental overhead of that would be worse than having to remember to use explicit #' and funcall/apply.
<beach> nij: I can think of the following built-in namespaces: variables, functions, classes, method combinations, types, packages. But I probably forgot a few.
<jackdaniel> what I find a little ugly in cl is the fact, that lexical and special variables are not in separate namespaces, but that's practically solved with a naming convention
<pfdietz> block names, tagbody tags
<beach> pfdietz: Thanks.
shifty has quit [Ping timeout: 265 seconds]
<nij> pfdietz: why would one have to think about shadowing funciton names then?
<pfdietz> jackdaniel: yes, that's a blemish.   It's probably historical, from when all variables were dynamically bound.
<pfdietz> nij:  ask yourself why scheme programs have variables named "lst".
<nij> pfdietz: the only lisp i "know" are cl and elisp :-(
<nij> so i don't really know the practical problem of lisp-1
<nij> i just think it's more elegant from a math person's view
<jasom> okay, may be too early, but I can't solve the plaster captcha
amb007 has quit [Read error: Connection reset by peer]
* jasom is going to write a program to solve a captcha that he, himself, can't solve :/
<beach> nij: The main purpose of Common Lisp was to be a practical programming tool. Not to be elegant.
<pfdietz> nij: in a Lisp-1, if you have a variable with the same name as a global function, you can't call that function via that name in the scope of that variable.  In a Lisp-2, you can.
<Josh_2> jasom: c&p your code you can just refresh
amb007 has joined #lisp
<nij> beach: I get that. I'm still struggling to find out why lisp-1 fails to be practical.
<theothornhill> Does it?
<jasom> Josh_2: attempt here: https://plaster.tymoon.eu/view/2302#2303
<nij> pfdietz: Then don't name the var and the function by the same name.. why not @@?
<nij> It's still going back to the mental state that functions and vars are different.. isn't it?
<pfdietz> nij: so you have to keep track of what the names are.  This is the mental overhead I referred to.
<flip214> jasom: sorry, but that link alone doesn't help - I've seen that already.
<flip214> https://edicl.github.io/flexi-streams/#make-in-memory-output-stream says "a subtype of octet", so no chars.
<jackdaniel> nij: kent pitman made an excellent argument, that verbs and nouns are separate in a spoken language
<flip214> I've implemented my own stream class that accepts strings, characters, and bytes, but it might be faster some other way?!
villanella has quit [Ping timeout: 260 seconds]
<jasom> Josh_2: Always comment your C function prototypes with which are input and which are output values for sanity. It's obvious when thinking about it, but the mental overhead is always maxed out when thinking about C for me.
<Josh_2> jasom: that worked!
<pfdietz> Anyway, what is the practical benefit of this "elegance"?   It seems like useless posturing rather than something of value.
<nij> jackdaniel - but verb can be naturally makes into noun and be treated like a noun
<jasom> flip214: make-flexi-stream needs to go on top
<nij> jackdaniel: OH ok in Lisp that's `#'`
<jasom> flip214: you need an in-memory binary stream (many systems including flexi-streams provide that) and you need bivalent streams on top of a binary stream (many systems including flexi-streams provide that)
<Nilby> lisp2 is really just a practical thing for writing large & complex programs.
<jasom> you can't do bivalent streams on top of most character streams, since most character i/o formats are not 8-bit clean
<nij> Nilby: I see.
<Nilby> everyone can agree lisp1 is simpler, but try writing big things and then see if you want lisp2
<jasom> even latin-1 streams may not be 8-bit clean on e.g. windows due to line-ending translations
<nij> i see
<nij> 'x refers to the variable x, #'x refers to the function x, ... what expressions refer to the class, type, method.. x ?
<jasom> Josh_2: do note the comment that if the output picked data is very large you will corrupt memory on at least sbcl, since CFFI unconditionally stack allocates in with-foreign-pointer-as-string on at least sbcl
<_death> jackdaniel: funny, I remembered it that way https://www.dreamsongs.com/Separation.html
<jasom> nij: 'x refers to the symbol x; #'x refers to the function associated with the symbol x in the particular lexical and dynamic environment in which #'x is evaluated.
<pfdietz> Ralph Waldo Emerson: "A foolish consistency is the hobgoblin of little minds"
<nij> jasom: Ah yes. I was confused. Thanks :-)
<jasom> nij: (find-class 'x) will refer to the class named by the symbol x
wsinatra has joined #lisp
<Josh_2> jasom: so I should do I check to make sure the password isn't very long?
<Josh_2> ie not more than 64 characters etc
<jasom> Josh_2: that depends on how safe you want to be. A passphrase is ulikely to be more than 1k I would say. Not sure how big of a stack lisps use, but I would guess 1k is within sanity
<_death> nij: #'x is just a shorthand for (function x) so if the hash is too noisy, you can just use the latter.. I think pjb used to do that
<jasom> Josh_2: I have in the past written my own version of with-foreign-pointer that heap allocates; you may just want to do the same for strings
<nij> jasom: _death: thanks :)
<jasom> Josh_2: I would be at least as concerned about the output size being too large, but I don't know how big these objects are
<Josh_2> I think the output is constant
<Josh_2> 438 characters
<jasom> Josh_2: oh really? That makes it a lot easier then
<Josh_2> I just tried two different passphrases and they both have a constant output size
<jasom> Josh_2: what about two different "account" objects?
<jasom> Josh_2: that's what I would expect to change the size
<Josh_2> I tried two different account objects
<jasom> great; I would probably just check for a sane passphrase length; 64 characters is perhaps too short, I use passphrases that are longer occasionally. 128 or 256 is probably fine.
<Josh_2> still the same 438
<jasom> Josh_2: default control-stack-size on sbcl is 2MB
citizenajb has joined #lisp
nij has left #lisp ["ERC (IRC client for Emacs 27.1)"]
<jasom> Josh_2: there doesn't seem to be a way to query it (at least a search of the sbcl manual index for "stack" didn't show up anything useful
<jasom> but like I said, if you're allocating less than 1k total on the stack you're almost certainly fine on non-embedded systems
<jasom> and "almost certainly fine" is about as good as you get when interacting with many foreign libraries...
ebrasca has joined #lisp
Bourne has joined #lisp
kam1 has joined #lisp
X-Scale has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
tfb has joined #lisp
maier has joined #lisp
citizenajb has quit [Ping timeout: 265 seconds]
kam1 has joined #lisp
notzmv` is now known as notzmv
notzmv has quit [Changing host]
notzmv has joined #lisp
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #lisp
<jmercouris> hello everyone
amb007 has quit [Ping timeout: 264 seconds]
amb007 has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 272 seconds]
Bourne has quit [Remote host closed the connection]
<beach> Hello jmercouris.
<jmercouris> thank you!
<ebrasca> Hello jmercouris!
<jmercouris> hello ebrasca
<Josh_2> Hi
<jmercouris> hello Josh_2
<Josh_2> jasom: how do I go about deallocating the memory once I have a returned foreign object?
<jmercouris> Josh_2: free
<Josh_2> no no I mean when
rumbler31 has joined #lisp
<jmercouris> what do you mean?
<jmercouris> when do you decide to deallocate?
<Josh_2> See that example function do I just free after I have my returned result or do I need to free when I am 100% done with the underlying object?
<phoe> the latter
<phoe> you must not free an object that you are going to use at any time in the future
<phoe> but then again! depends on what exactly you return
<jmercouris> as always the answer is; it depends
<phoe> do you return a foreign pointer, or some Lisp object that was constructed based on the foreign data and is therefore allocated in GC-managed memory?
<phoe> in the former case you must not free it
theothornhill has quit [Ping timeout: 240 seconds]
<phoe> in the latter case your code should have already freed it for you because the memory was allocated with dynamic extent if the foreign wrapper code is worth its salt
<Josh_2> right, in this case I believe it is a pointer
<Josh_2> so does that mean I have to keep track of all the pointers I allocate?
<phoe> so you must manage its lifetime yourself
<phoe> yes
<Josh_2> frick
<phoe> welcome to manual memory management
<Josh_2> yes what a pain
<phoe> or use dynamic extent wherever you can
admich has joined #lisp
<Josh_2> https://plaster.tymoon.eu/view/2302#2303 if we take the example that jasom wrote for me then I would need to keep track of all the pointers allocated within pickle so that when I'm done with account I can free them?
warweasle has joined #lisp
<warweasle> Anyone use lisp for algotrading?
theothornhill has joined #lisp
<jmercouris> You could also write your own wrapper that handles the memory management
<jmercouris> That’s often a lot cleaner than trying to handle it within your actual project
<jmercouris> Usually memory leaks are then handled
<jmercouris> warweasle: I think you’ll find a lot more python and r suitable for the task
<jmercouris> There is going to be very limited support in lisp, especially for interfacing with the trading platforms
<Josh_2> I know someone who wrote his trading platform in Clojure
<warweasle> jmercouris: Yeah... I'm seeing a lack of libraries... Would have to write my own and that would take a while.
theothornhill has quit [Ping timeout: 272 seconds]
Cymew has quit [Ping timeout: 256 seconds]
galex-713 has quit [Ping timeout: 272 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
villanella has joined #lisp
bitmapper has quit [Quit: Connection closed for inactivity]
admich has quit [Remote host closed the connection]
<mfiano> Could someone please remind me how to get at a method's function object with the MOP? t's been a while since I had to do this...
<phoe> c2mop:method-function but I don't know what sort of arguments this accepts
<phoe> mop method-function
zaquest has quit [Ping timeout: 240 seconds]
<phoe> oh right, arguments and next methods
bilegeek has joined #lisp
thmprover has joined #lisp
long4mud has quit [Ping timeout: 272 seconds]
<mfiano> That's what I tried, but I must be doing something wrong
<mfiano> I tried to view the disassembly with: (disassemble (c2mop:method-function (find-method #'foo nil '(bar t))))
<mfiano> But I must not be looking at the right object, because it never changes even when I change the method body
luni has joined #lisp
lisp-machine has joined #lisp
zaquest has joined #lisp
<scymtym> mfiano: (disassemble (sb-pcl::%method-function-fast-function (sb-mop:method-function (find-method #'sb-mop:ensure-class-using-class '() '(null t))))) seems to do the trick for my SBCL version
maier has quit [Quit: Lost terminal]
<scymtym> (and disassembling the return value of METHOD-FUNCTION prints the disassembly for two functions where the second one corresponds to the above)
<mfiano> I can't get that to work with mine
<mfiano> Let me play around a bit
<scymtym> seems to have been changed around 2019-08
<mfiano> Ok I got it to work, but
<mfiano> It's returning the same exact disassembly no matter if i change and recompile the method
<mfiano> Maybe I'm doing something wrong...
<mfiano> I can make a gist for you
<scymtym> sure
<mfiano> Ok now it works, ha
<mfiano> Nevermind, and thank you. Any idea how to do this portably with c2mop?
<scymtym> no, but as i said, for me, DISASSEMBLE outputs the disassembly you are looking for after the one you don't want. so maybe SEARCH and SUBSEQ to get the relevant part of the output?
<mfiano> That is not what I experience
<mfiano> The disassembly is always the same when doing it on METHOD-FUNCTION's return value
<mfiano> Unlike the sbcl internal way
<scymtym> hm, maybe my SBCL version is new enough to exhibit some changed behavior
<scymtym> no idea in that case, sorry
<mfiano> oh you're right actually
<mfiano> Sorry for the confusion
<mfiano> I was assuming the code size included both
<mfiano> the header at the top i mean
<mfiano> Thank you for your work on SBCL btw
<scymtym> no worries
cage_ has joined #lisp
<scymtym> it is easy to miss (i wasn't aware of this before today either)
skapata has joined #lisp
palter has joined #lisp
jonatack_ has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
jonatack has quit [Ping timeout: 272 seconds]
h4ck3r9696 has joined #lisp
waleee-cl has joined #lisp
rogersm has joined #lisp
mjl has quit [Read error: Connection reset by peer]
mjl has joined #lisp
splittist has quit [Ping timeout: 272 seconds]
ffwacom has quit [Ping timeout: 260 seconds]
splittist has joined #lisp
ffwacom has joined #lisp
bitmapper has joined #lisp
iskander has joined #lisp
lisp-machine has quit [Ping timeout: 256 seconds]
iskander- has quit [Ping timeout: 272 seconds]
jonatack_ has quit [Remote host closed the connection]
jonatack_ has joined #lisp
ljavorsk has quit [Ping timeout: 256 seconds]
iskander has quit [Ping timeout: 240 seconds]
iskander- has joined #lisp
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #lisp
iskander has joined #lisp
aartaka_d has quit [Ping timeout: 264 seconds]
iskander- has quit [Ping timeout: 256 seconds]
anticrisis has joined #lisp
iskander has quit [Ping timeout: 240 seconds]
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 256 seconds]
iskander has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
anticrisis has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 246 seconds]
wsinatra has quit [Quit: WeeChat 3.0.1]
tfb has quit []
wsinatra has joined #lisp
wsinatra has quit [Client Quit]
ym has quit [Ping timeout: 240 seconds]
wsinatra has joined #lisp
Lord_of_Life has joined #lisp
mr-iznogud has quit [Remote host closed the connection]
rogersm has quit [Quit: Leaving...]
Sauvin has quit [Read error: Connection reset by peer]
marusich has quit [Quit: Leaving]
theothornhill has joined #lisp
galex-713 has joined #lisp
theothornhill has quit [Ping timeout: 240 seconds]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 264 seconds]
X-Scale` is now known as X-Scale
Krystof has quit [Ping timeout: 240 seconds]
torbo has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
warweasle has quit [Quit: later]
jonatack_ has quit [Remote host closed the connection]
varjag has joined #lisp
jonatack has joined #lisp
Lycurgus has joined #lisp
h4ck3r9696 has quit [Quit: Leaving.]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
shifty has joined #lisp
drl has quit [Ping timeout: 264 seconds]
srandon111 has joined #lisp
h4ck3r9696 has joined #lisp
Lycurgus has quit [Quit: Exeunt]
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
theothornhill has joined #lisp
Krystof has joined #lisp
nthian has quit [Quit: ERC (IRC client for Emacs 27.1)]
shifty has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
akoana has joined #lisp
luni has quit [Quit: Connection closed]
housel has quit [Ping timeout: 272 seconds]
<Josh_2> I don't like CFFI
<Josh_2> oof
rogersm has joined #lisp
rogersm has quit [Client Quit]
theothornhill has quit [Ping timeout: 265 seconds]
h4ck3r9696 has quit [Quit: Leaving.]
theothornhill has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
cage_ has quit [Quit: Leaving]
shifty has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
wsinatra has quit [Quit: WeeChat 3.0.1]
theothornhill has quit [Ping timeout: 264 seconds]
heisig has quit [Quit: Leaving]
theothornhill has joined #lisp
theothor` has joined #lisp
villanella has quit [Quit: villanella]
dhil has quit [Ping timeout: 256 seconds]
theothor` has quit [Ping timeout: 256 seconds]
shifty has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
pillton has joined #lisp
citizenajb has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
aindilis has joined #lisp
rgherdt has quit [Ping timeout: 272 seconds]
rgherdt has joined #lisp
<srandon111> Josh_2, and then ?
warweasle has joined #lisp
karlosz has joined #lisp
warweasle has quit [Client Quit]
karlosz has quit [Remote host closed the connection]
surabax has quit [Read error: Connection reset by peer]
karlosz has joined #lisp
rgherdt has quit [Ping timeout: 265 seconds]
karlosz has quit [Ping timeout: 264 seconds]
aeth has quit [Ping timeout: 272 seconds]
aeth has joined #lisp
karlosz has joined #lisp
pve has quit [Quit: leaving]
theothornhill has quit [Remote host closed the connection]
karlosz has quit [Client Quit]
mmmattyx has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
nitrix has quit [Remote host closed the connection]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
theothor` has joined #lisp
amb007 has quit [Ping timeout: 264 seconds]
nitrix has joined #lisp
theothor` has quit [Ping timeout: 265 seconds]