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)]
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.
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>
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>
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
<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]
<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.
<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
<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"
<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))
<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
<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.
<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
<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?
<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
<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