jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language<http://cliki.net/> logs:<https://irclog.whitequark.org/lisp,http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
fikka has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
Kundry_Wag has joined #lisp
Mezzie has joined #lisp
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
Jesin has quit [Quit: Leaving]
test1600 has joined #lisp
vitali has joined #lisp
mindCrime has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
vitali has quit [Client Quit]
Pixel_Outlaw has joined #lisp
Jesin has joined #lisp
lima4_ has joined #lisp
jack_rabbit is now known as knusbaum
fikka has quit [Ping timeout: 268 seconds]
brendyn has joined #lisp
lima4_ has left #lisp [#lisp]
aeth has quit [Ping timeout: 245 seconds]
knusbaum1 has quit [Quit: die]
aeth has joined #lisp
markoong has quit [Read error: Connection reset by peer]
markoong has joined #lisp
patlv has joined #lisp
knusbaum is now known as jack_rabbit
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
markoong has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
montxero has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
patlv has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
patlv has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
patlv has quit [Ping timeout: 268 seconds]
thodg has joined #lisp
Oddity has quit []
EvW1 has quit [Ping timeout: 265 seconds]
brettgilio has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
thodg has quit [Ping timeout: 268 seconds]
zachk has quit [Quit: Leaving]
brettgilio has quit [Ping timeout: 245 seconds]
pjb` has joined #lisp
pjb has quit [Ping timeout: 245 seconds]
fikka has joined #lisp
siraben has joined #lisp
mindCrime has joined #lisp
megalography has quit [Ping timeout: 240 seconds]
pjb`` has joined #lisp
pjb` has quit [Ping timeout: 245 seconds]
test1600 has quit [Ping timeout: 268 seconds]
brettgilio has joined #lisp
kajo has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Remote host closed the connection]
patlv has joined #lisp
balavir has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
buffergn0me has joined #lisp
kajo has joined #lisp
mathZ has joined #lisp
brettgilio has quit [Remote host closed the connection]
pjb``` has joined #lisp
pjb`` has quit [Ping timeout: 245 seconds]
<mathZ> In maxima, how can i expand cos(a+b) to cos(a)*cos(b) - sin(a)*sin(b) ?
mooshmoosh has quit [Remote host closed the connection]
pjb```` has joined #lisp
graphene has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<Xach> mathZ: not many (any?) maxima people here, sorry.
<mathZ> ok
graphene has joined #lisp
pjb``` has quit [Ping timeout: 256 seconds]
nanoz has joined #lisp
pjb````` has joined #lisp
patlv has quit [Ping timeout: 264 seconds]
Guest67885 has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
ioa has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
megalography has joined #lisp
ioa has joined #lisp
mrottenkolber has joined #lisp
pjb```` has quit [Ping timeout: 256 seconds]
bjorkintosh has joined #lisp
mrottenkolber is now known as Guest16746
Kundry_Wag has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
pjb`````` has joined #lisp
pjb````` has quit [Ping timeout: 256 seconds]
graphene has quit [Remote host closed the connection]
shifty has quit [Ping timeout: 240 seconds]
graphene has joined #lisp
robotoad has quit [Quit: robotoad]
fikka has quit [Ping timeout: 240 seconds]
thodg has joined #lisp
megalography has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
dddddd has quit [Read error: Connection reset by peer]
<balavir> mathZ: try trigexpad(cos(a+b))
Kundry_Wag has joined #lisp
pjb`````` has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Ping timeout: 256 seconds]
robotoad has joined #lisp
fikka has joined #lisp
Kundry_Wag has joined #lisp
<ebzzry> Xach: will you be able to accept donations?
megalography has joined #lisp
Kundry_Wag_ has joined #lisp
Kundry_Wag has quit [Ping timeout: 245 seconds]
fikka has quit [Ping timeout: 260 seconds]
patlv has joined #lisp
<mathZ> balavir: sorry, just come back. trigexpad(cos(a+b)) => (%o1) trigexpad(cos(b + a)) ?
patlv has quit [Remote host closed the connection]
patlv has joined #lisp
fikka has joined #lisp
megalography has quit [Ping timeout: 255 seconds]
<balavir> mathZ: typo, s/tripexpad/trigexpand/
<mathZ> balavir: works, thx!
AetherWind has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
pierpa has quit [Quit: Page closed]
<beach> Good morning everyone!
<mathZ> morning!
fikka has joined #lisp
Kundry_Wag_ has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
igemnace has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 256 seconds]
kajo has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Ping timeout: 240 seconds]
megalography has joined #lisp
kajo has joined #lisp
fikka has joined #lisp
nanozz has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
shka_ has joined #lisp
nickenchuggets has quit [Read error: Connection reset by peer]
<LdBeth> Good afternoon
erratic has quit [Ping timeout: 256 seconds]
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
nickenchuggets has joined #lisp
nanoz has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 256 seconds]
patlv has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
JuanDaugherty has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
<mfiano> pillton: Is it normal for stores with &key to have a &rest gensym in their signature?
fikka has quit [Ping timeout: 248 seconds]
thodg has quit [Read error: Connection reset by peer]
MoziM has quit [Ping timeout: 256 seconds]
MoziM has joined #lisp
Oddity has joined #lisp
Kundry_Wag has joined #lisp
fikka has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
buffergn0me has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 256 seconds]
brendarn has joined #lisp
<pillton> mfiano: Yes.
brendyn has quit [Ping timeout: 268 seconds]
<mfiano> pillton: If you got a second, I could use some help writing a specialization
<pillton> Sure.
<mfiano> I have this specialization, which is the addition of 2 4-component vectors, writing the result to an existing allocation as to not cons. https://gist.github.com/mfiano/b2f97f175b16dc53f6b812500b49b994
<mfiano> I'm trying to figure out how to write the last specialization to take an arbitrary number of arguments which calls the first one
pierpal has quit [Read error: Connection reset by peer]
<pillton> (defspecialization (+! :inline t) ((out vec4) (in1 vec4) (in2 vec4) (in3 vec4) &rest (more vec4)) vec4)
fikka has joined #lisp
<mfiano> and what would the body look like?
<mfiano> I am getting compiler notes and incorrect functionality with everything i try
anon_ has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
<pillton> (+! out in1 in2) (apply #'+! out in3 more)
<mfiano> That's not correct
<pillton> Why isn't it?
nanozz has quit [Ping timeout: 268 seconds]
<mfiano> 2nd 2 are not expected
<mfiano> last 2 i mean
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<pillton> Because there is no arity 2 specialization.
<mfiano> Hmm
<mfiano> I'm getting confused. Might need a break
<mfiano> But there shouldn't be an arity 2. smallest arity should be 3, since it's non-consing
<pillton> The problem is the way you have defined the first specialization. You should make it out = out + in1 + in2. Then the problem goes away.
<pillton> Or alternatively process the rest arguments of the second specialization such that it makes sense.
<mfiano> Hmm
<pillton> mfiano: I added an example which works.
<mfiano> Reading, thanks.
fikka has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<pillton> mfiano: I added a second example which implements the original API you wrote.
megalography has quit [Ping timeout: 265 seconds]
<mfiano> Still not quite what I was looking for
fikka has quit [Ping timeout: 245 seconds]
<pillton> You haven't explained what you were looking for.
<mfiano> If I do: (let ((v (vec4 1 1 1 1))) (+! v v v)) I expect v + v to be written to v, so v has a final value of #(2 2 2 2). Instead it has #(4 4 4 4)
<mfiano> That's how my existing library works anyway
<pillton> Oh right. That is easy to fix.
skapata has quit [Remote host closed the connection]
milanj has joined #lisp
<pillton> The &rest specialization won't be non consing because you have to allocate a temporary to store the addition.
<mfiano> Hmm
fikka has joined #lisp
<pillton> Oh wait.
<LdBeth> Why not use REDUCE?
<aeth> Reduce for operations on a short vector of known length? The problem is no compiler afaik loop unrolls here.
<shka_> sbcl?
<aeth> Using reduce will provide a shorter disassembly, but slightly slower code. Even in SBCL.
<aeth> Unless that got patched in the past year.
doesthiswork has quit [Quit: Leaving.]
<shka_> well ok
<aeth> It'll loop over vectors of length 3 and 4 with known length.
<shka_> ok, good to know
<aeth> I'm not sure what the optimal length is for loop unrolling if you want speed over compactness, but I don't think SBCL tries.
<mfiano> pillton: ok
<pillton> mfiano: There you go.
<pillton> mfiano: Third comment.
fikka has quit [Ping timeout: 248 seconds]
littlelisper has joined #lisp
<pillton> I stuffed it again.
<mfiano> Thanks
<mfiano> Reading
doesthiswork has joined #lisp
<aeth> What I personally do is have a custom setf taking in multiple values that becomes a psetf for lengths 2, 3, and 4 and then I use reduce for longer ones.
<pillton> mfiano: Ok I fixed it.
<pillton> This interface doesn't make sense in my opinion.
<mfiano> Oh?
wigust has joined #lisp
Domaldel has quit [Quit: Leaving]
<mfiano> Yeah that method is not going to scale well to quaternions and matrices.
<mfiano> and dual quaternions
<pillton> You require the introduction of a temporary variable to store the addition of the arguments. I avoided having to allocate a new vec4 by looping over each element and using a lexical variable to store the summation.
<pillton> You are going to get a performance hit since you are not captialising on locality of reference.
<mfiano> Looks like I should just forget about variadic arithmetic, which was my whole use-case for trying this library.
<pillton> So you either cons and captialise on locality of reference, or not cons and do not.
littlelisper has quit [Quit: leaving]
pierpal has joined #lisp
JuanDaugherty has quit [Quit: Exeunt]
<pillton> You still need a library like specialization store to do what you are doing. Consider the axpy operation in BLAS i.e. Y := aX + Y. It is defined for vectors of numbers but you need specializations to make it fast for subtypes of the NUMBER type like single floats and double floats.
fikka has joined #lisp
<mfiano> Oh, this library will only be for aggregates of single-floats
pierpal has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 264 seconds]
nopf has quit [Remote host closed the connection]
fikka has joined #lisp
<pillton> Then there is no real need for you to use it then.
<mfiano> The other reason was so that I could have the same package/symbol for different aggregate types, like vec3, mat4x4, etc
<mfiano> The problem there though is that mat2x2 and vec4 are the same type
erratic has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
cpape has quit [Ping timeout: 256 seconds]
Bike has quit [Quit: Lost terminal]
Marumarsu has joined #lisp
shangul has joined #lisp
al-damiri has quit [Quit: Connection closed for inactivity]
Marumarsu has quit [Read error: Connection reset by peer]
fikka has joined #lisp
MoziM has quit [Ping timeout: 264 seconds]
sabrac has joined #lisp
MoziM has joined #lisp
shangul has quit [Ping timeout: 260 seconds]
fikka has quit [Ping timeout: 256 seconds]
doesthiswork has quit [Quit: Leaving.]
<pillton> I suggest not making them the same type.
<mfiano> Well that's a problem in itself
<mfiano> This library is designed for cl-opengl, where these types are passed wholesale as flat arrays
vlatkoB has joined #lisp
khrbt has quit [Quit: ZNC 1.6.5 - http://znc.in]
<pillton> Then restrict that to the interface between your code and cl-opengl.
khrbt has joined #lisp
<aeth> pillton: Generally I solve the cons vs. no-cons dilemma by implementing both and leaving it up to the user.
fikka has joined #lisp
<pillton> aeth: That is what I do as well.
fikka has quit [Ping timeout: 265 seconds]
graphene has quit [Remote host closed the connection]
fikka has joined #lisp
graphene has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
shangul has joined #lisp
fikka has joined #lisp
sauvin has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
Mezzie has quit [Ping timeout: 260 seconds]
<mfiano> pillton: I ran into a problem
Inline has quit [Quit: Leaving]
Pixel_Outlaw has quit [Quit: Leaving]
<mfiano> pillton: The first one should be destructive. The second one should just allocate a new zero vector. I'm not sure why the firist specialization is not being called: https://gist.github.com/mfiano/15c233d147f7e9c4b08aee4beedc176a
Kundry_Wag has joined #lisp
<pillton> What does it do with ((out null)) instead of (out)?
<SaganMan> Morning Peeps
nickenchuggets has quit [Quit: Leaving]
<mfiano> pillton: the null one is always dispatched
<mfiano> the problem is the vec4 specialization is never called
Kundry_Wag has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
<mfiano> pillton: This is only a problem when there are only optional arguments. I cannot reproduce if i make the store function have a required parameter first
<mfiano> maybe a bug?
shangul has quit [Quit: sudo rm -rf /usr/*]
fikka has quit [Ping timeout: 276 seconds]
lavaflow has quit [Quit: WeeChat 2.1]
buffergn0me has joined #lisp
<pillton> Ah. It has to be ((out null)).
<pillton> You need to delete the specialization that was (out).
<mfiano> How do I do that, just make the store unbound?
lnostdal has joined #lisp
<pillton> That will do. There is a way to do it, but it would take me longer to type.
flamebeard has joined #lisp
dcluna has quit [Ping timeout: 256 seconds]
fifi-v has joined #lisp
<pillton> The specialization with (out) is equivalent to ((out t)). When the let form is compiled, the store compiler macro determines that the argument is of type T and inlines the call.
<mfiano> Ah that makes sense.
<mfiano> Thank you.
dcluna has joined #lisp
<pillton> In the future, can you please paste me code that I can run.
<mfiano> Sure.
<pillton> You are making me work too hard.
fifi-v has left #lisp ["ERC (IRC client for Emacs 25.3.1)"]
johnnymacs has joined #lisp
mindCrime_ has joined #lisp
<pillton> :)
fikka has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
igemnace has joined #lisp
gector has quit [Read error: Connection reset by peer]
gector has joined #lisp
<pillton> mfiano: You can see the specializations for a given function using (store-specializations (find-store 'zero)).
<mfiano> Thanks.
<MoziM> are elisp questions allowed here?
<pillton> MoziM: You should try in #emacs. This channel is about common lisp.
<pillton> I think elisp questions are tolerated if they are to do with SLIME though.
<mfiano> I'm really having fun with this library. I'm sort of mixing functionality of specialization-store and trivia pattern matching to do some nice things.
<MoziM> pillton: err nvm... i just figured it out, what i thought was an elisp +
fikka has joined #lisp
<MoziM> err part of elisp like '+' or '-' was just a stupid local variable name...
mindCrime_ has quit [Ping timeout: 268 seconds]
<MoziM> (dotimes (_ (if (numberp NUM) (abs NUM) 5 ))
<MoziM> the '_' threw me off
johnnymacs has quit [Ping timeout: 260 seconds]
scymtym has quit [Ping timeout: 268 seconds]
fikka has quit [Ping timeout: 240 seconds]
MichaelRaskin has quit [Quit: MichaelRaskin]
FreeBird_ has quit [Remote host closed the connection]
siraben has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
bjorkintosh has quit [Ping timeout: 248 seconds]
shrdlu68 has joined #lisp
montxero has quit [Quit: leaving]
EvW has joined #lisp
lnostdal has quit [Ping timeout: 240 seconds]
wheelsucker has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 240 seconds]
merodix has joined #lisp
deng_cn has joined #lisp
mathZ has quit [Remote host closed the connection]
mlf|2 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
shrdlu68 has quit [Ping timeout: 256 seconds]
Smokitch has joined #lisp
Murii has joined #lisp
Deathspe11 has left #lisp ["ERC (IRC client for Emacs 25.3.1)"]
makomo has joined #lisp
EvW has quit [Ping timeout: 255 seconds]
Murii is now known as Murii_
schweers has joined #lisp
ebrasca has quit [Ping timeout: 255 seconds]
ebrasca has joined #lisp
nanoz has joined #lisp
vertigo has quit [Ping timeout: 256 seconds]
vertigo has joined #lisp
fikka has joined #lisp
scymtym has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
shka_ has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
SaganMan has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 255 seconds]
shrdlu68 has joined #lisp
fikka has joined #lisp
dddddd has joined #lisp
matchray is now known as meowray
Demosthenex has joined #lisp
<Demosthenex> hrm. i was looking at cl-ncurses, cl-charms, and croatoan, and none seem to provide a link to the ncurses forms library. is there an alternative?
nowhereman_ has quit [Ping timeout: 256 seconds]
<Demosthenex> i'm setting up my cl environment again, i missed slime. ;] found great instructions for running ncurses apps in another terminal and linking into emacs for testing
<jackdaniel> Demosthenex: forms bindings are not written in cl-charms
<jackdaniel> nor lpanel and the third one
<jackdaniel> I've written samll "crash course" for cl-charms if you are interested: http://turtleware.eu/posts/cl-charms-crash-course.html
spiaggia has joined #lisp
<Demosthenex> jackdaniel: i had just read that =]
<Demosthenex> thing is, i just want to get some personal best practices for writing fast TUI CRUDs...
heisig has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
xrash has quit [Ping timeout: 248 seconds]
kristof has joined #lisp
<kristof> I have just learned that you can capture a go tag in a closure, pass that closure into a function, and still execute that function which will "jump" to the go tag, even though the go tag is not in lexical scope (because the tag has dynamic extent. This at least works on clisp.
<kristof> Does anyone know of anything cool you could do with that?
buffergn0me has quit [Ping timeout: 240 seconds]
<loke> kristof: Yes. as long as it still is within its dynamic extent
<kristof> Seems like it might be interesting for factoring out (and composing separate) state machines..
<loke> kristof: it's one way of doing it, sure. :-)
<loke> More common is to simply have the state machine being a huge ECASE form.
<kristof> Yes, probably.
<kristof> I have no idea why I would want to capture a go tag then, haha.
<jackdaniel> kristof: it is not portable
<jackdaniel> you may be interested in reading http://www.lispworks.com/documentation/HyperSpec/Issues/iss152_w.htm
<jackdaniel> nice cleanup issue about exit-extent
<jackdaniel> most (if not all) CL systems implement medium-extent afaik, but minimal-extent would be also conforming
<Demosthenex> jackdaniel: seems a shame to reimplement forms functionality if ncurses has it already ;]
<jackdaniel> Demosthenex: yes, given enought time™ I've wanted to make a contribution to cl-charms adding bindings in question
<Demosthenex> jackdaniel: know an alternative?
<spiaggia> kristof: The go tag *is* in lexical scope. Otherwise the code won't compile.
<Demosthenex> i'm a newb a the lib scene :P
<jackdaniel> but I'm time deprived unfortunately, I still have some PR to review and other things
<jackdaniel> Demosthenex: the easiest road would be providing bindings to cl-charms/ll via cffi
<kristof> Interesting, thanks jackdaniel
<jackdaniel> there isn't that many functions to add
<Demosthenex> i wouldn't ask more time, and i like the tutorial. just looking for whats available instead of reinventing
<spiaggia> jackdaniel: It *is* portable as long as the tag has not been abandoned.
<jackdaniel> Demosthenex: as I said, making contribution to cl-charms library with bindings to form/panel (as an optional system to load) is the best course of action 9imho)
<Demosthenex> jackdaniel: guess its a better use of time to learn a bit about cffi than reinventing ;]
<Demosthenex> i'll look at it
<jackdaniel> spiaggia: what do you mean by "abandoned" in this context?
<jackdaniel> ah, the term is explained in the writeup
<spiaggia> Yeah.
<spiaggia> But kristof used some strange terminology. The tag is still in the lexical scope.
nowhereman_ has joined #lisp
varjag has joined #lisp
<kristof> That was in error, what I meant was that the invocation of the closure occurs in a place where the go tag is not in lexical scope, which is sort of a trivial thing to say when it relates to the capture of variables, but for a go tag that behavior is quite surprising.
shrdlu68 has quit [Ping timeout: 256 seconds]
<kristof> Some of these examples are quite interesting, especially the ones with unwind-protect. I hadn't ever considered these kinds of situations before.
MoziM has quit [Quit: WeeChat 2.1]
<aeth> I'd try running your test case on as many implementations as possible (roswell is good for this)
<loke> aeth: I'm pretty sure the precise usae case noted by kristof is documented in the CLHS
<spiaggia> kristof: If the go tag is not in lexical scope, your program won't compile, like I said.
robotoad has quit [Quit: robotoad]
<spiaggia> kristof: Lexical scope is a static thing. You can determine it by looking at the code of your program.
<loke> spiaggia: what he is surprised about is the fact that you can leave lexical scope, and then return to it, and even is such case the GO works.
<spiaggia> YOU CAN'T LEAVE THE LEXICAL SCOPE. IT IS STATICALLY DEFINED.
<kristof> Now, now. No need to get testy.
<loke> spiaggia: You can: (let ((x ...)) (im-leaving-the-scope-now))
<loke> (defun im-leaving-the-scope-now () (im not in scope of X now))
<jackdaniel> loke: function definition was never in lexical scope you have mentioned
<jackdaniel> so it has never left it
<shka> yup
<loke> jackdaniel: Right, but the execution has moves to part of the code that is not in the lexical scope
<spiaggia> loke: Fine. But then the program won't compile, because the tag would be referred to in the (im not in...)
<shka> loke: lexical scope is mostly compilation thing
<shka> not runtime thing
<jackdaniel> I think that you mix up terminology what is highly confusing
<jackdaniel> (to me at least)
<loke> spiaggia: right, but what he does is this: (tagbody (labels ((foo () (go X))) (leaving #'foo) ...)
<loke> then you can do (defun leaving (fn) (funcall fn))
<spiaggia> kristof: I think what you mean is that the tag has been "abandoned" by the fact that the invocation that created it is no longer active.
milanj has joined #lisp
<jackdaniel> kristof: if I understand correctly you are amused, that closure defined in a lexical scope of a tag, executed in a dynamic extent of this tag works, while when closure leaves this dynamic extent – it ceases working
<spiaggia> loke: I think he means that CLISP allows him to GO to a label, even though, as an exit point, it has been abandoned.
<kristof> I think that's what I meant to say, right.
<kristof> loke's code is what I was referring to.
<loke> I see. I had no idea there was any Lisp that allowed that.
<spiaggia> kristof: That is NOT portable. It is undefined behavior.
<loke> My code is allowed
<spiaggia> Sure.
<spiaggia> I just wanted to set kristof straight, so that we can all understand what he is doing.
<loke> But if you try to call that closure outside, after the tagbody ias abanodnded, you should get an error
<loke> (it's undefined behaviour if I'm not mistaken)
<spiaggia> loke: Yes, so no error required.
<loke> spiaggia: I'm not too familiar with Scheme, but I believe that if one really wants to do that, you need to use call-with-current-continuation
<spiaggia> Indeed.
<loke> In Scheme, not CL
robotoad has joined #lisp
housel has quit [Remote host closed the connection]
random-nick has joined #lisp
<shka> if you need to do stuff like that, just use functions
<jackdaniel> what do you mean?
<shka> go from closure to outer env
<shka> you can enclose multiple functions over each other with labels
<shka> it is not exactly the same thing, but it can fullfill the same purpose
<jackdaniel> I think that kristof has said explicitly, that he find it amusing but can't find a practical purpose for such practice
<shka> oh, ok
<jackdaniel> so it was mostly backlog passage about exit-extent, scopes and terminology
_cosmonaut_ has joined #lisp
<shka> i see
<shka> i was going to point toward pandoric macros, but i guess it is irrelevant
<kristof> I'm not sure how the compiler even keeps track of it. Is there runtime information associated with gotags that are active?
xantoz has quit [Ping timeout: 256 seconds]
johnnymacs has joined #lisp
xantoz has joined #lisp
<spiaggia> kristof: In a Common Lisp implementation that tries to signal an error when a go tag is abandoned, yes, such information is kept.
<kristof> If go tags are non-escaping then (go tag) is a mere branch but if it is escaping, then you kind of need a complicated bureaucracy to keep track of when it's valid to jump or not...
<kristof> I see. Well, I'll be sure to not write code that bizarre. :P
<spiaggia> Even if they are not escaping, and they are nested inside another function, the GO is not trivial. All intervening stack frames must be popped, and UNWIND-PROTECTs must be executed.
wigust- has joined #lisp
<spiaggia> kristof: As in (tagbody label ... (flet ((fun (...) (go label))) (fun ...)))
<spiaggia> kristof: Here, FUN is not escaping. It is only called.
<kristof> You're right, I spoke too soon.
wigust has quit [Ping timeout: 264 seconds]
<spiaggia> kristof: The best way of learning this stuff is to work on some implementation.
<kristof> Do you work on one?
rippa has joined #lisp
xificurC has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
dmiles has quit [Ping timeout: 256 seconds]
nanoz has quit [Ping timeout: 265 seconds]
logicmoo has joined #lisp
<spiaggia> Er, yes. Lo]
<spiaggia> sorry
<spiaggia> look up "spiaggia" in your Italian-English dictionary.
pierpal has joined #lisp
<TMA> spiaggia: Spiaggia is a restaurant in Chicago on North Michigan Avenue.
<loke> Or in a Swedish dictionary
<spiaggia> TMA: Oh, nice! Italian, I presume?
lumm has joined #lisp
MoziM has joined #lisp
<spiaggia> minion: Please tell kristof about SICL.
<minion> kristof: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
<kristof> Oh, haha. I did not recognize the nick.
<spiaggia> I have a new computer, so I needed a second nick.
<kristof> I apologize for calling you testy earlier, and for being imprecise with my vocabulary.
xificurC has joined #lisp
<spiaggia> No worries.
<kristof> To a compiler writer that would be very annoying indeed.
<spiaggia> I think one of the strong points of #lisp is that we can avoid many meaningless discussions by using accepted terminology.
nanoz has joined #lisp
<jackdaniel> this may be considered as disadventage, because newcomers may be frequently bashed and disheartened to carry on after a short period of time
<kristof> I have no excuse, I'm not so new.
<jackdaniel> (and since they are newcomers it is hard to expect of them to know the correct terminology right of the bat)
<spiaggia> jackdaniel: Well, we try to use a soft tone of voice when we explain it to them.
_cosmonaut_ has quit [Ping timeout: 245 seconds]
cpape has joined #lisp
<spiaggia> jackdaniel: I think it would be worse NOT TO explain it to them.
<jackdaniel> in contrast to "we", there is a reasonable amount of "they" who do not use a soft tone. also many new terms (which are estabilished in Lisp community, but not in, say C# community) confuse even further. I'm not saying that using correct terminology is not an adventage
<jackdaniel> I'm just saying that it is a disadventage *at the same time*
<spiaggia> Got it.
<spiaggia> kristof: So let me know when you feel ready to help out with SICL. :)
<jackdaniel> [if enforced, and enforcement is necessary to keep discussion using "correct" terminology]
<kristof> Lol
* spiaggia was only half joking.
<kristof> Well, spiaggia, I was rereading my book on compilers lately. And I was thinking that this new fangled web assembly business is interesting...
<spiaggia> Interesting that you should mention that.
<kristof> Is SICL still your one man show?
<spiaggia> Not really, no.
<kristof> A lot of contributors, then?
<spiaggia> Bike is doing work on the compiler framework (Cleavir) and so is karlosz who is writing a Cleavir-based compiler for SICL.
<spiaggia> And heisig is working on some aspects of Cleavir as well.
<spiaggia> Not "a lot of". I think that sums it up.
<kristof> Oh, I've been meaning to ask what the difference between Cleavir and Sicl is...
<spiaggia> Er, sorry, karlosz is writing a Cleavir-based compiler for CLISP, not SICL.
<spiaggia> minion: Please tell kristof about Cleavir.
<minion> kristof: Cleavir: A project to create an implementation-independent compilation framework for Common Lisp. Currently Cleavir is part of SICL, but that might change in the future
<kristof> Well Cleavir is also used by Clasp, right?
<spiaggia> kristof: I try to extract independent repositories whenever practical.
<spiaggia> kristof: Yes, that's why Bike is working on it.
<kristof> I see. Does Dr. Meister still pop in over here?
<spiaggia> kristof: So the reader has been extracted and become Eclector which scymtym is maintaining.
<kristof> All these funny names... :p
<spiaggia> He does, but mostly to ask questions. Otherwise, he is in #clasp.
<spiaggia> kristof: And I extracted the code for concrete syntax trees to a separate repository as well.
<kristof> Sounds like you're all very busy. That's cool, I'm glad to hear it.
<kristof> I'm a dilettante so I doubt I would be any real help :P
<spiaggia> Aww!
joh11 has joined #lisp
<jackdaniel> if you think about it, it is easier to shift from dilettante to expert than the other way around
<jackdaniel> so you are in quite a good position, you may strive to whatever goal you want
Arcaelyx has quit [Quit: Textual IRC Client: www.textualapp.com]
ebrasca has quit [Read error: Connection reset by peer]
ebrasca has joined #lisp
Smokitch_ has joined #lisp
kuribas has joined #lisp
robotoad has quit [Quit: robotoad]
Smokitch has quit [Ping timeout: 256 seconds]
johnnymacs has quit [Ping timeout: 276 seconds]
thodg has joined #lisp
paule32 has quit [Read error: Connection reset by peer]
_cosmonaut_ has joined #lisp
oni-on-ion has quit [Ping timeout: 264 seconds]
Bike has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
graphene has quit [Remote host closed the connection]
jmercouris has joined #lisp
fikka has joined #lisp
<jmercouris> can someone explain this? https://gist.github.com/d14e554d21b0a18fb4ffb9b09b401f9b
m00natic has joined #lisp
<jmercouris> why does my list sometimes appear horizonal and sometimes vertical
<jmercouris> when does it decide to indent?
graphene has joined #lisp
<ecraven> something with pretty printing
<jackdaniel> *print-right-margin* is one of deciding factors
<jackdaniel> basically what ecraven said
<ecraven> jackdaniel: well, mine was a bit more hand-wavey
<jmercouris> Okay
<trittweiler> jmercouris, the pretty-printer treats a list with symbol IF specially
<jmercouris> I guess it doesn't matter
<jmercouris> just curious
<jmercouris> oh, that would make sense actually
<jmercouris> does it do that with other reserved keywords?
<trittweiler> you can disable that by not using the default *pretty-print-dispatch*
<jackdaniel> I'm glad I could answer your question which didn't hold any matter in it :)
<jackdaniel> what are reserved keywords?
<joh11> empirically it also does the same thing with let and let*
<jackdaniel> (most notably: what are they in this context, but I'm curious about general meaning too)
<trittweiler> it's up to the implementation I would guess. (this knowledge is paged out of my memory,it's been years)
<jmercouris> symbols defined/reserved by the common lisp standard
<trittweiler> you can invoke the inspector on *pretty-print-dispatch* and have a look
<jackdaniel> I don't think any symbol in keyword package is reserved
<jmercouris> usually the term "reserved keywords" is used in other languages
<jmercouris> not in the keyword package
<ecraven> trittweiler: cl-user does not contain that symbol on my sbl
<jackdaniel> I've heard "reserved word"
<ecraven> sbcl
<jackdaniel> eventually "reserved identifier"
joh11 has quit [Quit: Leaving]
<trittweiler> ecraven: It's *print-pprint-dispatch*
<jmercouris> "https://en.wikipedia.org/wiki/Reserved_word" --> The terms "reserved word" and "keyword" are often used interchangeably – one may say that a reserved word is "reserved for use as a keyword" – and formal use varies from language to language; for this article we distinguish as above.
<jmercouris> I understand symbols don't work that way
<jackdaniel> jmercouris: so you have provided a hybrid, *reserved* keyword :)
<jmercouris> but I was trying to convey the concept, I can't think of another way to call them
<jmercouris> I think I may be a little bit dyslexic :D
milanj has quit [Quit: This computer has gone to sleep]
<jmercouris> is there a doubly linked list implementation built into CL?
<shka> not in the standard
<shka> double linked lists are moderatly useful anyway
<LdBeth> defstruct
<LdBeth> one.
<jmercouris> I don't see how defstruct is a built in doubly linked list, of course you could make any structure using structs
<jmercouris> I could say the same thing about any data structure
<jmercouris> "are trees built into lisp?"
<jmercouris> defstruct one.
<ecraven> it's trivial to construct trees from conses
<jmercouris> it was just an example, but yes
<jmercouris> I actually prefer to work with trees as composed of structs rather than lists, mentally it is much easier for me
<LdBeth> What’s any difference between builtin and user defined?
<Bike> only one involves me writing a defstruct
<shka> i think you may find double linked lists on quicklisp
<jmercouris> (if (built-in-p desired-functionality) (save-time) (waste-time))
<shka> probabbly multiple linked lists actually ;]
paule32 has joined #lisp
<jmercouris> Is there a list of data structures built in that I can refer to?
<Bike> the clhs chapter index, basically.
<flip214> varjag: re A tiny Lisp bytecode interpreter in Z-80 assembly: "erorr" => "error", and (C) 2017 in the bottom.... ;)
lumm has quit [Ping timeout: 240 seconds]
paule32 has quit [Ping timeout: 240 seconds]
<varjag> flip214: heh thanks :)
thodg has quit [Ping timeout: 260 seconds]
<varjag> mark&speep too.. i either had too much coffee, or too little
<flip214> oh, and I missed that? I'm getting old...
<flip214> ah, perhaps because there were no spaces around &, that made me skip that non-whitespace-sequence
orivej has joined #lisp
nanoz has quit [Ping timeout: 240 seconds]
paule32 has joined #lisp
SaganMan has joined #lisp
<Xach> ebzzry: sure
makomo has quit [Ping timeout: 248 seconds]
makomo has joined #lisp
JuanDaugherty has joined #lisp
ogamita has joined #lisp
ogamita has quit [Read error: No route to host]
Kundry_Wag has joined #lisp
markoong has joined #lisp
kerframil has joined #lisp
milanj has joined #lisp
Kundry_Wag has quit [Ping timeout: 255 seconds]
lumm has joined #lisp
ogamita has joined #lisp
JuanDaugherty has quit [Quit: Exeunt]
Ukari has quit [Remote host closed the connection]
brendarn has quit [Ping timeout: 240 seconds]
jmercouris has quit [Remote host closed the connection]
thodg has joined #lisp
Ukari has joined #lisp
Ukari has quit [Changing host]
Ukari has joined #lisp
AetherWind has quit [Quit: Leaving]
thodg has quit [Read error: Connection reset by peer]
dilated_dinosaur has quit [Remote host closed the connection]
lumm has quit [Ping timeout: 256 seconds]
thodg has joined #lisp
scymtym has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
bjorkintosh has joined #lisp
<kuribas> doesn't defclass create an initialization function?
<kuribas> I am getting "There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION COMMON-LISP:INITIALIZE-INSTANCE (7)>"
<kuribas> this is my class definition: (defclass lazy-stream (sequence) ((list :initarg :list :accessor stream-list)))
<shka> cl:sequence ?
<kuribas> yes
<shka> i don't think you are supposed to do that, but anyway
<shka> generated initialize-instance contains call-next-method
<shka> and i don't think that cl:sequence is required to have initialize-instance
<kuribas> sbcl lets me subclass it
<shka> you may need to roll your own initialize-instance if you want to do that
<kuribas> hmm, strange
<shka> however, i advice against it because, well, there is no benefits
<shka> although sbcl sequence protocol is extendable, it is not portable
scymtym has joined #lisp
<kuribas> shka: I don't need it to be portable
<shka> well, in that case, have fun
<shka> anyway, i think that replacing default initialize-instance method should work
<ogamita> kuribas: sequence is an abstract class, so you cannot (make-instance 'sequence) or (initialize-instance (make-instance 'sequence)).
<ogamita> this is why you need to implement your own initialize-instance, and not (call-next-method).
<kuribas> ah ok, thanks
fikka has quit [Ping timeout: 264 seconds]
<kuribas> that seems to work
shangul has joined #lisp
<kuribas> how can I reload a defconstant?
kajo has quit [Ping timeout: 245 seconds]
<ogamita> you can only if the new value is the same as the old, same being the technical term defined in the glossary of clhs.
<ogamita> ie. basically, EQL.
<ogamita> Which means that the only values you can meaningfully define as constants are numbers, characters and symbols.
<kuribas> is a defconstant dynamic?
<ogamita> Nope. But since it cannot be rebound, it doesn't matter.
<kuribas> I want to define a global lexical scoped variable
<ogamita> (defconstant +foo+ 42) (let ((+foo+ is invalid.
<kuribas> right
<ogamita> this doesn't exist in CL. BUt you can implement it with define-symbol-macro, since symbol-macros are global lexical bindings.
<ogamita> kuribas: check defglobal or deflex in various libraries.
<kuribas> doesn't seem like a sensible default
<ogamita> find ~/quicklisp -name \*.lisp -exec grep -nHi -e 'defglobal\|deflex' {} +
<ogamita> for example, in deflex in repl-utilities.
kristof has quit [Read error: No route to host]
kristof has joined #lisp
kristof has quit [Client Quit]
fikka has joined #lisp
_cosmonaut_ has quit [Ping timeout: 256 seconds]
makomo has quit [Ping timeout: 248 seconds]
thodg has quit [Read error: Connection reset by peer]
heisig has quit [Quit: Leaving]
Kundry_Wag has joined #lisp
ogamita has quit [Ping timeout: 268 seconds]
attila_lendvai has quit [Quit: Leaving.]
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
attila_lendvai has quit [Client Quit]
nowhereman_ has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Ping timeout: 256 seconds]
graphene has quit [Read error: Connection reset by peer]
shangul has quit [Remote host closed the connection]
graphene has joined #lisp
EvW has joined #lisp
ogamita has joined #lisp
thodg has joined #lisp
Kundry_Wag has joined #lisp
shangul has joined #lisp
ogamita has quit [Ping timeout: 245 seconds]
dddddd has quit [Ping timeout: 276 seconds]
dddddd has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
skapata has joined #lisp
doesthiswork has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
pierpal has quit [Quit: Poof]
Kundry_Wag has quit [Ping timeout: 240 seconds]
pierpal has joined #lisp
thodg has quit [Ping timeout: 265 seconds]
dddddd has quit [Ping timeout: 256 seconds]
dddddd has joined #lisp
makomo has joined #lisp
patlv has joined #lisp
_cosmonaut_ has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
housel has joined #lisp
vlad_ has joined #lisp
Kundry_Wag has joined #lisp
rumbler31 has joined #lisp
patlv has quit [Remote host closed the connection]
patlv has joined #lisp
rumbler31 has quit [Ping timeout: 276 seconds]
deng_cn has quit [Quit: deng_cn]
<kuribas> is it not possible to have optional and keyword arguments?
<kuribas> I have (defun enum-from (start &optional end &key (step 1)) ... )
<kuribas> but (enum-from 1 :step 2) gives an error
<TMA> kuribas: it is possible. you need to supply all the optionals before any keyword arguments
attila_lendvai has quit [Read error: Connection reset by peer]
<kuribas> I did...
<kuribas> I still get "odd number of &key arguments"
shangul has quit [Quit: sudo rm -rf /usr/*]
<TMA> kuribas: no, you didn't. you need (enum-from 1 100 :step 2)
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
<trittweiler> (enum-from 1), (enum-from 1 10), (enum-from 1 10 :step 2)
attila_lendvai has quit [Read error: Connection reset by peer]
<kuribas> TMA: I want to omit end
<TMA> kuribas: make it keyword argument too, then
<trittweiler> (enum-from 1 nil :step 2)
<kuribas> hmm, ok
kajo has joined #lisp
Kundry_W_ has joined #lisp
<kuribas> I also read that keyword arguments are very inefficient, is that true?
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
<TMA> it might be, for suitable definitions ov very and inefficient
<TMA> kuribas: but then it might not, because in most cases the inefficiencies can be optimized away; you need to profile your code to discover real bottlenecks
<spiaggia> kuribas: If you care about performance with keyword arguments, you might write a compiler macro that turns the all into one with only required arguments. Or you can hope that the author of the function did.
<spiaggia> Modulo bad grammar on my part, that is.
<spiaggia> "turns the call"
<kuribas> TMA: I read it in paradigms of AI, which is quite old
Kundry_W_ has quit [Ping timeout: 240 seconds]
<spiaggia> Hmm, maybe compiler macros were introduced later?
<TMA> spiaggia: I think it is permissible for the compiler to perform this kind of optimization even without a compiler macro, am I right?
<spiaggia> TMA: I don't see how it could do that.
patlv has quit [Ping timeout: 240 seconds]
patlv has joined #lisp
edgar-rft has joined #lisp
<spiaggia> TMA: The compiler must account for the possibility that the definition of the callee changes after the call site has been compiled.
<TMA> spiaggia: if the compiler knows the called function lambda list, it can perform the equivalent of the macro. moreover for each function, the compiler can produce two entry points, one with the arguments being required
fikka has quit [Ping timeout: 248 seconds]
<TMA> spiaggia: even for functions declaimed inline in the same translation unit?
<spiaggia> OK, that's different.
<spiaggia> That might be possible, yes.
* TMA might be mistaken, it has been way too long since last reading of the relevant hyperspec parts
<spiaggia> I think you are right. For functions in the same compilation unit, all kinds of tricks are possible.
<spiaggia> Uh oh. Bad thunderstorm on the way.
<kuribas> is this the right way to implement elt? (defmethod elt ((stream lazy-stream) index) .. )
<kuribas> I am getting: "ELT already names an ordinary function or a macro."
<spiaggia> kuribas: ELT is not a generic function.
<spiaggia> So you can't add methods on it.
<kuribas> spiaggia: the documentation says otherwise
<spiaggia> Oh?
<spiaggia> clhs elt
attila_lendvai has quit [Read error: Connection reset by peer]
<spiaggia> It says "accessor".
dilated_dinosaur has joined #lisp
<spiaggia> kuribas: That's the function named by sb-sequence:elt, not cl:elt.
<spiaggia> kuribas: It gives that package name after the function name.
<kuribas> they are different?
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<spiaggia> Yes, because cl:elt is not a generic function in general.
<kuribas> ah, sb-sequence:elt works.
<kuribas> thanks
<spiaggia> kuribas: I think SBCL implements this extension by doing what a standard implementation would do, and then call the generic function if the type turns out to be something other than list or vector.
<Xof> that's right
muyinliu has joined #lisp
<spiaggia> kuribas: If they didn't do it that way, they would slow down these functions for ordinary use.
<Xof> it does also implement sb-sequence:elt on list and vector, just in case a user decides to call that explicitly rather than cl:Elt
<spiaggia> OK, that's good.
<kuribas> spiaggia: right
Kundry_W_ has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
muyinliu has quit [Client Quit]
Kundry_Wag has quit [Ping timeout: 245 seconds]
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
<Xof> and yes, one of the design goals of this extension was that the cost of having but not using it should be unmeasurable
attila_lendvai has quit [Read error: Connection reset by peer]
<spiaggia> Quite reasonable.
Inline has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
fikka has joined #lisp
patlv has quit [Ping timeout: 256 seconds]
attila_lendvai has quit [Client Quit]
fikka has quit [Ping timeout: 256 seconds]
thodg has joined #lisp
FreeBirdLjj has joined #lisp
fikka has joined #lisp
hhdave has joined #lisp
igemnace has quit [Quit: WeeChat 2.1]
fikka has quit [Ping timeout: 245 seconds]
_cosmonaut_ has quit [Ping timeout: 264 seconds]
SenasOzys has joined #lisp
thodg has quit [Read error: Connection reset by peer]
SenasOzys has quit [Remote host closed the connection]
SenasOzys has joined #lisp
raynold has quit [Quit: Connection closed for inactivity]
<kuribas> lol (sb-sequence:make-sequence-like "abc" 5 :initial-element #\Space :initial-contents "hello") gives error "foo"
<kuribas> :-)
<jackdaniel> sounds reasonable, definetely looks like a foo
EvW has quit [Ping timeout: 255 seconds]
fikka has joined #lisp
<Xof> wait, really?
<jackdaniel> yes, I can confirm that
<jackdaniel> method calls (error "supplied both ~S and ~S to ~S" :initial-element :initial-contents 'make-sequence-like)
<Xof> so it does
<jackdaniel> so it is confusing, that it shows foo
<Xof> that is also why I am confused
<Xof> nice bug
<Xof> report it to launchpad if you want some karma
<jackdaniel> Xof: it is most likely something caused by sbcl bootstrap, when I recompile the generic function correct error is reported
<Xof> there is no instance of the string "foo" anywhere in sbcl lisp sources
<Xof> well this is going to be a fun mystery to unravel
<jackdaniel> well, there is lose("foo"); but it is only on sunos
fikka has quit [Ping timeout: 245 seconds]
pjb has joined #lisp
<jackdaniel> and a lot of "foo"s in tests/
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
housel has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
housel has joined #lisp
subroot has joined #lisp
flamebeard has quit []
<Xof> wow, I actually have no idea how this is happening
<Xof> thank you!
fikka has joined #lisp
<Xof> ok, the answer is: it's not happening in current sources
<Xof> and I remember someone merging a fix for this, come to think of it
<Xof> 1st February. Your SBCL is too old.
<jackdaniel> do you happen to remember what caused the mysterious "foo" appearance?
<jackdaniel> and why foo given there is no such string in relevant sources?
fikka has quit [Ping timeout: 276 seconds]
<spiaggia> jackdaniel: I guess foo was in there before the fix.
beach has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
patlv has joined #lisp
<jackdaniel> in that case I have wrong sources installed with my sbcl binary
spiaggia is now known as beach
<beach> Hmm.
<jackdaniel> but yes, that's most likely the case, because I see the commit
thodg has joined #lisp
<jackdaniel> these error calls indeed had "foo" and "bar" strings instead of an informative error message
<jackdaniel> s
<jackdaniel> hm, my fault. it seems I have hand-built sbcl in my PATH (from git) from quite some time ago, but I had to pull from the repository later
<jackdaniel> without rebuilding
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has quit [Read error: Connection reset by peer]
Kundry_W_ has quit [Remote host closed the connection]
ogamita has joined #lisp
benny has quit [Quit: ZNC - http://znc.in]
EvW1 has joined #lisp
lumm has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
benny has joined #lisp
benny is now known as Guest33773
attila_lendvai has quit [Read error: Connection reset by peer]
fikka has joined #lisp
<Xof> everyone is a winner!
Guest33773 is now known as benny
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has quit [Read error: Connection reset by peer]
EvW1 has quit [Ping timeout: 255 seconds]
nowhereman_ has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
cage_ has joined #lisp
vlad_ is now known as _Murii
patlv has quit [Ping timeout: 276 seconds]
edgar-rft has quit [Quit: edgar-rft]
fikka has joined #lisp
<kuribas> Xof: I used apt get
<kuribas> Xof: 1.3.1 Debian
<kuribas> Xof: are you a sbcl maintainer?
fikka has quit [Ping timeout: 276 seconds]
Kundry_Wag has joined #lisp
<beach> kuribas: Usually, you need to go to the sourceforge site and download a binary.
<beach> kuribas: Or you can compile it yourself.
<beach> kuribas: As I understand it, the OS-supplied packages are typically very old.
<kuribas> that's true in general
<Xof> kuribas: I am an sbcl maintainer
attila_lendvai has quit [Read error: Connection reset by peer]
nickenchuggets has joined #lisp
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
fikka has joined #lisp
<cage_> FWIW, the SBCL version in debian testing is near to the latest official release
Kundry_Wag has quit [Ping timeout: 276 seconds]
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
_Murii has quit [Ping timeout: 276 seconds]
milanj has quit [Quit: This computer has gone to sleep]
fikka has quit [Ping timeout: 245 seconds]
ogamita has quit [Ping timeout: 256 seconds]
xrash has joined #lisp
kjeldahl_ has quit [Ping timeout: 245 seconds]
fikka has joined #lisp
subroot has quit [Read error: Connection reset by peer]
rumbler31 has joined #lisp
attila_lendvai has quit [Read error: Connection reset by peer]
kajo has quit [Ping timeout: 265 seconds]
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
attila_lendvai has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Ping timeout: 264 seconds]
attila_lendvai has quit [Ping timeout: 255 seconds]
fikka has joined #lisp
Pixel_Outlaw has joined #lisp
vxe has joined #lisp
vxe has quit [Quit: Mutter: www.mutterirc.com]
fikka has quit [Ping timeout: 265 seconds]
<kuribas> can you define a let binding, where the binding is used in the definition?
eschatologist has quit [Ping timeout: 244 seconds]
<beach> What?
<kuribas> like (let ((rec (lambda (x) (rec ...)))) (rec ..))
<Bike> no.
<beach> Nope.
<kuribas> letrec in scheme
<beach> kuribas: Try LABELS.
<beach> kuribas: That thing would not have worked anyway, since LET is in the variable namespace, but (rec ...) refers to the function namespace.
<pjb> kuribas: yes, if it's a dynamic binding and if you call it during the dynamic scope.
<kuribas> isn't labels only for function definitions?
<beach> kuribas: (labels ((rec (x) ... (rec ...))) (rec ...))
<kuribas> I want to define a value, not a function
vxe has joined #lisp
<pjb> (locally (declare (special rec)) (let ((rec (lambda (x) (funcall #|this is common-lisp!|# rec ...)))) (funcall rec ...)))
<Bike> pjb do you just enjoy answering as unhelpfully as possible
eschatologist has joined #lisp
<beach> kuribas: You need the Y combinator then.
<_death> you can write your own LETREC... or (let (rec) (setq rec ...))
<Bike> kuribas: even in scheme, defining a recursive structure with letrec doesn't work
<kuribas> obviously I could do just (let ((x)) (setq x ...))
<kuribas> it's a bit ugly
<Bike> it's not obvious
<Bike> if you did (let (x) (setq x (list x x))) you'd end up with (NIL NIL), not a recursive structure
Kundry_Wag has joined #lisp
<kuribas> I have a lambda hidding in a macro
fikka has joined #lisp
merodix has quit [Remote host closed the connection]
<pjb> Well, implementation give an unbound variable rec in (locally (declare (special rec)) (let ((rec (lambda (x) (declare (special rec)) (if (zerop x) 1 (* x (funcall rec (- x 1))))))) (funcall rec 42))) but IMO it should not.
<pjb> There is no wherer the special variable rec is used while being unbound in this expression!
<pjb> Notice that I should not have to declare rec special inside lambda either!
<Bike> it's because since rec is only declared locally special, the let makes a lexical binding, probably
<pjb> It works if you write: (declaim (special rec)) (let ((rec (lambda (x) (if (zerop x) 1 (* x (funcall rec (- x 1))))))) (funcall rec 42))
<pjb> the lambda is local to the locally form!
<Bike> yes, but i mean, the let makes a lexical binding.
<Bike> so it's not the one the lambda refers to.
<pjb> Oh, right.
<pjb> (let ((rec (lambda (x) (if (zerop x) 1 (* x (funcall rec (- x 1))))))) (declare (special rec)) (funcall rec 42)) #| --> 1405006117752879898543142606244511569936384000000000 |#
<Bike> if you do (let ((rec ...)) (declare (special rec)) ...) it's fine.
<pjb> There.
<pjb> and even: (let ((rec (lambda (x) (if (zerop x) 1 (* x (funcall rec (- x 1))))))) (funcall rec 42)) #| --> 1405006117752879898543142606244511569936384000000000 |#
<trittweiler> kuribas: Consider (let ((x (flet ((f (a b &aux c) (incf c (+ a b)))) #'f)) ..body..)
<pjb> Oops, it's the old rec.
<pjb> (let ((foo (lambda (x) (declare (special foo)) (if (zerop x) 1 (* x (funcall foo (- x 1))))))) (declare (special foo)) (funcall foo 42))
fikka has quit [Ping timeout: 265 seconds]
<pjb> One can understand why dynamic binding was so praised in early lisps… :-)
Arcaelyx has joined #lisp
<trittweiler> kuribas: Though it depends on what you really want to achieve. If you want to really modify X (the outer binding), this won't work. But &AUX can be a concise way to get a closure
vxe has quit [Quit: Mutter: www.mutterirc.com]
<kuribas> so you can only make a circular list with mutation?
<Bike> basically. you can also use the ## reader macro.
<beach> kuribas: How else would you do it?
<trittweiler> (Actually ignore what I was saying. Brain fart. The &aux will be internally to F. Sorry for the noise)
patlv has joined #lisp
<kuribas> beach: idk, in haskell you can do "ones = 1 : ones"
<pjb> kuribas: yes. But you can use a different representation for a circular list (or structure in general) that doesn't involve mutation (and of course, that is not really circular, in terms of pointers in the processor memory.
<Bike> kuribas: that's because they have lazy evaluation. you can do similar things in lisp by keeping things in functions.
<beach> kuribas: But there has got to be some mutation underneath. You can't refer to a CONS cell before it is created.
schweers has quit [Ping timeout: 265 seconds]
<kuribas> Bike: yeah, that's what I am doing now
<pjb> functions can be "referenced" before (space) they're defined (but not "called" before (time) being defined).
fikka has joined #lisp
<pjb> This is because of those different "before" that we have to use dynamic binding when you want to use variables to refer the functions (instead of function names).
Kundry_Wag_ has joined #lisp
SenasOzys has quit [Ping timeout: 256 seconds]
nowhereman_ has quit [Ping timeout: 256 seconds]
<kuribas> right, it's impossible without lazy evaluation
<kuribas> (or mutation)
fikka has quit [Ping timeout: 260 seconds]
<loli> one often uses mutation to implement lazy structures, a controlled impurity
Khisanth has quit [Ping timeout: 265 seconds]
<shka> loli: 1+
<shka> nobody has to know that you are dirty inside
<shka> in fact large portion of charm of lazy evaluation in the context of purely functional data structures is that you can perform destructive operations in batch
<shka> and present user with functional interface
varjag has joined #lisp
<shka> which may improve performance and reduce memory allocations
<shka> you may need to somehow mark internal nodes that are safe to mutate though
fikka has joined #lisp
graphene has quit [Remote host closed the connection]
<kuribas> lazyness is great for dynamic programming
<kuribas> for example fibonacci series
<shka> personally i simply stick ownership tag into each node that is supposed to be mutated in lazy manner
<shka> simple, and works just fine
graphene has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
patlv has quit [Ping timeout: 245 seconds]
Khisanth has joined #lisp
<scymtym> i think what haskell does is similar to https://techfak.de/~jmoringe/lazy-list.lisp
varjag has quit [Remote host closed the connection]
varjag has joined #lisp
fikka has joined #lisp
<kuribas> what's the clean way to signal an error in a macro?
<_death> clhs error
Kundry_Wag_ has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 256 seconds]
kajo has joined #lisp
hhdave has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
nowhereman_ has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
Oladon has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 256 seconds]
robotoad has joined #lisp
fikka has joined #lisp
m00natic has quit [Remote host closed the connection]
MoziM has quit [Ping timeout: 240 seconds]
Kundry_Wag_ has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
pagnol has joined #lisp
shka_ has joined #lisp
lumm has quit [Ping timeout: 256 seconds]
Kundry_Wag has quit [Remote host closed the connection]
fikka has joined #lisp
SenasOzys has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
kjeldahl_ has joined #lisp
thodg has quit [Ping timeout: 276 seconds]
scymtym has quit [Read error: Connection reset by peer]
scymtym has joined #lisp
rumbler31 has joined #lisp
patlv has joined #lisp
Kundry_Wag has joined #lisp
Folkol_ has quit [Ping timeout: 248 seconds]
Kundry_Wag_ has quit [Ping timeout: 260 seconds]
megalography has joined #lisp
rumbler31 has quit [Ping timeout: 276 seconds]
sjl has joined #lisp
pseudonymous has joined #lisp
kjeldahl_ has quit [Ping timeout: 245 seconds]
<mfiano> So, I've been thinking hard about an API problem in one of my projects, and the only good solution is a _very_ bad one. Please convince me not to use keyword symbols for a few function names. :)
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
fikka has joined #lisp
lumm has joined #lisp
<pjb> mfiano: is this for your own use at the REPL (or one of your end-user programs), or is it to put in a library?
<mfiano> I'm writing a math library that does type dispatching using specialization-store. It shadows some CL symbols like `*`, `abs`, etc, in order to be concise, and because no other name really makes sense given that its functionality depends on the types of arguments. This means users will be unable to `use-package` this library's package, and prefixing every operation with `some-math-library:` will get old fast for
<mfiano> long, nested, operations. A solution that was recommended to me was to use keyword symbols, and I am hating myself for considering them.
<pjb> mfiano: if it's to put in a library, then definitely don't do that. Because if anybody else does the same, there will be a collision!
_Murii has joined #lisp
<pjb> mfiano: what you can do, is: 1- shadow them but make them compatible with CL. ie. (your-math:* matrix matrix) --> matrix, but (your-math:* number number) --> number.
pseudonymous has quit [Remote host closed the connection]
<pjb> and 2- define a cl-with-your-math package that re-exports your exported symbols, and the remaining of the CL package.
fikka has quit [Ping timeout: 260 seconds]
<pjb> then clients can (defpackage "FOO" (:use "CL-WITH-YOUR-MATH")…) instead of (:use "CL").
<mfiano> The important bit is not to mess with the performance of CL's functions, and type dispatching would hurt that
<mfiano> Unless I'm misunderstanding you
<pjb> Then let the user choose.
pseudonymous has joined #lisp
<sjl> mfiano: you could use a compiler macro to replace your special * with cl:* if the arguments are all known at compile time to be numbers
<pjb> Notice that on your own symbol, you can define a compiler macro that can dispatch to the CL function if the arguments are known at compilation-time to be numbers.
<pjb> But it's kind a special case, if you don't have type inference.
<pjb> mfiano: notice that (cl:* 1 2) is short.
<pjb> so the user can shadow-import your symbols, and still use cl functions with this short cl: prefix.
<mfiano> These are all the symbols I am shadowing https://gist.github.com/mfiano/0ba68732ab49b128120a8443e1e796d9
<pjb> it's easier than doing the other way. You shouldn't provide short package names or nicknames. Only the final user can add short nicknames. So he may write (mat:* (cl:* 3 pi) mat)
<pjb> but another user would want to use m: instead of mat: since he would have a "MAT" package about floorwear…
patlv has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
<pjb> (actually he would have a com.informatimago.augmented-reality.furniture.mat package, that, as a final user, he would nickname mat).
<pjb> Of course your math pachage would have to be nicknamed m and used to compute the 3D AR stuff…
<pjb> cf. com.informatimago.common-lisp.cesarum.package:add-nickname
<mfiano> Right. I'm trying to avoid any PLN in a library...that's for the user
<pjb> mfiano: that said, if you avoid variadic operators, you can use generic functions, and then dispatching is fast enough.
<mfiano> The very nature of this library is variadic unfortunately
<pjb> (calling a generic function is amortized to only the double time of a function call).
igemnace has joined #lisp
<_death> g* instead of * isn't so bad
<pjb> alternatively, you may use ×.
<pjb> ie. unicode.
<mfiano> gabs is pretty bad :/
<pjb> It's time we start using unicode, at least those simple characters…
fikka has quit [Ping timeout: 245 seconds]
<pjb> But again, you would provide unicode names only as an alternative to the real g* symbols.
<sjl> (defun .* (x y) (* x y))
<pjb> (defalias × g*) (defalias ÷ g/)
<mfiano> .* has a special meaning in math
<mfiano> I considered it and shot down pretty fast
littlelisper has joined #lisp
<sjl> _*, etc etc
<sjl> anything but :*
<pjb> I mean if they can use shit characters, why couldn't we use mathematical symbols?
<mfiano> primarily easy of use. if it's not ascii, it's not as easily typed for some people.
<_death> I don't think gabs is particularly bad
<mfiano> ease*
<pjb> yes, this is why it should be aliases.
<pjb> But you know, with emacs C-x 8 RET multiply sign RET is not hard to type, and you can also provide emacs keyboard macros or bindings.
sjl has quit [Quit: WeeChat 2.2-dev]
fikka has joined #lisp
<mfiano> Well thanks for the suggestions everyone. I'll have to think a bit
sjl has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
buffergn0me has joined #lisp
cage_ has quit [Quit: Leaving]
sjl has quit [Quit: WeeChat 2.2-dev]
patlv has joined #lisp
<pjb> mfiano: there's an alternative.
<pjb> mfiano: define a macro that will substitute the symbols. This macro will be able to do the code walking you need.
kjeldahl_ has joined #lisp
<pjb> (with-math (let ((x (identity-matrix 3)) (y (lower-triangle-matrix 3 42))) (/ (* 3 x y) (* 2 pi)))) would expand to: (let ((x (identity-matrix 3)) (y (lower-triangle-matrix 3 42))) (matrix:scalar/ (matrix:scalar* 3 (matrix:* x y)) (cl:* 2 pi)))
sjl has joined #lisp
littlelisper has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
kjeldahl_ has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 240 seconds]
Folkol has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
patlv has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 264 seconds]
kajo has quit [Ping timeout: 256 seconds]
kerframil has quit [Quit: Leaving]
sellout- has quit [Ping timeout: 245 seconds]
nowhereman_ has quit [Ping timeout: 248 seconds]
sellout- has joined #lisp
fikka has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
lnostdal has joined #lisp
fikka has joined #lisp
kajo has joined #lisp
kjeldahl_ has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
lnostdal has quit [Read error: Connection reset by peer]
lnostdal has joined #lisp
milanj has joined #lisp
j0ni has joined #lisp
igemnace has quit [Remote host closed the connection]
EvW has joined #lisp
fikka has joined #lisp
zachk has joined #lisp
zachk has joined #lisp
zachk has quit [Changing host]
Khisanth has quit [Ping timeout: 276 seconds]
pierpal has quit [Ping timeout: 260 seconds]
pierpal has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
rumbler31 has joined #lisp
fikka has joined #lisp
Kundry_Wag_ has joined #lisp
jmercouris has joined #lisp
Khisanth has joined #lisp
rumbler31 has quit [Ping timeout: 245 seconds]
fikka has quit [Ping timeout: 240 seconds]
EvW has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
ft has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 255 seconds]
vlatkoB has quit [Remote host closed the connection]
payphone has joined #lisp
EvW1 has joined #lisp
lnostdal has quit [Read error: Connection reset by peer]
lnostdal has joined #lisp
kajo has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
johnnymacs has joined #lisp
Kundry_Wag_ has quit [Ping timeout: 264 seconds]
samla has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
samla has quit [Client Quit]
lumm has quit [Ping timeout: 240 seconds]
Kundry_Wag has quit [Remote host closed the connection]
scymtym has joined #lisp
Kundry_Wag has joined #lisp
pierpa has joined #lisp
graphene has quit [Remote host closed the connection]
al-damiri has joined #lisp
graphene has joined #lisp
patlv has joined #lisp
kajo has joined #lisp
lumm has joined #lisp
kuribas has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
angavrilov has quit [Remote host closed the connection]
jmercouris has quit [Remote host closed the connection]
attila_lendvai has joined #lisp
bjorkintosh has quit [Ping timeout: 264 seconds]
j0ni has quit [Remote host closed the connection]
_Murii has quit [Quit: Leaving]
nowhereman_ has joined #lisp
kristof_ has joined #lisp
kristof has joined #lisp
johnnymacs has quit [Ping timeout: 276 seconds]
attila_lendvai has quit [Quit: Leaving.]
patlv has quit [Ping timeout: 268 seconds]
<Demosthenex> hey, i was reading about a new CL editing mode for emacs, it wasn't smartparens or electric-parens, it had a whole website. but now i can't find it. something Paren?
gabiruh has joined #lisp
didi has joined #lisp
<didi> I wonder why PUSH wasn't extended to work with vectors too.
<didi> Seems like a useful thing to do.
<didi> Maybe there would be discussion about extending the vector or not while using PUSH.
thodg has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
<kristof> didi: the interface is different. push returns the new list, vector-push returns the index or nil.
<didi> kristof: Ah, true.
<kristof> Now that begs the question why the interface couldn't be the same, but I think vector-push's is more useful for that type, and likewise for [list] push.
<kristof> Actually, in other languages I have often wanted a kind of try-push-without-realloc, so the fact that vector-push behaves that way is... Nice.
<didi> Interesting. I'm yet to use VECTOR-PUSH, tho I've used VECTOR-PUSH-EXTEND.
<kristof> Yeah, that's a well designed function, too.
<didi> In fact, I've tried using vectors, instead of lists, to decrease my garbage production, but I failed. Maybe I should control how the vectors are enlarged, I a realloc fewer of them.
<kristof> How do you know you failed?
<didi> kristof: Because after implementing it, the GC blows off at every run of my program.
<kristof> The lists actually make compaction much easier (because conses are all the same size).
<kristof> Oh, that's unfortunate. Have you thought about using a fixed size for the length and pooling them?
<kristof> I dunno if that will help.
<didi> My reasoning was that vectors would use less memory because they don't need to hold pointers to the next element, but I guess I didn't reach the right trade-off.
<kristof> Well, there are other concerns, too, like finding memory segments large enough
<didi> kristof: How do you mean?
<kristof> How large are these vectors?
<didi> My usual problem is having too much garbage for the GC, so it doubles the allocated memory and exhaust the heap.
Kundry_Wag has quit [Remote host closed the connection]
<didi> kristof: I dunno. I can compute the usual size, but they can grow during the execution of the program.
Kundry_Wag has joined #lisp
<kristof> Which implementation?
<didi> kristof: SBCL.
Kundry_Wag has quit [Remote host closed the connection]
* kristof shrugs.
<didi> kristof: What implementation do you have in mind?
<kristof> I didnt have any, but by you saying which it is, maybe someone else will have a better idea of how to keep the GC happy.
<didi> I am all earls. And eager. :-)
rumbler31 has joined #lisp
<didi> My last strategy is running, from the REPL, (dotimes (i 6) (sb-ext:gc :gen i)) from time to time. A full run of gc usually exhaust the heap.
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
rumbler31 has quit [Ping timeout: 248 seconds]
markoong has quit [Quit: Konversation terminated!]
markoong has joined #lisp
markoong has quit [Ping timeout: 264 seconds]
<Demosthenex> http://shaunlebron.github.io/parinfer/ , its not an emacs mode. :P
<aeth> didi: Have you tried manually implementing your data structure on top of vectors instead of using vector-push or vector-push-extend?
<didi> aeth: I didn't, but how would I do that?
attila_lendvai has joined #lisp
<didi> What I need is something to hold keys and values.
<aeth> What are the keys and what are the values?
<didi> The keys are anything that can be compared using EQ, EQL, EQUAL, and EQUALP. The value is a list of natural numbers.
random-nick has quit [Read error: Connection reset by peer]
nowhereman_ has quit [Ping timeout: 256 seconds]
nowhere_man has joined #lisp
<aeth> didi: How are you putting these in vectors?
fikka has quit [Ping timeout: 268 seconds]
<didi> aeth: I'm not using vectors anymore, but when I was, I used this function: https://paste.debian.net/hidden/7f14071b
rpg has joined #lisp
EvW1 has quit [Ping timeout: 276 seconds]
EvW has joined #lisp
<didi> I was treating a vector as an alist, that is, each element was a cons (KEY . VALUE).
<aeth> ahah
<didi> :-P
<didi> aeth: Maybe two vectors would be better? I didn't think so, at the time.
<aeth> Perhaps try having two vectors, one for keys and one for values, and put them both in a struct with each slot given a :type so SBCL doesn't lose the type information
<aeth> (That's my main use of structs. Implementations respect its :type more than CLOS objects)
<didi> aeth: I might try that. Tho I might no be able to specify the vector's element type.
<aeth> Right, if you're willing to restrict the number to a certain kind of number so you can get a specialized array via :element-type that would help, at least for the value (not for the key)
<didi> Indeed.
<didi> Worth a shot, thank you.
<aeth> Unfortunately, :element-type can only work on single-float, double-float, bit, character, and various integer sizes (with only bit and character guaranteed and octet de facto guaranteed)
<aeth> Because otherwise that would be perfect.
<aeth> (It would also be nice to have :element-type work on boolean and symbol. Then you could restrict your key to symbol.)
Kundry_Wag has joined #lisp
<aeth> It's possible that someone in #sbcl knows some potentially-unportable SBCL-specific tricks that could help
Kundry_Wag_ has joined #lisp
Kundry_Wag has quit [Ping timeout: 260 seconds]
<didi> Yeah. If think if I were to restrict the type of keys, I would go full FIXNUM, so I can drop the hash-table that I'm using too. But I'm not prepared to drop the convenience of having strings as keys.
<didi> *I think if I were...
patlv has joined #lisp
<aeth> I usually convert strings to symbols when I'm using them as keys
<didi> aeth: I asked in #sbcl, thank you.
<didi> aeth: Hum...
<didi> aeth: Another idea. Thank you. I might try that.
<aeth> I think one of the few major flaws in the HyperSpec is having specialized arrays but not having specialized hash tables (at least for the values if not the keys... but restricting keys to symbols could also work)
<aeth> Associating a symbol with a small integer seems like a common enough thing for hash-tables.
<aeth> (I suppose being able to directly access the symbol fixnum value would be another thing if used in a portable way, but that's going too far imo.)
fikka has joined #lisp
graphene has quit [Remote host closed the connection]
<didi> I thought of a FIXNUM as a key because it maps directly to the position of a vector.
graphene has joined #lisp
vtomole has joined #lisp
bjorkintosh has joined #lisp
<didi> And there isn't much value of having a vector larger than MOST-POSITIVE-FIXNUM. At least, not in my environment.
cgore has joined #lisp
<aeth> didi: So you're saying that there's a key fixnum vector? So this? (aref value-vector (aref key-vector 42))
cgore has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 264 seconds]
<didi> aeth: Oh yes. My data structure is a classic graph using an adjacent list. So it's a hash-table with keys as the vertices, and the values as adjacent lists, where each element is (VERTEX . NATURALS).
<aeth> If you want to represent all numbers and not just use floating point or some restricted integer size, it might be fastest to store two fixnums, the numerator and the denominator.
<didi> aeth: Thank you. But my NATURALS are 0, 1, 2, ..., so no fraction.
<aeth> just naturals is easier, store fixnums?
<aeth> sorry, I guess my mind parsed "naturals" as "numbers" for some reason
patlv has quit [Ping timeout: 240 seconds]
<didi> aeth: I can. But a list for NATURALS seem to be ideal. There isn't many of them inside each list, tho they are millions in total.
<aeth> Afaik, an array of (unsigned-byte 64) (even though some of those will be bignums) should be faster than using conses to store them, just based on how modern computer architectures work.
<didi> aeth: Thank you. I might try it. Tho my problem right now isn't with time, but memory.
<aeth> How large can they go?
<didi> No no. Not the naturals. They can't go too high, anyway. But with the total of memory that my program uses, the garbage is produces, and the heap exhaustion by the GC.
<aeth> I think the array approach will be 1/2 in memory just with (unsigned-byte 64) because you're going to be storing N elements, not N elements and N pointers. If you restrict it to (unsigned-byte 32) that'd be 1/4.
<didi> aeth: Nice, thank you.
<didi> I /think/ the constant extension of vectors produced too much garbage, but it's just a hunch.
<aeth> Since you're using an adjustable vector, it could in the worst case be almost double (if it's doing the whole doubling thing). As long as you're not adjusting it too often.
lnostdal has quit [Ping timeout: 276 seconds]
<didi> Yeah. I might try to tweak how the vectors are adjusted (I read something about it somewhere).
<aeth> But what's strange is that it would be almost double of half the size.
<aeth> (Unless one of my assumptions is wrong?)
<didi> I dunno.
fikka has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
Jesin has quit [Quit: Leaving]
didi` has joined #lisp
_paul0 has joined #lisp
_paul0 has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 240 seconds]
didi has quit [Ping timeout: 265 seconds]
didi` is now known as didi
paul0 has quit [Ping timeout: 256 seconds]
Kundry_Wag_ has quit [Ping timeout: 240 seconds]
pioneer42 has joined #lisp
pseudonymous has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
Ukari has quit [Ping timeout: 276 seconds]
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
pagnol has quit [Ping timeout: 260 seconds]
pagnol has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Ukari has joined #lisp
fikka has joined #lisp
nickenchuggets has quit [Read error: Connection reset by peer]
nickenchuggets has joined #lisp
nickenchuggets has quit [Changing host]
nickenchuggets has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
Kundry_Wag has joined #lisp
pioneer42 has quit [Quit: Leaving.]
Kundry_Wag has quit [Ping timeout: 240 seconds]
Kundry_Wag has joined #lisp
ealfonso has joined #lisp
Kaisyu has joined #lisp
fikka has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has quit [Ping timeout: 260 seconds]
fikka has joined #lisp
bjorkintosh has quit [Remote host closed the connection]
rumbler31 has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
rumbler31 has quit [Ping timeout: 248 seconds]
kobain has joined #lisp
<vtomole> Is it possible to export all symbols in defpackage instead of exporting each symbol individually?
fikka has joined #lisp
Kundry_Wag has quit [Ping timeout: 240 seconds]
thodg has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 260 seconds]
lumm has quit [Quit: lumm]
fikka has joined #lisp
mflem has joined #lisp
<Bike> "all symbols" meaning what