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
robotoad has joined #lisp
cmos has joined #lisp
<cmos> I'm having trouble getting slime to run on OSX. Last I used it was about a year ago, and now when I try to boot it up I get an error to do with compiling the SB-VM package
<cmos> have tried updating various things with no luck
<cmos> any tips?
<cmos> error is: Symbol "SIMPLE-FUN-HEADER-WIDETAG" not found in the SB-VM package.
<cmos> occurs at "Line: 1571, Column: 52, File-Position: 62862" in sbcl.lisp
rumbler31 has quit [Remote host closed the connection]
<cmos> the error occurs when loading swank-loader.lisp
mange has joined #lisp
<pjb> cmos: your problems are related to sbcl. update everything.
<cmos> pjb: Thanks. I'm running SBCL v1.4.10, which I think is up-to-date
<cmos> looks like my slime is from a couple of years ago, but the most recent one indexed by melpa (or whichever package index emacs is pulling from)
<cmos> worth using a local, up-to-date version? (if so, how can I tell emacs to use this rather than the version indexed by the package manager?)
<pjb> I use the one from quicklisp.
<cmos> hmm, tried installing through quicklisp and got "The function ASDF/INTERFACE::OPERATION-FORCED is undefined"
<pjb> You could use a different implementation to install it.
<akkad> cmos: are you actually using sbcl?
<cmos> akkad: yes
<cmos> or, at least, I have previously, and am intending to
<cmos> I don't think I have any other implementations installed
<cmos> I have "(setq inferior-lisp-program "sbcl")" in my .emacs
<akkad> how did you install slime?
<akkad> (ql:quickload :quicklisp-slime-helper)
<cmos> ^ probably that, if memory serves
<cmos> but this would've been a while ago
<cmos> is there a simple way to update slime directly using quicklisp?
<akkad> (ql:update-all-dists)
<cmos> hmm, apparently quicklisp itself is the only thing being tracked
<cmos> aaaaand re-running (ql:quickload "quicklisp-slime-helper") seems to have fixed the issue, whatever it may have been
<cmos> thanks, both, for your help…though I'm still pretty fuzzy on what the issue was in the first place
<akkad> then in emacs M-x load-file ~/quicklisp/slime-helper.el
Kundry_Wag has quit [Ping timeout: 240 seconds]
quipa has joined #lisp
on_ion has joined #lisp
meepdeew has quit [Remote host closed the connection]
cmos has quit [Ping timeout: 256 seconds]
omilu has quit [Remote host closed the connection]
Jesin has quit [Read error: Connection reset by peer]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
Autolycus has joined #lisp
kajo has joined #lisp
Jesin has joined #lisp
Autolycus has quit [Client Quit]
kajo has quit [Client Quit]
Kundry_Wag has joined #lisp
chamblin has joined #lisp
rumbler31 has joined #lisp
quipa has quit [Ping timeout: 240 seconds]
Fare has joined #lisp
nonlinear has joined #lisp
meepdeew has joined #lisp
kajo has joined #lisp
kajo has quit [Client Quit]
black_13 has joined #lisp
<black_13> when does a variable get gc-ed
<no-defun-allowed> whenever the gc runs and finds it's not being used
<no-defun-allowed> the GC specifics are implementation dependent
kajo has joined #lisp
<black_13> but are there lips statements that will cause a variable to be gc if that makes sense
<Bike> sometimes you can call the garbage collector yourself, but it's mostly invisible.
<Bike> also it's values rather than variables that are collected.
<black_13> i know
robotoad has quit [Quit: robotoad]
<black_13> Bike: if i define a variable to have a value of something
<black_13> then changed the value of the variable that value would get gc-ed
<Bike> at some point, probably, yes, if there was no other way that value was accessible.
<black_13> i am using something called s7 scheme (not lisp)
<mange> Generally speaking, you shouldn't assume that things will be garbage collected within a particular timeframe. It's probably more helpful to speak of being eligible for collection.
<black_13> and you can add c language types to this i wanted to know when does the the gc come along
<Bike> Whenever.
pjb has quit [Remote host closed the connection]
<Bike> The whole point is you don't usually need to think about it.
<Bike> there are no guarantees about when it's collected because you have no way to tell if it's collected.
<no-defun-allowed> if there are no references to an object, you can't probe for its existence
<no-defun-allowed> it'll happen whenever the system deems it necessary
pjb has joined #lisp
Oladon has joined #lisp
FreeBirdLjj has joined #lisp
<no-defun-allowed> go read the GC handbook
<no-defun-allowed> http://www.gchandbook.org
<mange> Just briefly reading about S7, it seems to have weak references which allow you to tell whether something has been collected.
<black_13> mange: thanks
kerrhau has joined #lisp
pierpal has joined #lisp
FreeBirdLjj has quit [Ping timeout: 244 seconds]
mathZ has joined #lisp
robotoad has joined #lisp
<black_13> "You can wrap up raw C pointers and pass them around in s7 code."
makomo has quit [Ping timeout: 260 seconds]
NoNumber has joined #lisp
<black_13> this is why i picked this but trying to understand how to wrap and use
<mange> You mean you picked S7 because you can have pointers into C code?
<black_13> correct sorry for my dyslexic prose
<Bike> probably it won't collect C objects, since C is all about managing things yourself
<black_13> correct
<mange> Yeah, it will collect its own wrapper (with the type/info), but I don't think it will collect the thing pointed to by the C pointer. Attempting to do so could break things pretty horribly (eg, if you passed &x[1], how would it free one item in the array?).
Kundry_Wag has quit [Remote host closed the connection]
<black_13> the wrapping begins with s7_make_c_object or seems to from the example
Kundry_Wag has joined #lisp
<black_13> is this statement "s7_c_type_set_free(s7, dax_type_tag, free_dax);" that makes me wonder when it will be called
Kundry_Wag has quit [Ping timeout: 256 seconds]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
marusich has joined #lisp
<mange> Maybe they have some way to include them in the GC process. It looks like you can define a few hooks to let S7 work with your C data. That won't give you any guarantees about GC timing, though, it just hands over control for the lifetime of the object to the system.
rumbler31 has quit [Remote host closed the connection]
<black_13> ok maybe ... If I have a pointer to top-level struct (god object) and this is wrapped by s7 and can be used frankly prevented from being gc-ed
<black_13> i don
<black_13> dont want this pointer to be gc just be used
black_13 has quit [Ping timeout: 252 seconds]
<meepdeew> Have any folks here played around with coleslaw for static site generation?
pjb has quit [Remote host closed the connection]
ikki has joined #lisp
dddddd has quit [Remote host closed the connection]
pjb has joined #lisp
rozenglass has quit [Ping timeout: 240 seconds]
rumbler31 has joined #lisp
marusich has quit [Ping timeout: 265 seconds]
isoraqathedh has joined #lisp
rumbler31 has quit [Ping timeout: 260 seconds]
pjb has quit [Remote host closed the connection]
<edgar-rft> The CLHS says that "setf {pair}* => result*" where result* are the multiple values[2] returned by the storing form for the last place.
<edgar-rft> Simplified question: in (setf a 1) can I take for granted that the result* will be 1? The CLHS doesn't say so clearly enough IMO.
<Bike> you can. i'm not sure what other reading is possible.
buffergn0me has joined #lisp
pjb has joined #lisp
<Bike> well, i suppose you need to know that storing forms are supposed to return the input values.
<mathZ> v
<loke> edgar-rft: I find it reasonably clear
<edgar-rft> Bike, loke: thanks, sometimes reading the CLHS just simply makes me getting paranoid :-)
<loke> It has that workding because of the following: (SETF foo (bar) xyz (abc)) ⇒ (abc)
<loke> (abc) being the last storing form
<edgar-rft> no, I only have one storing form, but it just simply saves me a lot of LET bindings if I can pass the result of a SETF to another SETF
kirkwood has joined #lisp
<loke> edgar-rft: Yes. if you have only one, then the last one is that one. :-)
cgay has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 260 seconds]
buffergn0me has quit [Ping timeout: 255 seconds]
Pixel_Outlaw has quit [Quit: Leaving]
pierpa has quit [Quit: Page closed]
<beach> Good morning everyone!
<loke> hello beach!
<loke> I need help with one of the hardest things in computer science
<beach> Oh dear.
<beach> Naming
<beach> ?
marusich has joined #lisp
<loke> I'm building a new generic component that consists of a main pane, along with a set of supplementary panes that can slide in and out from the sides (similr to how IntelliJ IDEA works).
<loke> It will be th ebasis of the notepad and other tools in climaxima
<beach> Nice.
<loke> Right. But... I need to figure out what teh component should be called
<loke> I'll give you a screenshot of IDEA so that you get an idea of what it looks liek:
<beach> Chest (of drawers)?
<loke> here is one:
<loke> the middle panel is the “root” panel... The left and right ones are drawers
<beach> I think I understand.
<loke> Here is one with the drawer on the bottom https://www.i-programmer.info/images/stories/News/2
<beach> 404
<loke> Oops
<loke> As you can see, you can change the size of the drawers by dragging
<beach> Yes, I think I understand.
<loke> (well, you can't see the dragging, but the two pictures have different sizes of their drawers)
<beach> Right.
<loke> I have been thinking of words such as Workspace, Desktop, Workbench...
<beach> Too general, and already used for other stuff.
<loke> exactly
<beach> That's why I suggested "chest".
<loke> Hmm
<loke> It's actually not bad
<loke> but it doesn't “feel” like a chest, if you know what I mean
<beach> Thanks.
<loke> but I might just go with that anyway :-)
<beach> Well, names are just words, and you get used to them.
<mfiano> Why must it be a word?
<loke> mfiano: Sure, it can be two words.
<mfiano> Prepend an adjective to remove ambiguity.
<loke> I'm not going to name it an emoji if that's what you mean :-)
<mfiano> resizable-pane or something
<loke> mfiano: Sure, but it isn't a resizable pane
<loke> a descriptive name would be something along the lines of root-pane-with-attached-drawers, but it's a bit too long
<mfiano> I guess look at what it's called in Swing then, or whatever java toolkit it's actually using.
<loke> Good point
<loke> It's a jetbrains object, so I guess it'll be hiodden somewhere in their code base. Don't know if I feel like going on a hunt for it :-)
<kirkwood> loke: sliding-pane? slider?
<beach> kirkwood: Already used for things like volume control.
<loke> damn it... what is the function to get the dimensions of a pane?
<beach> loke: Also, whenever I have naming problems and I ask for advice, I find that I am totally unhappy with the suggestions I get.
<beach> SHEET-REGION?
<loke> beach: I agree. But then, I leave it for a bit and then I realise that the suggestions were't bad
<loke> Oh...
<kirkwood> SLINKER
<loke> so, (RECTANGLE-SIZE (SHEET-REGION pane)) ?
<loke> Or can the sheet region ever be non-rectangualar?
<kirkwood> shifty-pane-that-cannot-be-found-when-needed
equwal has quit [Ping timeout: 244 seconds]
<loke> kirkwood: My intent is to make the hidden drawers have buttons along the side (note the second screenshot I sent, it has the title written vertically along the side)
<loke> (yay for rotated text :-) )
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
rumbler31 has joined #lisp
ikki has quit [Ping timeout: 248 seconds]
v0|d has quit [Remote host closed the connection]
pjb has quit [Read error: Connection reset by peer]
pjb has joined #lisp
rumbler31 has quit [Ping timeout: 240 seconds]
mange has quit [Ping timeout: 264 seconds]
pjb has quit [Remote host closed the connection]
Oladon has quit [Quit: Leaving.]
pjb has joined #lisp
marusich has quit [Ping timeout: 276 seconds]
marusich has joined #lisp
marusich has quit [Client Quit]
Bike has quit [Quit: Lost terminal]
gector has quit [Read error: Connection reset by peer]
gector has joined #lisp
Fare has quit [Ping timeout: 248 seconds]
pjb has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
pjb has joined #lisp
Kevslinger has quit [Quit: Connection closed for inactivity]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
pjb has quit [Ping timeout: 256 seconds]
pjb has joined #lisp
impulse has quit [Ping timeout: 256 seconds]
on_ion has quit [Quit: WeeChat 1.9.1]
impulse has joined #lisp
NoNumber has left #lisp ["Gone."]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
sauvin has joined #lisp
Amany has left #lisp [#lisp]
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
pjb has quit [Ping timeout: 256 seconds]
buffergn0me has joined #lisp
nsrahmad has joined #lisp
pjb has joined #lisp
v0|d has joined #lisp
fourier has joined #lisp
sjl has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
nsrahmad has quit [Ping timeout: 245 seconds]
pjb has quit [Remote host closed the connection]
vlatkoB_ has quit [Remote host closed the connection]
vlatkoB has joined #lisp
pjb has joined #lisp
pjb has quit [Remote host closed the connection]
orivej has joined #lisp
pjb has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
akkad is now known as Ober
orivej has quit [Ping timeout: 256 seconds]
milanj has quit [Quit: This computer has gone to sleep]
fourier has quit [Ping timeout: 256 seconds]
kajo has quit [Ping timeout: 265 seconds]
patlv has joined #lisp
fourier has joined #lisp
beach has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
mathZ has quit [Remote host closed the connection]
patlv has quit [Ping timeout: 248 seconds]
gravicappa has joined #lisp
buffergn0me has quit [Ping timeout: 255 seconds]
trittweiler has joined #lisp
hiroaki has joined #lisp
buffergn0me has joined #lisp
angavrilov has joined #lisp
test1600 has joined #lisp
pjb has quit [Remote host closed the connection]
pjb has joined #lisp
kerrhau has quit [Ping timeout: 268 seconds]
pjb has quit [Remote host closed the connection]
beach has joined #lisp
<LdBeth> Is there any data structure optimized for fast concatenation and subsequence operation?
<LdBeth> How about Ropes?
<Shinmera> skip lists perhaps?
jsnell_ has quit [Ping timeout: 265 seconds]
<LdBeth> It basically linked lists so maybe
<phoe> why not just a linked list?
<Shinmera> phoe: because subsequence is slow if the sequence is at the tail.
<Shinmera> that's where the skip list can help
<phoe> oh, you also need to traverse the list to compute the starting and ending points.
<phoe> that's right, it'll be O(n) for a list.
<Shinmera> concatenating two skip lists is a bit trickier but should be almost constant.
meepdeew has quit [Remote host closed the connection]
varjag has joined #lisp
kerrhau has joined #lisp
<LdBeth> Yes I will give it a try
shrdlu68 has joined #lisp
azimut_ has quit [Ping timeout: 264 seconds]
impulse has quit [Ping timeout: 240 seconds]
azimut has joined #lisp
impulse has joined #lisp
azimut has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 276 seconds]
azimut has joined #lisp
stnutt has quit [Ping timeout: 260 seconds]
stnutt has joined #lisp
lumm has joined #lisp
pjb has joined #lisp
lumm has quit [Quit: lumm]
lumm has joined #lisp
lumm has quit [Client Quit]
<beach> LdBeth: Any balanced tree will do, but splay trees are particularly good, though only statistically so.
<schweers> Is Sonya Keenes book on CLOS really that good? Especially if one has already read and understood the relevant chapters from PCL and uses CLOS casually?
<beach> Probably no great point in reading it then.
<schweers> okay, thanks
<schweers> I somehow struggle with proper OO design given generic functions and MI. I always thought that “OO design” was a fad, and think that it is in mainstream languages. But thanks to CLOS I can see what I’m missing.
<schweers> Do you (or anyone else) have a good book recommendation?
<beach> I learned object-oriented design in Common Lisp by reading the CLIM II specification.
<schweers> oh
<Shinmera> The book of: read code that uses CLOS a lot (like beach's stuff)
<beach> Before that I had read Sonja Keene's book, but I guess I didn't "get" it.
<beach> Yes, that too. You can look at Cluffer for instance. It has documentation and tests too.
pierpal has quit [Quit: Poof]
<Shinmera> Some of my stuff also uses CLOS heavily (and some of it the MOP heavily)
pierpal has joined #lisp
<phoe> I agree - Shinmera's code uses a lot of OO code and OO patterns in general
mhitchman[m] has joined #lisp
<schweers> thanks for the tip, especially about cluffer. I see that you have 35 pdf pages worth of docs :)
<schweers> Shinmera: you have a github account where I can find your code, right?
<phoe> I actually learned a lot about object composition by reading and analyzing Shinmera's parachute library
<phoe> schweers: github.com/Shinmera
<schweers> any particular recommendation?
<schweers> oh, just saw phoe’s comment
<schweers> thanks
<Shinmera> There's also stuff at https://shirakumo.org/projects/
SaganMan has quit [Ping timeout: 260 seconds]
<beach> schweers: I do recommend the CLIM II specification. It is not quite as good as the Common Lisp HyperSpec, but the low-level parts are quite well specified.
<schweers> beach: I’ve made a note of that. I guess I’ll first read at least the pdf documentation on cluffer.
<beach> Sure.
<schweers> the CLIM spec does seem quite intimidating at a first glance (huge)
kerrhau has quit [Ping timeout: 265 seconds]
dddddd has joined #lisp
<schweers> also, text editing operations are something I can relate to a little more
<beach> True, but is a stratified design, so it consists of a large number of independent "modules".
<beach> But, by all means, start with Cluffer. Then I can answer questions as well.
<phoe> take it slow with the CLIM documentation - just start in one point and try to understand what it does, and then expand it by reading about an adjacent class/function/thing
pierpal has quit [Quit: Poof]
makomo has joined #lisp
pierpal has joined #lisp
Kevslinger has joined #lisp
<adlai> schweers: have you read AMOP? it's a great insight into the "CLOS philosophy", even if you don't end up using any of the extra flexibility
<schweers> I’m reading it on the side when I have time
<schweers> I’m not sure what to make of the first part of the book, though
<adlai> context, in which to make something else of the rest.
<beach> Oh, that's a very tough one unless you know CLOS very well as a user.
<schweers> I have the feeling that I understand CLOS well enough to see that OO does have some merit, but not well enough to use it to its full potential
<adlai> you could teach yourself how to see this potential through the painful approach: start building a large system without using OO, and list the points where you regret that omission.
<schweers> yeah, been there, done that
<schweers> well, large may not be the right term, but large enough
<jackdaniel> "cognitive baggage is proportional to the potential of technology in question" – JD's rule of CLOS :-)
<jackdaniel> or s/baggage/ballast/
orivej has joined #lisp
hiroaki has joined #lisp
quipa has joined #lisp
quipa has quit [Client Quit]
buffergn0me has quit [Ping timeout: 260 seconds]
siraben has joined #lisp
<siraben> Hi all, is there a CL library for interfacing with MIDI devices?
<phoe> siraben: https://github.com/pcrama/midi is what google tells me
<siraben> Hmm. Which ones are still actively used?
<siraben> I'll take a look at them. Thanks.
<schweers> beach: the cluffer docs state that there are two classes for standard-line (open and closed). Do you use change-class to switch between the two?
<schweers> I.e. does inspecting a line change the class of the underlying object?
<beach> I forget.
<phoe> it seems so
<beach> Yeah.
<phoe> there are exactly two occurrences of "change-class" in the code: "change-class line 'closed-line" and "change-class line 'open-line"
<beach> Indeed.
xristos has joined #lisp
<schweers> thanks
<siraben> pjb: Thanks.
<siraben> Are you a musician?
<pjb> siraben: see also: https://framagit.org/abnotation/midi for midi files.
<beach> schweers: Interesting you should mention open/closed lines. This concept allows me to represent most lines in a compact way. I could go through the items and if they are only ASCII characters, I could create a vector of unsigned-byte 8.
<pjb> siraben: more a programmer.
<beach> schweers: Or, in some cases, I could run a compression algorithm on it if I wanted to.
<beach> schweers: Right now, I just replace the gap buffer by a normal vector.
<schweers> I took a while to understand your comment on ASCII, but now it makes sense. Interesting design.
<pjb> siraben: there's also Midishare, https://framagit.org/patchwork/midishare but it has a little bitrotten.
<schweers> I think I like the idea of changing the class in order to change which methods apply without changing object identity.
<beach> schweers: Thanks. I have been contemplating this design for 30 years or so. :)
<schweers> wow
<pjb> siraben: perhaps it'll be easier to make it work on linux. The main problem is on macOS, that ffigen4 doesn't work on recent systems; it would have to be ported to newer compilers.
<beach> schweers: Not full time, luckily. My Flexichain library is a step on the way.
<siraben> pjb: I want to explore using CL as a musical live coding language
<siraben> pjb: I have a macOS machine
<pjb> beach: cf. com.informatimago.common-lisp.cesarum.ascii
<pjb> siraben: then have fun with CoreMidi ;-)
<Shinmera> siraben: Maybe have a look at OpusModus
<siraben> pjb: Wow you do a lot of MIDI stuff!
<siraben> You must be a musician haha
<pjb> No, I just have fun with synthesizers.
<siraben> Nice.
<pjb> beach: things like: (com.informatimago.common-lisp.cesarum.ascii:ascii-format nil "foo ~A ~A" "bar" (com.informatimago.common-lisp.cesarum.ascii:ascii-bytes "baz")) (com.informatimago.common-lisp.cesarum.ascii:bytes<= #(65 66 67) #(65 66 68))
<beach> pjb: Yes, I see.
<phoe> watch all videos from that guy, he's completely bonkers with his music programming.
<siraben> phoe: Such a fast type o.o
<siraben> typer*
<beach> siraben: I think the word is "typist". :)
<siraben> typist*
<beach> Colleen: define typist
<Colleen> typist /ˈtʌɪpɪst/
<Colleen> (noun): a person who is skilled in typing, especially one who is employed for this purpose.
kerrhau has joined #lisp
<schweers> skilled in typing ... that sounds a little vague ;)
<beach> Most definitions of most common words are vague.
<siraben> Either they memorized all this before hand or are really doing this live
<phoe> like skilled in dynamic typing?
<phoe> siraben: most likely a combo of both
<siraben> Actually, this would be a good way to create generative music
<siraben> Anyone ever heard of Music for Airports by Brain Eno?
<phoe> in general, livecoding is just like making music, memorizing and training a lot so your subconscious can do the boring tasks and leave your consciousness to be actually creative
<siraben> He does of lot of this stuf
<siraben> phoe: More or less like a Jazz pianist memorizing common patterns
<phoe> yep
* phoe AFKs
<schweers> also, completion seems to help him along
<phoe> it helps all Lispers along (;
<schweers> but yes, he does seem to be quite a decent typist and probably very good at doing what he does (besides typing)
<siraben> The visualizations are good too
<siraben> I don't think his display is getting distorted from his point of view
<siraben> Anyway, it shows the power of using opengl as well
m00natic has joined #lisp
<schweers> beach: given that cluffer has two classes for cursors, (left and right sticky), if one wanted to alternate between the two behaviors (for instance on a per-command basis), would you consider it reasonable to change the class of said cursor regularly?
Kundry_Wag has joined #lisp
<beach> I suppose so.
SaganMan has joined #lisp
* schweers is off for lunch
Kundry_Wag has quit [Ping timeout: 240 seconds]
brandonz has quit [Ping timeout: 255 seconds]
meowray has quit [Ping timeout: 256 seconds]
Kundry_Wag has joined #lisp
brandonz has joined #lisp
\u has joined #lisp
<galdor1> pjb: I'm curious regarding the way you name package, (e.g. com.informatimago.common-lisp.cesarum.ascii) do you use package name aliases ? or do you always :USE for DEFPACKAGE ?
kbtr_ has quit [Quit: leaving]
kozy has quit [Remote host closed the connection]
kbtr has joined #lisp
<phoe> galdor1: there are several schools for that.
<phoe> the one I use: I mostly USE-PACKAGE, except for when I use IMPORT-FROM.
pierpal has quit [Quit: Poof]
<phoe> Another one is: never import anything and explicitly use package prefixes.
pierpal has joined #lisp
<galdor1> I use very short names for my own packages, which I find more practical, but it's easier to get conflicts
galdor1 is now known as galdor
ikki has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
<phoe> yep - package-local nicknames is a solution for that, and it's kinda-widely-adopted now.
<AeroNotix> is it normal/expected to use defsetf expander code to implement assertions on the value being setf?
<AeroNotix> or is that typically/supposed to be done somewhere else?
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<phoe> AeroNotix: uh, inside the setf function?
<phoe> (defun (setf foo) (new-foo ...) (assert (frobnicable-p foo)) ...)
<AeroNotix> yeah
<AeroNotix> Well I'm using defsetf
<AeroNotix> Need to learn the difference between defsetf and (defun (setf ...)))
<AeroNotix> to macroexpand!
<phoe> I almost exclusively use (defun (setf foo) ...)
rumbler31 has joined #lisp
<phoe> unless I need to avoid double evaluation of arguments somewhere, at which point I define-setf-expander or define-modify-macro
<schweers> hm, ccl doesn’t seem to support package local nicknames, at least not by the same feature convention as sbcl does.
<AeroNotix> phoe: and the (setf foo) part can be anything like (setf (lookup foo blah blah)) instead, right?
<AeroNotix> when using (defun (setf ..))
<phoe> AeroNotix: yes
<phoe> (foo bar baz quux)
<phoe> (setf (foo bar baz quux) fred)
<AeroNotix> gotcha, thanks
<phoe> (defun (setf foo) (new-value bar baz quux) ...)
<phoe> in that case, the value FRED gets bound to the variable NEW-VALUE
<phoe> so if (defun foo (...)), then (defun (setf foo) (new-value ...))
<phoe> the variables in ... SHOULD stay the same
<AeroNotix> righto, will have a play
orivej has quit [Ping timeout: 240 seconds]
akr has joined #lisp
<akr> Hello, does anyone know whether there is a CL implementation of CLDR ( https://en.wikipedia.org/wiki/Common_Locale_Data_Repository )?
<akr> specifically, I need to use the country-dependent regexes for postal codes
<akr> I don't think cl-unicode has it
<akr> oh okay looks like it's been deprecated from CLDR anyway :( http://unicode.org/cldr/trac/ticket/8421
<akr> I wonder what are the "other sources of such information"
kamog has joined #lisp
random-nick has joined #lisp
crsc has quit [Quit: leaving]
rumbler31 has quit [Remote host closed the connection]
random-nick has quit [Read error: Connection reset by peer]
quipa has joined #lisp
vaporatorius has joined #lisp
test1600 has quit [Ping timeout: 264 seconds]
<drmeister> How would I get a random available port and the port number using sbcl sockets?
<drmeister> I know open port 0 (zero) - but getting the port address afterwards ...
eminhi has joined #lisp
Bike has joined #lisp
Bronsa has joined #lisp
lel has quit [Ping timeout: 244 seconds]
PuercoPop has quit [Ping timeout: 244 seconds]
malm has quit [Ping timeout: 244 seconds]
dvdmuckle has quit [Ping timeout: 244 seconds]
mulk has quit [Ping timeout: 244 seconds]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
abeaumont has quit [Ping timeout: 244 seconds]
dlowe has quit [Ping timeout: 244 seconds]
dieggsy has quit [Ping timeout: 244 seconds]
jxy has quit [Ping timeout: 244 seconds]
hjudt has quit [Ping timeout: 244 seconds]
nimiux has quit [Ping timeout: 244 seconds]
ineiros has quit [Ping timeout: 244 seconds]
<pjb> galdor1: I use use-package and :use in defpackage.
zagura has quit [Ping timeout: 244 seconds]
shachaf has quit [Ping timeout: 244 seconds]
malm has joined #lisp
lel_ has joined #lisp
dlowe has joined #lisp
dvdmuckle has joined #lisp
Colleen has quit [Ping timeout: 244 seconds]
<pjb> (well, most of them).
<galdor> oh nice
<galdor> thank you for the information
<pjb> galdor: Of course, I also have a com.informatimago.common-lisp.cesarum.package:add-nickname function, but my rule is that it should only be used by end-users.
<pjb> galdor: and if you write an application such as it can be loaded in a lisp image along with other applications (occurs a lot of the time), then you're not the end-user. Only if your code can only be loaded to save a stand alone executable image.
mulk has joined #lisp
<pjb> But to have fun in the REPL, add-nicknames is nice.
<pjb> add-nickname.
<galdor> yep, this way you get a fully featured environment right under your fingers
dieggsy has joined #lisp
ebrasca has joined #lisp
hjudt has joined #lisp
jxy has joined #lisp
<Xach> drmeister: sb-bsd-sockets:socket-name
<Xach> drmeister: port is the 2nd return value
<phoe> drmeister: yes, the second value of that
<pjb> For package local nicknames, and other hierarchical package names, the current situation is that there are different specifications, and we'd need to homogeneize them and implement them for all implementations. cf https://github.com/informatimago/lisp/blob/master/common-lisp/lisp/relative-package.lisp
<phoe> (I actually just checked the SBCL source for that)
<drmeister> Thank you very much. I was looking for 'port-number' and whatnot and wondering if my implementation of sockets was missing something.
varjag has joined #lisp
<drmeister> Xach: While I have you here - once I (load "<wherever>/quicklisp/setup.lisp") quicklisp does everthing relative to <wherever>/quicklisp - correct?
galdor has quit [Quit: WeeChat 2.1]
<Xach> drmeister: yes
varjag has quit [Remote host closed the connection]
<drmeister> Oh boy - if only the rest of the world were so reasonable.
varjag has joined #lisp
<drmeister> We were wrestling all weekend with getting jupyterlab (implemented in Python) to install itself under one directory.
<drmeister> Thank you very much.
<pjb> it's not hard to do, but you still need to real with various cases, notably if you allow compiling the file.
<pjb> You must deal with *load-pathnames* and *compile-file-pathname* in the different situations (or choose the -truename* versions).
ebrasca has quit [Remote host closed the connection]
<beach> In SICL code, I often need to refer to files that have a specific place with respect to the root directory, but where the relative path can vary. I have been using ASDF:SYSTEM-RELATIVE-PATHNAME, but I have been using it with a nested ASDF system name, so the relative pathnames vary.
<beach> I would like for the relative pathnames to look the same no matter where they are referred to. Should I just use some (possibly fake) ASDF system name that I stick at the root of the hierarchy, or is there a better way?
<phoe> I think (ab)using ASDF:S-R-P would be a sane approach here.
<phoe> It's a rather popular function and it's designed for that kind of usage.
<beach> So just use the same ASDF system everywhere so that the paths always look the same?
<beach> Sounds good to me.
<phoe> More or less, yep. ASDF systems, theoretically, are movable around the filesystem; if you have /foo/foo.asd and then /foo/bar/baz/quux/quux.asd, then, in pure theory, ASDF treats it the same as if the latter was /quux/quux.asd.
<phoe> So, if your code is structured like that, you could consider putting some kind of root ASDF system that, uh. Kind of depends on all the others being in the same place?
<beach> Oh, but if I move it, then all my relative pathnames will be wrong.
<phoe> beach: this doesn't sound exactly right.
<phoe> If you have a system FOO containing a file /bar/baz.txt, why don't you refer to it via (asdf:s-r-p :foo "/bar/baz.txt"?)
<beach> I think we misunderstood each other.
<phoe> If you want to refer to *every* single file from a single ASDF system, then you've essentially killed ASDF's modularity and turned all of your code into a de-facto single system.
Kevslinger has quit [Quit: Connection closed for inactivity]
<beach> This is for a single repository, namely SICL.
<pjb> Of course, whatever the mechanism to obtain the root pathname, I use it to set a logical pathname.
<beach> The place for SICL may move around.
<phoe> I understand so far.
<pjb> Some of my logical pathnames may also be specified in logical-host files.
<phoe> You have modules inside SICL, right?
<beach> But within SICL, there are many ASDF systems, and many subdirectories.
<beach> Yes.
<phoe> Yep, I see.
galdor has joined #lisp
<beach> So I just want every file to be referred to using the same path.
<phoe> So if you have a subsystem called FOO containing a file /bar/baz.txt, then you should be able to (asdf:s-r-p :foo "/bar/baz.txt")
<pjb> I find that using logical pathnames really simplify the rest of the program.
<beach> And it seems that I can do that be referring to them relative to an ASDF system located in the root.
<phoe> You don't need to care about pathnames that way. All you need to know is, there's a system named FOO that contains a file at "/bar/baz.txt".
<phoe> You don't have to care where it is relative to your position or even absolutely. ASDF takes care of that.
<beach> phoe: No, that's not true.
<beach> phoe: Because when I cross compile, I can't use ASDF since I haven't booted SICL sufficiently to contain ASDF.
<phoe> Ooh.
<beach> phoe: So I need to LOAD or CST-COMPILE a file, giving it a name.
<phoe> Sigh. beach, you and your bootstrapping edge cases. (:
<beach> I guess I could teach ASDF to do cross compilation, but I'll do that some other day.
<beach> It is already complicated to deviate just a little bit from the default behavior.
<phoe> Yep, I see.
<beach> pjb: What is a "logical-host file"?
fourier has quit [Ping timeout: 256 seconds]
<pjb> The files that are loaded by load-logical-pathname-translations
<beach> I have no idea how to use that, and the usage seems to be implementation-defined.
<beach> pjb: Can you suggest a solution using that for the specific problem that I was asking about?
<pjb> Yes, but most implementation use the same format, just the logical-pathname-translation list saved in a file named after the logical host.
<beach> and where is that file located?
ikki has quit [Ping timeout: 240 seconds]
<pjb> Well, in your case, using *load-pathname* or *compile-file-pathname* or -truename* is better. Those logical pathname translations are specified by the user, you probably don't want to depend on that.
<pjb> It's implementation dependent, but you can configure them to search them eg. in ~/loghost/.
<beach> That's correct. I want the exact contrary. And I can't use *load-pathname* or *compile-file-pathname* either, because for them to be set, I have to refer to the files somehow and that is the problem I am having.
<beach> pjb: But wait, then I need yet another mechanism to refer to that file and that will vary according to where SICL is installed. That is precisely what I want to avoid.
<pjb> beach: well, you start by loading one of the files in your sources, no? If you don't have asdf.
LiamH has joined #lisp
<pjb> At one time, the user needs to specify the path. Either with a (LOAD path-to-a-sicl-file) or by pre-configuring this path sometime somewhere.
<beach> I have ASDF and it knows the root of the SICL tree, so I can use the relative pathname facility of ASDF to refer to files directly. Therefore I don't need to specify the initial file with an absolute pathname, and that's what I want.
<beach> Yes, by running ql:register-local-projects which most people seem to know how to do.
<pjb> beach: yes. What I'm suggesting here is to use asdf to set a logical-host, and use it to refer to the rest of the SICP files with logical pathnames.
<pjb> This way, your dependency on asdf is limited to the code that does this setting up of the logical-host.
<beach> I don't understand how to use ASDF to set a logical host.
<beach> pjb: OK, never mind. I'll look into logical pathnames, but I'll probably do that later. Right now it would be a distraction from the work I am currently doing. Thanks for the tip.
mindCrime_ has joined #lisp
light2yellow has joined #lisp
<dim> I think to remember CCL at least provides a logical hostname for its sources, is that right pjb?
<dim> yeah, beach, you might find https://ccl.clozure.com/manual/chapter4.6.html interesting, as I think it solves the same use-case than you have with SICL
zagura has joined #lisp
crsc has joined #lisp
<pjb> beach: https://pastebin.com/2Rq3bbeq (starting line 73)
shrdlu68 has quit [Ping timeout: 264 seconds]
<pjb> make-translation only deals with implementation specific variations.
<pjb> (Sorry, I used cerarum as example, I don't have sicl sources at hand on this system).
patlv has joined #lisp
patlv has quit [Remote host closed the connection]
akr has left #lisp ["WeeChat 2.0.1"]
kushal has quit [Ping timeout: 250 seconds]
<beach> pjb: Thanks. I would have to figure out how to call define-logical-host-... automatically.
<pjb> beach: perhaps it's possible to do that in the asd file.
<beach> It might be.
<pjb> After the defsystem form.
<beach> Yes, that sounds possible.
<beach> Thanks.
<beach> That function would have to be defined though.
<pjb> Yes, in the asd file too…
<beach> Presumably as a result of running some ASDF system.
<beach> Well, then I would have hundreds of copies of it.
<pjb> or adding a dependency indeed, but this is a meta dependency.
<beach> So I would have to extract it to a root system.
<pjb> I guess you could add a (ql:quickload …) in the asd files.
<beach> I'll give it some thought. Thanks again.
<pjb> Perhaps this could be added to asdf. It seems useful to me.
<beach> dim: I am reading that and I don't see a solution to my problem in there.
Denommus has joined #lisp
<beach> pjb: Maybe so, yes.
<beach> OK, back to work. Thanks for the help everyone.
kushal has joined #lisp
Inline has joined #lisp
zfree has joined #lisp
foom2 is now known as foom
random-nick has joined #lisp
rumbler31 has joined #lisp
lnostdal has joined #lisp
black_13 has joined #lisp
<black_13> what is the difference between define and let
<Inline> there's no define in common-lisp
<Inline> that's scheme
<Inline> in common-lisp it's called defun
<Inline> but i suppose both are macros
FreeBirdLjj has joined #lisp
<black_13> ok
<black_13> defun is define function?
<Inline> let has lexical variables
rumbler31 has quit [Ping timeout: 240 seconds]
<Inline> a defun can refer to global ones tho
<beach> black_13: DEFUN is a macro for defining functions.
<Inline> via the parameter list
<black_13> sorry my questions should be about scheme
<black_13> #scheme
<beach> black_13: This channel is dedicated to Common Lisp.
<Inline> well actually you can also refer to global ones via let, but shortly after you enter let's body that one also becomes lexical
orivej has joined #lisp
<phoe> black_13: yep, most schemes don't have DEFUNs - they have only DEFINEs
<Inline> and common-lisp code can have define, but most probably that would be a macro too
<phoe> where (define foo ...) defines a variable named FOO and (define (bar ...) ...) defines a function named BAR.
<phoe> Inline: yep, and it would be very non-standard.
<Inline> i've seen some
<Inline> not sure what to think of it
<phoe> Inline: where?
<phoe> Usually, if anything, it's macros from the DEFINE-FOO family
<phoe> but DEFINE alone? hmm
lumm has joined #lisp
<Inline> i can't remember now, but somewhere i've seen defines in common-lisp code
<phoe> changing topic: I was having a thought of doing basic inter-process communication between Lisp images by sending around FASLs
<pjb> Inline: you can define a define macro in CL if you want.
<pjb> phoe: I'm not sure it would be simplier or easier to use than my lisp heap.
<phoe> pjb: your lisp heap?
makomo has quit [Quit: WeeChat 2.0.1]
test1600 has joined #lisp
<AeroNotix> phoe: Why do you think that would be good?
<AeroNotix> IPC usually is only concerned with data between processes where they both understand what the data represents and what operations are valid on said data
<AeroNotix> sending the data + code to another process sounds kind of strange outside of some select distributed computing models.
JuanDaugherty has quit [Quit: Exeunt]
<phoe> AeroNotix: that's literally what Erlang does.
<foom> Erlang is kinda an obscure reference, compared to literally the most common computing environment in existence, which also does that.
<AeroNotix> phoe: It's not what Erlang does primarily
<foom> (javascript, on the web)
<AeroNotix> source: literally just finished an Erlang job spanning 5+ years
<Shinmera> phoe: FASLs aren't very fast, mind you. They're usually also too general for IPC and more tailored formats will be more suitable.
<Shinmera> FASLs also only have global side-effects, so not very great
<AeroNotix> phoe: javascript is a special case, though. I liken it to downloading the software to run a program.
<Shinmera> As in, they don't have a "return value"
<pjb> phoe: type: (apropos "heap") that should list com.informatimago.common-lisp.heap.heap
<pjb> or: (find "HEAP" (list-all-packages) :key (function package-name) :test (function search))
<AeroNotix> in reality, you tend to only send code between running beam instances when you've fucked up
black_13 has quit [Ping timeout: 252 seconds]
<pjb> Nonetheless, this can be useful.
<AeroNotix> the distributed code loading features are touted as a really cool entrance feature but I really would doubt you should use them day-to-day. Or base your application's design around it.
<AeroNotix> pjb: sure, it's definitely useful
<pjb> You could send closures, or you could send rules compiled as functions, in systems where those rules change often (eg. yearly for tax rules).
<AeroNotix> But phoe mentioned passing FASLs around as an alternative IPC mechanism
<AeroNotix> my point is that the are countless other more standard and well-understood ways of doing that
<pjb> But it's hard to get right, and fasl cannot store closures anyways.
<pjb> indeed.
<AeroNotix> pjb: lets pretend you _could_ send closures
<pjb> Then super nice!
<pjb> You could do great things, security wise.
<AeroNotix> Is there a benefit of sending a closure to another lisp instance versus just updating the backing code and restarting the service
<pjb> it could be useful for data access time, or for processing time.
<AeroNotix> what do you refer to by both of those things?
<pjb> for example, instead of giving your data to google etc, you could send them a closure that would ensure that your data is not use by them, but that your closure would process your data for them (on their systems).
<AeroNotix> I understood phoe as meaning between two systems you control
<AeroNotix> rather than handing code to a third-party to execute
<pjb> Or to process a big database, sending a closure would be practical, like a stored procedure, to have local access to the database data.
<pjb> Yes, but if you have a working system, it is useful when you don't control both systems.
<pjb> (of course, you'd need more mechanisms to ensure protection, security, privacity, etc).
<AeroNotix> seems like a mess
<AeroNotix> sending a function to execute on a database
<AeroNotix> I'm sure there are databases out there that do this (perhaps couchdb, if memory serves correctly)
X-Scale has joined #lisp
<Shinmera> couch needs predefined queries, so not really
<Shinmera> but there are dbs that just execute random JS
kozy has joined #lisp
sjl_ has joined #lisp
<AeroNotix> Shinmera: 90% sure you can set up functions to run on your data in cdb
<AeroNotix> anyway
<Shinmera> Yes but if I remember correctly you need to program them ahead of time as predefined procedures.
<AeroNotix> point is
<AeroNotix> right
<pjb> AeroNotix: stored procedures in SQL database are routine.
<pjb> AeroNotix: some database such as Postgres even allow plug-in languages: you could use Common Lisp by writing a trivial pg-ecl plugin.
<pjb> And of course, there are OO databases, where it's even more a thing. (only OO databases usually runs more often locally, in your application).
<AeroNotix> pjb: yep, I've used non pgpsql functions in pg. Though they're always just for the novelty really.
<AeroNotix> My opinion is that, if you're needing your db to execute so much of your code like that, perhaps the db is doing too much
<foom> Or your data is really big.
oldtopman has quit [Quit: *pouf*]
rumbler31 has joined #lisp
<pjb> AeroNotix: the problem is with objects. SQL things that objects don't exist, just relationships. But relationships define objects! And as we know, objects encapsulate code with data, as in closures. So when you have a database, you have actually a bunch of objects in there, and you need code for their methods!
<pjb> Only this is not in the relational model. So they added triggers and stored procedures in SQL.
hiroaki has quit [Ping timeout: 240 seconds]
<AeroNotix> applications define how data is transformed into application specific constructs
<pjb> Next question is how you spread the code of your objects between the various computers or systems (database server, client UI app, etc).
<pjb> And this is where it would be nice to be able to transfer closures, since this would allow you transfer standalone objects.
<pjb> Otherwise, it is difficult to ensure consistency between all the different bodies of code.
rumbler31 has quit [Ping timeout: 244 seconds]
jmercouris has joined #lisp
milanj has joined #lisp
Fare has joined #lisp
buffergn0me has joined #lisp
<jmercouris> so I have a list like this ("something" "fish" "something")
<jmercouris> I know about remove-duplicates, but I also want to sort the list by those which had the most frequency
<jmercouris> so, since "something" appeared twice, I would like a resultant list that looks like ("something" "fish") which reflects the relative infrequency of "fish"
<beach> jmercouris: First create a list (("something" . 2) ("fish" . 1))
<beach> jmercouris: Then sort it by the CDR.
<jmercouris> I was just about to say that, but it is a little expensive
<jmercouris> but if you are apparently thinking the same way that I am, it is probably the most reasonable solution
<jmercouris> thank you for the help!
<phoe> can this be done better than in O(nlogn) time?
<pjb> (sort (com.informatimago.common-lisp.cesarum.list:equivalence-classes '("something" "fish" "something") :test (function string=)) (function >) :key (function length)) #| --> (("something" "something") ("fish")) |#
<beach> Nice!
<phoe> pjb: and then mapcar #'car on that and you have ("something "fish")
<pjb> or: (sort (mapcar (lambda (class) (list (length class) (first class))) (com.informatimago.common-lisp.cesarum.list:equivalence-classes '("something" "fish" "something") :test (function string=))) (function >) :key (function first)) #| --> ((2 "something") (1 "fish")) |#
<Shinmera> (let ((c (make-hash-table :test 'eq))) (dolist (i '(0 1 2 0)) (incf (gethash i c 0))) (sort (loop for k being the hash-keys of c collect k) #'> :key (lambda (k) (gethash k c))))
<Shinmera> supplant 'eq for whatever else equality test is appropriate of course.
<pjb> you cannot compare integers with eq!
<pjb> even (let ((x 0)) (eq x x)) may be nil!
<beach> He is not trying.
<beach> The hash table is for the strings.
<Shinmera> No, but it's just an example with the assumption that the list contains identical objects.
<pjb> (make-hash-table :test 'eq) <-- ; (dolist (i '(0 1 2 0)) <--
<jmercouris> Well, I'm going to do the first approach anyways, because I have to also maintain the code
<jmercouris> fortunately this operation only happens literally one time at system startup
<pjb> Leave it as is, the default eql is perfectly good.
<sjl_> jmercouris: a FREQUENCIES function that implements the first half of what shinmera said is a handy util to have, e.g. https://github.com/sjl/cl-losh/blob/master/src/sequences.lisp#L26
<jmercouris> that is pretty useful ineed, but by having it in the car I can make a sorted list more easily
<jmercouris> s/ineed/indeed
<sjl_> (alexandria:hash-table-alist (losh:frequencies '(a b a a c b))) ;=> ((C . 1) (B . 2) (A . 3))
<sjl_> :)
<jmercouris> Lol, nice composition
<jmercouris> does alexandria accept contributions?
<sjl_> sometimes I wish there were just a few more utility functions for hash tables in the standard
<sjl_> I've sent PRs that were accepted, but they were all pretty minor.
josemanuel has joined #lisp
<Shinmera> alexandria is pretty conservative.
<sjl_> yeah
<jmercouris> so it is doubtful that they would accept such a function, then?
rippa has joined #lisp
<Shinmera> There's a shittonne of utility libraries out there though that either already have something like this or would accept it
<sjl_> My PRs were mostly obvious typo fixes and such
<jmercouris> Well, nevermind then :P
<AeroNotix> is there a built in format recipe that, given a 2D array it will print a table?
<jackdaniel> knowing format there is, but no idea what that could be
<Shinmera> format's iteration only does lists, not arrays, so no.
<jackdaniel> probably some spghetti string
<AeroNotix> lists, then
<Shinmera> of course there's the cop-out of ~/
<sjl_> yeah if it were nested lists, definitely. not for 2d arrays.
<jmercouris> Isn't there a way to pretty print a 2d array?
<Shinmera> Something like "~{~{~10a ~}~%~}" for lists I guess.
<AeroNotix> OK, will play
pierpal has quit [Quit: Poof]
<sjl_> http://cybertiggyr.com/fmt/fmt.pdf may be relevant to your interests
pierpal has joined #lisp
<Shinmera> Doing proper tabulation that doesn't break requires two iterations over the data -- once to estimate the column width, and once to print the data.
<jmercouris> unless you truncate each cell to a max width, which could be faster and simpler to read
<jmercouris> which is what I would do, rather than trying to dyanmically adjust the width of each column
<AeroNotix> Nah it's just for debugging. A small format string is fine enough
<AeroNotix> just thought there could be something built in
eminhi has quit [Ping timeout: 256 seconds]
random-nickname has joined #lisp
random-nick has quit [Ping timeout: 256 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
zfree has quit [Quit: zfree]
emacsomancer has joined #lisp
FreeBirdLjj has joined #lisp
psq has joined #lisp
psq has quit [Quit: Page closed]
psq has joined #lisp
psq has quit [Client Quit]
psq has joined #lisp
psq_ has joined #lisp
<psq> test, sorry
<beach> What is it that you are testing?
mercourisj has joined #lisp
<mercourisj> our patience :D
<mercourisj> next time, you can message minion to test your connection
jmercouris has quit [Ping timeout: 240 seconds]
<psq> I'm using erc in emacs, I just wanted to make sure I could talk and have the right nick
buffergn0me has quit [Ping timeout: 240 seconds]
<jackdaniel> psq: saying "hey" would be less suspicious :)
shka_ has joined #lisp
eatonphil[m] has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
<jackdaniel> on the other hand, if it is a new nick you may have been afraid of being inquired by beach (that he hasn't seen you here yet ;-)
schweers has quit [Ping timeout: 265 seconds]
<mercourisj> jackdaniel: you are missing a closing parenthesis
<mercourisj> don't you have paredit enabled in your irc buffer?
<jackdaniel> nerdy jokes are nerdy (i.e not especially funny); fyi I'm using irssi
Bronsa has quit [Ping timeout: 264 seconds]
mercourisj has quit [Remote host closed the connection]
psq_ has quit [Ping timeout: 252 seconds]
orivej has quit [Ping timeout: 240 seconds]
siraben has quit [Ping timeout: 268 seconds]
JuanDaugherty has joined #lisp
razzy has joined #lisp
emacsomancer has quit [Ping timeout: 240 seconds]
m00natic has quit [Remote host closed the connection]
lumm has quit [Quit: lumm]
Fare has quit [Ping timeout: 248 seconds]
lumm has joined #lisp
<v0|d> jackdaniel: news on profiler?
hiroaki has joined #lisp
test1600 has quit [Ping timeout: 256 seconds]
shka_ has quit [Remote host closed the connection]
shka_ has joined #lisp
jxy has quit [Quit: leaving]
schweers has joined #lisp
pierpal has quit [Quit: Poof]
jxy has joined #lisp
pierpal has joined #lisp
v0|d has quit [Ping timeout: 260 seconds]
<schweers> I have a problem starting ECL from slime on windows 10. I used the binary installer (I have no idea how to invoke autoreconf on mingw/msys). Starting ecl from the start menu item works, but starting it from slime, I get an “error” loading “sockets.fas”: "The operation completed successfully.
<schweers> ". I have seen this issue: https://gitlab.com/embeddable-common-lisp/ecl/issues/293
<schweers> But I can’t make sense of it.
<jackdaniel> schweers: precompiled version is outdated; instructions how to compile on windows are in the manual
<jackdaniel> v0|d: what kind of news? I'm lost here
<phoe> beach: How do you plan on securing LispOS from dynamic-extent misuse?
<jackdaniel> phoe: he plans to ignore this declaration, unless it may be proven that variable indeed has dynamic-extent
<phoe> jackdaniel: ooh, I see! Got it. Thanks.
random-nickname is now known as random-nick
<jackdaniel> schweers: yes
<jackdaniel> (I need to go, making pancakes)
Fare has joined #lisp
Inline has quit [Quit: Leaving]
Inline has joined #lisp
<beach> phoe: Yes, definitely.
FreeBirdLjj has quit [Remote host closed the connection]
lumm has quit [Quit: lumm]
d4ryus has quit [Quit: WeeChat 2.2]
d4ryus has joined #lisp
zxcvz has joined #lisp
shachaf has joined #lisp
<beach> phoe: I mean, what jackdaniel said.
<phoe> beach: yes, I understood that.
sauvin has quit [Read error: Connection reset by peer]
Fare has quit [Ping timeout: 256 seconds]
<phoe> Which Lisp data structure should I use if I want to be able to insert into it, get the count of all elements, and remove an element at random?
<Ober> hash
<phoe> How can I remove an element at random from a hash-table?
<Ober> but 50 years of "List processing" (length lst) is still not O(1)
<Bike> remhash
<Bike> or do you mean picking an element randomly
<Bike> if so, do you actually mean randomly, or just arbitrarily
<phoe> Picking it at random and removing it from the hash-table, yes.
<Ober> order is random
<sjl_> phoe: make a hash bag element with an index vector, like stylewarning's hash-set interface
<Ober> s/random/undefined
<phoe> Random, as in, I want actual true randomness here.
<Ober> random * (mod (length hash))
<stylewarning> “hash bag” nice term
<sjl_> stylewarning: "multiset" is too fancy for me... and hash-(map|set|bag) is nice cause they all have 3 letters :)
<Shinmera> phoe: the random removal is free if you can remove an arbitrary element in constant time and can know the size, since then you can just (remove (random N) structure)
<sjl_> phoe: if all you need is insert + count + remove you could probably get away with a vector with some logic to move the last element into the "hole" when you remove an element, like in the link I posted
<phoe> I actually think such a thing would be good enough. Basically an extensible vector.
m3tti has joined #lisp
<pjb> Ober: order in hash-tables is not random, it's unspecified.
<sjl_> phoe: you just lose the insertion order of the elements once you start removing, which might be fine if you don't care about preserving insertion order
<pjb> phoe: are you okay with removing the element in O(n)?
<phoe> pjb: I'd use Lisp lists if it was. (:
<phoe> sjl_: right, I don't care for insertion order.
<phoe> pjb: in the worst case, I'll use lists, I am just looking for a smarter solution.
<pjb> well, there's a difference. with list, removing an element is O(1) if you know the previous cons.
<pjb> (vector-push-extend e v) (let ((r (random (length v)))) (replace v v :start1 r :start2 (1+ r)) (decf (fill-pointer v)))
<sjl_> but if you don't care about reserving the insertion order, replace REPLACE with SETF to just swap the final element
<sjl_> *preserving
<pjb> Indeed.
<sjl_> only downside is needing to resize the array on insertion sometimes
<pjb> (vector-push-extend e v) (progn (rotatef (aref v (random (length v))) (aref v (1- (length v)))) (decf (fill-pointer v)))
<pjb> So it's O(1) amortized insertion and O(1) extraction of a random element.
<pjb> sjl_: not with fill pointers ;-)
<sjl_> don't rotatef it, there's no reason to bother putting the removed element into the space that's just gonna get overwritten on the next push
<sjl_> pjb: you'll occasionally need to resize if the fill pointer is already at the end, but usually you won't
<pjb> sjl_: this is taken care by vector-push-extend.
<pjb> Just use 3 arguments: (vector-push-extend e v (length v))
<sjl_> I'm talking about the work required, not who types it
<pjb> ok.
<pjb> (defun add-element (v e) (vector-push-extend e v)) (defun extract-element (v) (prog1 (setf (aref v (random (length v))) (aref v (1- (length v)))) (decf (fill-pointer v))))
<pjb> Oops.
<pjb> (defun add-element (v e) (vector-push-extend e v)) (defun extract-element (v) (let ((r (random (length v)))) (prog1 (aref v r) (setf (aref v r) (aref v (1- (length v)))) (decf (fill-pointer v)))))
<sjl_> now null out the slot you removed so it can get gc'ed later :)
<pjb> If it's needed. Otherwise, and since it only grows the vector, you may want to resize down the vector when you've extracted a bunch.
m3tti has quit [Remote host closed the connection]
m3tti has joined #lisp
Fare has joined #lisp
<aeth> pjb almost has the answer (swap them)
<aeth> It's actually more lines than that, though. You probably want (declaim (inline add-element)) ;-p
<pjb> We want to avoid two stores.
<pjb> rotatef is no more lines thant setf.
<pjb> But it's more memory accesses.
<pjb> On the other hand, if you want to clear the last element, we can use (shiftf (aref v r) (aref v (1- (length v))) nil)
<pjb> But we may still want the (prog1 (aref v r) …) to get the removed element.
figurelisp has joined #lisp
m3tti has quit [Remote host closed the connection]
m3tti has joined #lisp
schweers has quit [Ping timeout: 240 seconds]
m3tti has quit [Client Quit]
rpg has joined #lisp
hiroaki has quit [Ping timeout: 240 seconds]
<sjl_> huh, TIL about shiftf. neat.
<sjl_> pjb: shiftf returns the value it shifts out of the first element, right? so you don't need the separate aref in the prog1
<sjl_> *first place
<sjl_> q/b 5
<pjb> Oh, right. use shift and skip the prog1.
<sjl_> and if you're sneaky and decf the fill-pointer first and remove the 1- you could avoid the prog1 altogether, though that's kind of gross
Jesin has quit [Remote host closed the connection]
<pjb> you need to decf fill-pointer between the random length and the aref length :-)
<pjb> (defun extract-element (v) (shiftf (aref v (random (length v))) (aref v (decf (fill-pointer v)))))
<fouric> does anyone else have troubles getting SLIME to display lambda-lists in the emacs minibuffer while a process is running in the REPL?
<pjb> (let ((v (make-array 10 :fill-pointer 0 :adjustable t))) (loop for i below 20 do (add-element v i)) (loop repeat 3 collect (extract-element v))) #| --> (5 1 10) |#
<sjl_> should handle the empty case a bit more gracefully, but that works
<pjb> fouric: perhaps it depends on the connection mode. It should work when threads are used.
<pjb> sjl_: I expectde the empty case to be handled by pre-conditions. (ie. a docstring).
<fouric> pjb: "connection mode" being the connection between swank and slime?
<sjl_> I'd still rather have an error message like "Cannot extract element from empty extraction vector" instead of "Argument is neither a positive integer nor a positive float: 0"
Jesin has joined #lisp
hiroaki has joined #lisp
<aeth> Isn't that just this? (when (zerop (length v)) (error "Cannot extract element from empty extraction vector"))
<pjb> fouric: yes.
<sjl_> yes
<aeth> What's great about vectors over lists is the O(1) length instead of the O(n) length
<sjl_> or (assert (plusp (length v)) () "Cannot extract...")
<pjb> swank:*use-dedicated-output-stream* IIRC, and perhaps also swank:*globally-redirect-io*
<pjb> sjl_: yes.
shka_ has quit [Ping timeout: 240 seconds]
<fouric> thanks! i'll look at it but i'm not super hopeful i'll be able to even figure out which mode i'm using
figurelisp has quit [Quit: leaving]
jmercouris has joined #lisp
doubledup has joined #lisp
<aeth> sjl_: or (defun foo (v) (let ((length (length v))) (handler-case (check-type length alexandria:positive-fixnum) (simple-type-error (x) (error "Cannot extract...~%~A~%" x))) v))
aindilis has quit [Remote host closed the connection]
ckonstanski has joined #lisp
light2yellow has quit [Quit: enough socialization for today]
aindilis has joined #lisp
josemanuel has quit [Quit: leaving]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
orivej has joined #lisp
ckonstanski has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 260 seconds]
meepdeew has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
random-nick has joined #lisp
mooshmoosh has joined #lisp
test1600 has joined #lisp
doubledup has quit [Remote host closed the connection]
mindCrime_ has quit [Ping timeout: 240 seconds]
void_pointer has joined #lisp
zxcvz has quit [Quit: zxcvz]
Bike_ has joined #lisp
Bike has quit [Ping timeout: 252 seconds]
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
Bike_ has quit [Ping timeout: 252 seconds]
<gendl> Hi, has anyone ever had a good experience with an online editor for CL?
<gendl> as in these "cloud development environments"
<gendl> There is this: http://www.ymacs.org/ but it does not exactly look like a hotbed of activity..
v0|d has joined #lisp
<gendl> it seems like in 2018 the best option for an "online" development experience is still running real Emacs locally and connecting to a remote CL with slime/swank -- agree, disagree?
sjl_ has quit [Quit: WeeChat 2.2-dev]
<no-defun-allowed> Yeah, that's what I've found best.
ckonstanski has joined #lisp
angavrilov has quit [Remote host closed the connection]
<pjb> gendl: yes, it's the best solution.
LiamH has quit [Quit: Leaving.]
<void_pointer> I've not used it, but I think I saw recently that there is now a common lisp notebook for Jupyter and Jupyter can be used online. Given that Jupyter was originally meant for python and its editting capabilities for python are rather limited, I would guess that it doesn't offer much for common lisp other than maybe syntax highlighting. I don't know though. I guess take a look
<pjb> gendl: even if you can use make-frame-on-display remotely, it's usually more effective to use tramp and edit locally.
<void_pointer> Also, it is jupyter, so it is more for doing computations and displaying the results. It doesn't look like it has much of any debugging capability and it is hard to imagine how it could even be added.
<aeth> This also could be an option in the future, but it's still (1) an incomplete CL and (2) just a basic REPL. https://jscl-project.github.io/
<aeth> It has some 2018 activity, though. https://github.com/jscl-project/jscl/
<jmercouris> aeth: but why not target web-assembly instead?
ckonstanski has quit [Ping timeout: 244 seconds]
<aeth> jmercouris: (1) jscl is years older than wasm (even the initial announcement) and (2) wasm still hasn't solved the GC problem afaik
<jmercouris> GC problem?
<aeth> and I guess (3) if you're going to target wasm, just recompile an existing complete implementation and use wasm as a new architecture backend and save a ton of work
<jmercouris> I think point 3 is the most salient
<void_pointer> jmercouris: having seen discussion on targetting wasm from scheme, one difficulty is the lack of a garbage collector built into wasm (one would need to implement one within it) where as javascript has one by default
<jmercouris> though I can't even imagine what that would entail, I seem to recall some document discussing how to port CCL
mindCrime has joined #lisp
<jmercouris> Oh, I see
<aeth> If you implement your own GC in WASM, you are afaik going to have it be horribly inefficient because WASM isn't low-level enough.
<aeth> Even if you were to port SBCL to WASM, you'd use the host's GC
<jmercouris> I'm sure that'll get fixed with time
<void_pointer> making a simple GC in wasm shouldn't be too hard, but as aeth mentioned, good performance would be hard
<void_pointer> hmm, wonder if anyone is working on porting picolisp to wasm
<jmercouris> so since there are efforts underway to port C to webassembly, does that mean you could possibly just use ECL wholesale?
<void_pointer> that seems like it would be an order of magnitude easier than porting any common lisp or scheme implementation to wasm
<aeth> Afaik yes, ECL will be the easiest to port, but with the efficiency issues unless it uses the host's GC.
test1600 has quit [Quit: Leaving]
<jmercouris> Well, not to mention the other performance issues ECL has in general
<aeth> It's hard to make any implementations except 64-bit SBCL and CCL perform afaik
<aeth> (32-bit versions will be creating *a lot* more garbage)
<jmercouris> so, let's say we do get CL to run in the web
<jmercouris> what would one possibly do with that?
<jmercouris> s/web/web browser
<jmercouris> I can't imagine, would one distribute CL images as applications that can run in the browser?
<pjb> jmercouris: that'd be the purpose.
<aeth> jmercouris: The next step after CL in the browser would be to add WebGL support to cl-opengl and find some way to either work with SDL as well or replace SDL backends for frameworks/libraries/engines with whatever wasm would use for the equivalent functionality
<pjb> jmercouris: of course, an alternative is just to use jslinux and ccl.
<pjb> or clisp or ecl; they might be easier to port to jslinux.
<jmercouris> I guess it would certainly make distribution easier
<aeth> jmercouris: A wasm SBCL or CCL using WebGL might eventually get passable performance for all the stuff currently written for cl-opengl
<jmercouris> well, it could work for simple applications
Bike has joined #lisp
<varjag> then you can finally run clim natively on the web
<aeth> jmercouris: I think ideally what you'd want to do eventually is port Next Browser to wasm
<aeth> varjag: CLIM would need a new GL backend. Afaik the old one got removed for basically using idiomatic 1999ish OpenGL when the dominant 3D API paradigm has changed several times since then
<aeth> You'd want to use WebGL if you're using wasm
<aeth> I think you could also use canvas, though. I'm not sure.
<aeth> Of course, this is essentially reinventing the Flash plugin, except it would be a version where you'd have to redownload the Flash plugin with every in-browser Flash app.
<void_pointer> probably the easiest common lisp like thing to implement in wasm once the C -> wasm stuff works would probably be μlisp since it is designed for very small image sizes and RAM (2 KB even), though all the low level hardware stuff would need to be drastically changed
<jmercouris> aeth: why would I want to port Next to WASM?
<aeth> jmercouris: so you can run Next in Next
<jmercouris> Lol
<jmercouris> I'm sure you've heard of the browser that has its UI written in JS that runs within the browser
<jmercouris> it was some experimental Mozilla browser IIRC
<aeth> There are several afaik
quipa has quit [Ping timeout: 240 seconds]
meepdeew has quit [Read error: Connection reset by peer]
meepdeew has joined #lisp
vlatkoB has quit [Remote host closed the connection]
random-nick has quit [Read error: Connection reset by peer]
mindCrime has quit [Read error: Connection reset by peer]
mindCrime has joined #lisp
<no-defun-allowed> yeah the servo people didn't want to write it in C and they decided Rust was too annoying so they did it in JS for some reason
<no-defun-allowed> wait no, it couldn't be "too annoying", they wrote servo in rust
<no-defun-allowed> lazy bastards.
kajo has joined #lisp
quipa has joined #lisp
hiroaki has quit [Ping timeout: 244 seconds]
Denommus has quit [Remote host closed the connection]
kajo has quit [Remote host closed the connection]
kajo has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<jmercouris> right, I was thinking of servo
jmercouris has quit [Remote host closed the connection]
kajo has quit [Read error: Connection reset by peer]
test1600 has joined #lisp
moei has quit [Quit: Leaving...]
moei has joined #lisp
nonlinear has quit [Quit: WeeChat 2.0.1]
void_pointer has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
robotoad has quit [Quit: robotoad]
Fare has quit [Ping timeout: 240 seconds]
lavaflow has quit [Ping timeout: 268 seconds]
meepdeew has quit [Remote host closed the connection]
chipolux has joined #lisp
pjb has quit [Ping timeout: 256 seconds]
pjb has joined #lisp
nonlinear has joined #lisp
Fare has joined #lisp
lavaflow has joined #lisp
ym has quit [Remote host closed the connection]
chipolux has quit [Ping timeout: 244 seconds]