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
travv0 has joined #lisp
thinkpad has joined #lisp
travv0 has quit [Ping timeout: 244 seconds]
travv0 has joined #lisp
nirved has quit [Ping timeout: 252 seconds]
Arcaelyx has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
<aeth> A let* variant with m-v-b is pretty simple, just use m-v-b in the correct moment. A let equivalent is trickier because let followed by m-v-b would take the let's values.
<aeth> I think this could work, though: (defun foo (x y) (flet ((bar () (ffloor x y))) (declare (inline bar)) (let ((x 42f0)) (multiple-value-bind (a b) (bar) (+ a b))))) ; takes the outer x, and the inner x is unused
<aeth> Essentially, capture the outer scope with a closure, but inline it so the closure is eliminated and it's like it was never there, except to tell it to use the outer x.
<Bike> (multiple-value-bind* (((a b) form1) ((c d e) form2)) ...) => (multiple-value-bind (#:a #:b) form1 (multiple-value-bind (#:c #:d #:e) form2 (let ((a #:a) ...) ...))) is fine, isn't it?
<aeth> Oh I see. So bind temporarily to a gensym, and then put all of the bindings in one big let.
<Bike> also makes declarations a no brainer
<aeth> And this would work for combining let, destructuring-bind, multiple-value-bind, etc.
<aeth> Bike: There's still one problem: adding flet and macrolet to the mix (and symbol-macrolet?)
<aeth> Oh no wait the flet goes above the let
<aeth> Since the innermost let just uses the gensyms and has no function calls
<Bike> macrolet operates at compile time, so itnerleaving it is probably not a great idea
<Bike> i don't know why flet would be a problem
Achylles has joined #lisp
<aeth> Bike: flet is not a problem, you are right, it would be (flet ... (let ((a #:a) ...) ...))
<Bike> really much less of a problem since there's no side effect ordering to care about
<aeth> It looks like let, m-v-b, flet, and destructuring-bind are combinable, and let*, m-v-b, labels, and destructuring-bind are combinable, and let winds up actually being a bit easier (rather than the other way around) because there are only two levels of final bindings: the flet and the let.
<Bike> now do letrec
<aeth> letrec would use labels instead of flet, but still use let instead of let*?
zbigniew has joined #lisp
zbigniew has left #lisp [#lisp]
pierpal has joined #lisp
pierpal has quit [Ping timeout: 260 seconds]
Achylles has quit [Remote host closed the connection]
<dim> there's let+ and metabang-bind doing that kind of things already, and certainly more projects than we can count
elderK has joined #lisp
<aeth> dim: Absolutely, however I want something that accompanies my define-function macro.
<aeth> It does, of course, already exist to some extent. The closest library is defstar, which is GPLv3 and thus essentially unusable for the vast majority of users.
<aeth> If I'm going to combine types with bindings, though, I might as well combine different kinds of bindings, though.
<aeth> (too many thoughs)
<aeth> dim: I think I can be safe to say that my define-function does more than most equivalents, and my let-equivalent will probably also be superior. I did not put in a little bit of effort that a throwaway has since this is the foundation of a large part of my game engine.
<aeth> e.g. Unlike defstar, define-function allows easy per-function configuration for whether or not check-type should be used instead of type declarations. It looks like defstar relies on a global there, which is very problematic. The documentation also suggests that it does both declarations and check-type in that mode, which doesn't work on SBCL (SBCL will delete the check-type as unreachable code, it's either/or in SBCL)
<dim> nice!
<dim> that said I should get some sleep, good luck with define-function! (maybe that could be shipped separately from the 3d game engine when you're happy with it?)
<aeth> I'll definitely spin off parts of my util library when they are complete (atm only define-function is "complete")
matzy_ has joined #lisp
<aeth> Which parts will be tricky since once I do so I basically lock in the API
<aeth> dim: good night
<aeth> (In case anyone is wondering why using a global is problematic for a configurable defun, keep in mind that a LET makes a function definition no longer considered as top-level. Only certain forms like PROGN are allowed there. So you can't always just rebind the dynamic global locally with a LET around the function definition when you need to.)
<aeth> (Also, I'm not sure if the LET would work at macro-expansion time or just at runtime.)
orivej has joined #lisp
pierpal has joined #lisp
travv0 has quit [Quit: Lost terminal]
ealfonso has quit [Ping timeout: 245 seconds]
noobly has joined #lisp
Kundry_Wag has joined #lisp
xkapastel has joined #lisp
Kundry_Wag has quit [Ping timeout: 272 seconds]
Oladon has joined #lisp
noobly has quit [Quit: Page closed]
travv0 has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 245 seconds]
travv0 has quit [Quit: leaving]
travv0 has joined #lisp
ealfonso has joined #lisp
buffergn0me has quit [Remote host closed the connection]
robotoad has joined #lisp
buffergn0me has joined #lisp
sjl has quit [Ping timeout: 245 seconds]
Tordek has quit [Ping timeout: 276 seconds]
Tordek has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Read error: Connection reset by peer]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
igemnace has joined #lisp
wanz has joined #lisp
buffergn0me has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
buffergn0me has joined #lisp
robotoad has quit [Quit: robotoad]
<aeth> Oh, fun fact: define-function is no longer portable because (length (documentation 'define-function 'function)) is 2565 and ARRAY-TOTAL-SIZE-LIMIT "is not less than 1024"
robotoad has joined #lisp
<no-defun-allowed> rip
<no-defun-allowed> that's a bit low
<capadoodle> is it better style to explicitly call out the package that an external symbol is from when used within your package? `package:function` rather than just `function`? Right now my package only depends on clim
<aeth> capadoodle: There are three styles, each with drawbacks. You can :use a package, you can :import-from specific symbols from a package, or you can explicitly use the symbols like you said.
<beach> Good morning everyone!
<aeth> capadoodle: The disadvantage of :use is that even though there is no current conflict, a symbol could be added in the future creating a future name conflict. The disadvantage of :import-from is that you have to list every symbol you're going to use and it's easy to forget to remove it from the import if you're no longer using it (no tool currently detects this afaik).
<aeth> capadoodle: And the disadvantage of always saying the package name is that the package name can be very long and nicknames are discouraged because nicknames can name conflict, especially very short nicknames.
<aeth> capadoodle: I think in general using :use is discouraged except for the package CL
<pfdietz> :use also has the danger that you may accidentally redefine something with that symbol.
<aeth> Fortunately, redefinition of functions and macros can give a warning (depending on the implementation) so at least you can detect that.
<aeth> This is assuming you quickload with :verbose t
Roy_Fokker has quit [Read error: Connection reset by peer]
<capadoodle> makes sense, I think I'd be partial to always saying the name, especially for clim which is so short already. the documentation for clim recommends using clim and clim-lisp rather than CL :( why is that? seems potentially shady
mejja has quit [Quit: mejja]
<capadoodle> seems weird to :use :clim-lisp and then do clim: elsewhere
n3k0_t has quit [Ping timeout: 246 seconds]
<beach> I think CLIM-LISP makes the same promise as COMMON-LISP, i.e. no new symbols will be added, and only symbols with the same names as those in COMMON-LISP are present.
<beach> Besides, your program would look very strange if you had to write CLIM-LISP:CAR, CLIM-LISP:IF etc.
<beach> It looks like you should be able to just use the COMMON-LISP package instead.
n3k0_t has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
varjag has joined #lisp
varjag has quit [Ping timeout: 240 seconds]
<asarch> How could I know the current version of ASDF (for example, from a running session of clisp)?
<asarch> "/home/asarch/quicklisp/dists/quicklisp/software/bordeaux-threads-v0.8.6/bordeaux-threads.asd: You need ASDF >= 3.1 to load this system correctly."
<beach> asarch: Normally, you don't have to care. If you install a recent version of your Common Lisp implementation, it comes with an appropriate version of ASDF.
travv0 has quit [Quit: Lost terminal]
<beach> asarch: Though that might not be true for CLISP.
<beach> I don't know the status of that implementation.
<beach> asarch: Do you have any particular reason for using CLISP rather than one of the more widespread implementations?
dale has quit [Quit: dale]
anewuser has joined #lisp
<asarch> Well, all my attempts to have SBCL with threads on OpenBSD 6.4 for AMD64 have miserably fail
<asarch> *failed
<beach> I see.
<beach> What about ECL?
<asarch> That was the output of (ql:quickload "aserve") of clisp-2.49p2
<asarch> That's for C linking, right?
<beach> It generates C code that is then compiled with the C compiler, yes.
<asarch> ecl-16.1.3p1.tgz
<asarch> Wow! Let's see then
<asarch> Thank you beach
<asarch> Thank you very much :-)
<beach> But I don't know much more about it. I am suggesting ECL because jackdaniel maintains it and he is often here, so you can ask him questions.
<asarch> Thank you very much once again :-)
<asarch> I will
<beach> ... whereas the the CLISP maintainers don't seem to come here.
<asarch> :-(
Kundry_Wag has joined #lisp
xkapastel has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
<aeth> SBCL, CCL, and ECL people seem to be accessible from IRC
<aeth> (Also, the developers from some currently incomplete implementations like Clasp and SICL)
<no-defun-allowed> yeah they've all got IRC names
dale has joined #lisp
_whitelogger has joined #lisp
danielxvu has quit [Remote host closed the connection]
danielxvu has joined #lisp
meepdeew has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Bike has quit [Quit: Lost terminal]
doubledup has joined #lisp
doubledup has quit [Max SendQ exceeded]
Oladon has quit [Quit: Leaving.]
Kundry_Wag has quit [Ping timeout: 272 seconds]
n3k0_t has quit [Ping timeout: 268 seconds]
<elderK> Hey guys, here's the result of my "on off" tinkering over the past few days.
<elderK> It's not complete yet, but I thought I'd post it for some feedback.
nly has quit [Ping timeout: 272 seconds]
<beach> elderK: Do you want remarks on your code?
<elderK> Yes please :) As long as they are constructive.
<beach> In splitter.lisp, you violate one of the rules of the LUV slides by Norvig and Pitman, in that you use WORKLIST as a Boolean variable, but it is a list. It is better to write UNTIL (NULL WORKLIST) instead of WHILE WORKLIST.
<beach> Same thing for WHILE CELL-LOCATION.
<elderK> Cool. I was not aware of the null predicate.
<beach> clhs null
<elderK> I searched for null? and nullp :D
<beach> It is more common to put the LOOP keyword first on a line, rather than last on the preceding line.
<beach> To make that work, you need the SLIME-INDENTATION contribution, or your loop clauses might not have the right indentation.
makomo has quit [Ping timeout: 244 seconds]
<beach> Otherwise, it looks idiomatic to me. I haven't looked at the program logic, though. Just checked for idiomatic constructs.
<elderK> Thank you. By loop keyword, do you mean do?
<elderK> One thing I'm not happy with, is how I have duplicated the "for y below.... do for x below ... " stuff quite often.
<elderK> I initially had a function, on-each-cell, but that would up being more a PITA to use than just, duplicating the iteration.
<elderK> I.e. I had to define a function with lambda or flet, and pass it into say, on-each-cell.
nly has joined #lisp
n3k0_t has joined #lisp
<no-defun-allowed> (loop for VAR below NUM do THING) can be replaced with (dotimes (VAR NUM) THING) to save words
<elderK> One thing I would like to know: What is the convention for functions that alter their input? I'm used to the form "something!" from Scheme, if something mutates one of its arguments.
<no-defun-allowed> elderK: n___? there's nconc at least.
<elderK> Thanks no-defun-allowed.
<no-defun-allowed> i wrote a macro for cl-vep which did a similar thing, mapping an expression over one or more three-dimensional arrays
<elderK> I'm not particularly happy with the splitter code. Like, it seems like its doing a lot. I'd like to factor it out further, but I couldn't think of any good names for its pieces.
<elderK> It wound up being simpler to keep it as one unit, rather than try to b reak it apart :(
<beach> Yes, WITH, FOR, DO, UNTIL, UNLESS, etc are all LOOP keywords.
<elderK> So, they always come first.
<beach> Typically, yes.
<elderK> Is it idiomatic to have do on a line of its own? Or do you have thing slike, do (.... stuff ....)
<elderK> Everything would be indented a bit by the do.
<beach> It is not typical to have a newline after DO.
<elderK> :) I'm also curious as to the proper way to align "with ....." clauses.
<beach> They align with the other clauses.
<beach> Only conditional clauses are indented.
<elderK> Say,
<elderK> The "and" isn't indented?
<elderK> and y = .....
<elderK> with x = ......
<beach> But SLIME-INDENTATION is pretty good with that, so you don't have to think about it.
vlatkoB has joined #lisp
<beach> I don't remember, but I think so.
<elderK> :( I use slimv. So, I have to learn a lot of these rules myself.
<beach> In this case, you don't need the AND though. You can just have several WITH clauses.
<beach> Ouch.
<no-defun-allowed> AND is only crucial when you need them to be set in parallel.
<elderK> slimv's not bad :) Not as awesome as SLIME perhaps, but it is pleasant enough to work with :)
<beach> elderK: Manual indentation is a very bad idea.
<elderK> Ah, okay. I was thinking like, maybe using and would be better or something. Like, I figure the with ... and ... is like let. And with ..., with ... is like let*
<elderK> beach: I agree. Unfortunately, slimv only does so much.
* beach keeps quiet about his thoughts.
* |3b| thinks AND suggests it matters which you used, so WITH is easier to parse mentally
* no-defun-allowed can't think of a "slime time" pun. ):
<no-defun-allowed> "might be time to install slime"
<elderK> beach: I know I should probably learn Emacs and just use SLIME proper. Iono. I'm very attached to vim.
<|3b|> elderK: or improve slimv so it can indent for you :)
<elderK> That would be ideal :)
<|3b|> (and/or one of the various vi/vim clones for emacs so you can use slime's indentation)
<elderK> Still, if necessary, I don't mind correcting it. It autoindents pretty well for the most part. It just doesn't seem to have rules for loop.
<elderK> Like evil or viper? :)
anewuser has quit [Quit: anewuser]
* |3b| has lost track of them :p
<|3b|> isn't there another popular one now?
* elderK shrugs
<elderK> Evil, I think. But I may be mistaken.
notzmv has joined #lisp
<elderK> :) I'm enjoying using Lisp so far. The C++ version of this program is much, much, much larger. Even at the same "feature point"
<|3b|> yeah, probably
<|3b|> (evil i mean)
<elderK> I'm starting to get used to navigating and parsing CLHS, too. Thank you again for referencing me to the description of the grammar CLHS uses.
<elderK> :)
rippa has joined #lisp
<beach> I have an idea. I should recruit all the vim users that program in Common Lisp to help out with Second Climacs. That way, they can have their favorite key bindings, modes, and whatnot, at the same time that they get a programming environment that is superior to that of SLIME. :)
* beach can imagine the considerable additional personpower available.
* |3b| suspects vim users run fewer large applications (irc, email, etc) in their editor too, so possibly easier to get them to switch once it is usable for lisp code editing
<beach> Good thinking there.
<no-defun-allowed> hah
<elderK> Back! :)
ggole has joined #lisp
<elderK> Iono. I know that Emacs is a lot better for Lisp development but, man, I've been using Vim for so, so long. I imagine I feel about it, as you do about Emacs - it's almost like an extension of you when you work. One day, I /should/ learn Emacs. But for now, I'd like to focus on playing with Lisp itself :)
<beach> One more argument: Emacs is written in (Emacs) Lisp, so Common Lisp programmers can probably modify it and add features to it fairly easily. I imagine users of vim who program in Common Lisp would love to have a vim-like editor written entirely in Common Lisp.
<elderK> Although Light Table did look pretty neat
notzmv has quit [Remote host closed the connection]
<elderK> That would be pretty awesome :D
<elderK> Vimscript isn't exactly my favorite thing :P
<elderK> And tbh, a lot of "interactive repl" type stuff in Vim is usually pretty... flakey. Particularly as "asynchronous stuff" was only added reasonably recently.
<|3b|> yeah, though emacs has too much C, so that's true for emacs users too
<elderK> I'm thinking my next "experiments" in CL will be to make a basic graphical program with a "little" binding for SDL.
<elderK> I've poked CFFI in the eye before. It would be neat to learn how to use it properly.
<beach> Aww!
<beach> elderK: Can I convince you to use McCLIM instead?
<elderK> I suppose I should finish the current "experiment" though. I still have to add support for say, reading worlds from file, etc.
<elderK> Probably not at this point.
<elderK> :) What is McCLIM?
<beach> Hmm.
<elderK> Googled :)
<no-defun-allowed> "the galaxy's greatest GUI toolkit" iirc
notzmv has joined #lisp
<elderK> It's not that I have anything against McCLIM. It looks to be an impressive piece of work. If I were developing something GUIish, I would definitely opt to give it a shot. But, for now, it looks to be far more than I require.
<beach> elderK: OK, so here is what I think...
<elderK> :) CL might be easily become my language to like, make GUI in. I abhor Java's Swing. And, I never bothered to learn Qt.
<jcowan> elderK: The name `null` goes back to the earliest days of Lisp 1.0; it has never been nullp.
<beach> elderK: If you work on your own stuff using FFI and SDL bindings, you will get work done perhaps a bit faster, but it won't benefit the community.
<elderK> Okay :) nullp was just a quick guess in Zeal.
Kundry_Wag has joined #lisp
<beach> elderK: But if you work on or with McCLIM, you might take a bit longer to learn it, but it will have an impact to other people here as well.
<|3b|> (or do something with one of the existing SDL bindings)
<jackdaniel> fwiw if he works on sdl bindings many people will benefit as well
<jackdaniel> but yes, more hands to help with McCLIM is welcome, you'll be able to brag that you work on technology older than you ;) many interesting parts of code (educational-wise)
<elderK> I'd like to help the community. But I need to be comfortable in Lisp before I start on that path.
<jackdaniel> well, maybe not older after a second thought, nvm
<elderK> I'm 31 if that helps :D
<elderK> Does McCLIM allow say, access to an OpenGL context?
<|3b|> not very well :/
<|3b|> (at least last i heard)
Kundry_Wag has quit [Ping timeout: 240 seconds]
<fiddlerwoaroof> asarch: I've managed to get a multithreaded sbcl on openbsd 6.4
<jackdaniel> there are two ways to have it working: 1) create opengl backend (harder); 2) create a custom opengl gadget (easier)
<|3b|> jackdaniel: would 2 still go through CLX?
<elderK> :) Any advice on what unit test frameworks to use? There seem to be a lot around.
<elderK> That's probably something I should learn about before I begin on any kind of binding :)
notzmv has quit [Ping timeout: 240 seconds]
<|3b|> or are there non-clx backends for mcclim again?
<fiddlerwoaroof> elderK: 5am is probabyly the closest thing to a standard
<on_ion> framebuffer
<fiddlerwoaroof> elderK: I generally prefer should-test
<elderK> Any reason why?
<elderK> (I have no experience with any of them but I'm interested in your experience)
<elderK> Is it simpler to use?
<jackdaniel> |3b|: I imagine that would require some piping to extract drawable from clx window and pass it to the library doing the opengl to use it
<jackdaniel> I haven't done that, I just think it should be possible
* |3b| thought there was some problem with the protocol getting out of sync when you mixed CLX with FFI GL, but i guess you could create a subwindow with ffi or something
<jackdaniel> well, I certainly didn't take that into account when I've made a suggestion, I'm wasn't aware of clx <-> ffi problems
<LdBeth> well, seems mcclim still have problem dumping application
<|3b|> been a long time since i've looked at mcclim, so possibly i'm misremembering things, or someone was doing things wrong to cause problems in the first place :)
stux|RC has joined #lisp
<jackdaniel> LdBeth: since when mcclim does "dumping application"?
<beach> |3b|: I think this problem still exists.
* |3b| wants option 1 anyway though, since i don't have any X at the moment, and want to display on things that aren't normal 'screens' anyway :p
<LdBeth> jackdaniel: start a lisp with a image preloaded mcclim would fail
<jackdaniel> start lisp image with mcclim preloaded*. how does it fail? did you report an issue?
<LdBeth> precisely is the graphical lisp listenser
<Inline> heh
<Inline> no you don't start it right away
<Inline> you have to have a :top-level function to specify when you dump the image
<Inline> such that it invokes that right after start
<Inline> after start of the image
<Inline> otherwise you start the image and invoke the gui from there
<beach> LdBeth: Works fine here.
<elderK> fiddlerwoaroof: should-test looks nice and simple :)
<elderK> prove looks nice too
angavrilov has joined #lisp
<beach> LdBeth: Oh, sorry, the listener starts additional threads, so the image can't be saved. But dumping an imagine with (say) Clouseau works fine.
<beach> LdBeth: So it is not a McCLIM problem.
<fiddlerwoaroof> elderK: it's mostly that I like the way the tests look with should-test
<elderK> You mean output?
<fiddlerwoaroof> now, the code
<LdBeth> beach: so use (clim-listener:run-listener) is expected to fail?
<Inline> no
<beach> LdBeth: No, what makes you think that.
<beach> LdBeth: I was saying that once you load the listener, SBCL can no longer save the image.
<fiddlerwoaroof> Because multiple threads are running?
<beach> Yeah.
<LdBeth> ah, yes
<beach> I don't know why simply loading the listener starts more threads, though.
<beach> Loading something like Clouseau does not, so it saves the image fine.
<no-defun-allowed> does it start a thread to run the CLIM loop? iirc you can still eval stuff in stdin/slime
<Inline> usually it's not a thread
<beach> I was able to do (asdf:load-system :clouseau), then (save-lisp-and-die...), then run SBCL with the new core, and finally (clouseau:listener '(a b c))
<Inline> i make it a thread but that's me
<beach> no-defun-allowed: I was not running any CLIM application, just compiling the listener.
<no-defun-allowed> ah, alright
<Inline> you just load all the libs and dump the image
<Inline> that's all there is to it
<Inline> you do the starting of the image etc. all when using the image
<no-defun-allowed> how do you save the state of all the threads then?
<Inline> err starting of the gui*
<no-defun-allowed> oh yeah nvm
<beach> Inline: I think I just reported an experment where "just loading all the libs" resulted in failure to save the image.
<Inline> oh ok that's new
<Inline> i don't have that problem
<beach> Inline: With the CLIM Listener, you don't have a problem?
<Inline> yah
notzmv has joined #lisp
<Inline> i don't
<beach> Interesting.
<beach> Let me try it again then...
<Inline> i can give you my image creating script if you want
<beach> Oh, it worked this time.
<beach> Weird.
<beach> LdBeth: I take that back. It is indeed possible to save the image with the CLIM Listener pre-loaded.
<LdBeth> beach: No problem then
<beach> LdBeth: So I don't know how you think that this might have been a problem.
<beach> Another reason for not using McCLIM has just been eliminated.
<beach> Oh, maybe when it failed, I first ran Clouseau. That might have created a thread.
<LdBeth> so currently the thread is not finalized
<beach> I don't know what that means.
<LdBeth> Is it possiable to do something so save image after running a mcclim application won't has problem
<Inline> well i don't run anything when creating the image
<Inline> i just define all the stuff to run and invoke a top-level :eval (cl-user:run) from one of my scripts
<beach> LdBeth: SBCL is unable to save an image if several threads are running. So what Inline does is to avoid starting additional threads before saving the image.
<LdBeth> so actually I have to serialize some data in case I don't want to lose them
asarch has quit [Quit: Leaving]
<Inline> i use the image to start the listener
<Inline> but i don't start the listener in order to dump the image
makomo has joined #lisp
<Inline> btw i can either use it as an init script or really dump an image with it
<Inline> as of late i don't dump images that often
<Inline> that's why i have commented the image dump line
<LdBeth> I don't mind to use a script since loading compiled code is still fast, though someone had shown some concerns about distributing a McCLIM application
<Inline> why ?
<Inline> ah because of those issues
<Inline> ya, you can't use it anywhere else
<Inline> that's why i don't use images anymore too
<Inline> it's ok to have that run all from toplevel sbcl
<Inline> once it has compiled stuff over to .cache/common-lisp the next start is even faster....
loli has quit [Quit: WeeChat 2.3]
dale has quit [Quit: dale]
<Inline> sbcl --core blah --load quicklisp/setup.lisp --userinit createnewlim4.lisp --eval (cl-user::clm)"
<beach> LdBeth: So can we agree that there is no McCLIM-related problem when it comes to saving and distributing images?
<LdBeth> beach: for me it works perfectly fine
<Inline> the threading and making image is a problem of sbcl not mcclim itself
<Inline> heh
<LdBeth> and the same problem on ccl
<Inline> oh
<Inline> and how is ecl ?
d4ryus has quit [Quit: WeeChat 2.3]
<LdBeth> idk. but i believe it's a little different
<Inline> ya
<LdBeth> time to sleep, good night all
<Inline> good night
<beach> I'm confused. I thought LdBeth indicated a problem, so I spent this time trying to confirm it, but found that there isn't one. Then LdBeth says "for me it works perfectly fine", and I don't know why I spent all this energy.
<Inline> yah
d4ryus has joined #lisp
<Inline> it all sounded like he/she was pretty tired
<beach> That might be.
Kundry_Wag has joined #lisp
<Inline> i suppose one should abstain from asking further in such a state and abstain from providing answers too
<|3b|> beach: sounded to me like the problem was in usage rather than mcclim and your effort helped resolve it
<beach> Ah, OK. Good to know.
<|3b|> though possibly with a "it would be nice if mcclim could shut things down enough to dump a core" on the side
* |3b| has no idea if that is possible or not though, or if starting threads breaks cores even if they all shut down nicely
Kundry_Wag has quit [Ping timeout: 252 seconds]
ealfonso has quit [Ping timeout: 272 seconds]
hugh_marera has joined #lisp
varjag has joined #lisp
iomonad has quit [Ping timeout: 252 seconds]
hugh_marera has quit [Read error: Connection reset by peer]
hugh_marera has joined #lisp
hugh_marera has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 272 seconds]
ryan_vw has quit [Ping timeout: 245 seconds]
ggole has quit [Ping timeout: 252 seconds]
ggole has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
cage_ has joined #lisp
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
lavaflow has quit [Ping timeout: 245 seconds]
lavaflow has joined #lisp
varjag has joined #lisp
beach has quit [Disconnected by services]
beach has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
marvin2 has quit [Ping timeout: 252 seconds]
varjag has quit [Ping timeout: 276 seconds]
gorgi has joined #lisp
<gorgi> Anyone know how to make org-babel evaluate Lisp blocks with Sly instead of Slime?
varjag has joined #lisp
<pjb> gorgi: I don't know, but I could find out. Try to find out yourself, it should not be that hard.
<pjb> Specify SLY by setting org-babel-lisp-eval-fn to "sly-eval".
<pjb> The last google search that led to that was: org mode how to specify block code language
<pjb> Elapsed time spent: 00:10:00 cost: 10 € HT. Your account will be invoiced.
<no-defun-allowed> Nasty.
wanz has quit [Quit: wanz]
matzy_ has quit [Ping timeout: 252 seconds]
Zaab1t has joined #lisp
nirved has joined #lisp
random-nick has joined #lisp
lumm has joined #lisp
bendersteed has joined #lisp
orivej has quit [Ping timeout: 244 seconds]
<gorgi> pjb: I already tried that. I didn't say so because long questions including details like that tend to be ignored. All that does is create a new variable. I've tried modifying ob-lisp.el.gz, but it won't let me.
bendersteed has quit [Ping timeout: 268 seconds]
Kundry_Wag has joined #lisp
<pjb> gorgi: if it creates a new variable, it means you don't have the right version of org-babel.e
<pjb> If you have a more recent version, then you will have to find the new mechanism. If you have an older version, then upgrade.
<pjb> Also, it's in org-contrib, so it should be easy to contribute a patch.
Kundry_Wag has quit [Ping timeout: 244 seconds]
orivej has joined #lisp
<no-defun-allowed> So, I want to add tests to cl-decentralise.
<no-defun-allowed> It's pretty simple, I want to write some stuff to it via a stream and see what it responds with and what it does.
<no-defun-allowed> How could I feed it using a kind of "null modem"ish stream? I want to read and write from one end and on the other (but in reverse).
<no-defun-allowed> So far the best solution I've thought of is using string streams and a twoway-stream since I can use any number of streams, as the protocol is relatively stateless. Is there a better way to make such a "null" stream?
<|3b|> might see if flexi-streams has anything useful
<no-defun-allowed> https://en.wikipedia.org/wiki/Null_modem might be relevant for anyone who's never seen one before. Wait, that's me. ):
<|3b|> (looking at the docs for it, probably not unless you need binary or bivalent streams instead of string streams)
<no-defun-allowed> Yeah, I just need to work with text, in a way that somewhat replicates a TCP socket without spinning one up preferably.
<no-defun-allowed> After making the event loop into an event handler, I can single-step events so I'll just make one, handle one and repeat.
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
marvin2 has joined #lisp
<no-defun-allowed> It's getting late, I'm off to bed now. Goodnight everyone.
<gorgi> /leave
gorgi has left #lisp ["ERC (IRC client for Emacs 25.1.1)"]
<zigpaw> oh, null modem, haven't used those in years.
scymtym has quit [Ping timeout: 250 seconds]
robotoad has quit [Quit: robotoad]
heisig has joined #lisp
wanz has joined #lisp
scymtym has joined #lisp
Kundry_Wag has joined #lisp
<elderK> Gosh, that's a term I haven't heard in many years.
<elderK> I used to worship the ol' null modeme :D
<elderK> :P Copying files over serial port.
<elderK> Ah, memories.
<jebes> i used to play starcraft 2 over on... 4 years ago.
<jebes> god to think i'm employed as a dev and highschool was 4 years ago :/ I don't think that's supposed to happen
<elderK> :) Lucky. Be thankful.
rumbler31 has quit [Remote host closed the connection]
Necktwi has joined #lisp
<jebes> I support the warfighter. I dunno how much deader i can get.
doubledup has joined #lisp
<jebes> well znc just decided to kill me
Kundry_Wag has quit [Ping timeout: 268 seconds]
SaganMan has joined #lisp
<pjb> There's also #lispcafe to philosophize.
igemnace has quit [Quit: WeeChat 2.3]
wanz has quit [Remote host closed the connection]
Essadon has joined #lisp
orivej has quit [Ping timeout: 252 seconds]
Necktwi has quit [Quit: leaving]
Bike has joined #lisp
<elderK> Guys, when should you create and use your own conditions? Starting out, I'm not really sure how to signal problems in the Lisp way
orivej has joined #lisp
<elderK> There seem to be many ways to signal errors. So, like, getting a feel for when to use what, would be useful.
<pjb> elderK: first you should note that the condition hierarchy in a program is often as numerous if not more than the program class hierarchy.
<pjb> First, consider if you can use a specific standard condition, for your error.
<beach> elderK: In SICL, the idea is that I always signal a particular condition. That way, client code can handle each one separately.
<pjb> But then, you may notice that a lot of implementation define an implementation specific set of simple-error and simple-whatever condition, that in addition tot he standard parameters, take a format-control and format-argument string to display a nice simple error message.
<beach> elderK: Sometimes I am lazy and I signal a simple-error or something like that, but it's a temporary solution when I am in a rush.
<pjb> The question is when you want to catch and handle those errors. This is when you want the most precise condition class, with the most useful slots.
<pjb> You cannot count on a format argument list to extract the parameters of the error to process in a handler. This is too brittle.
<pjb> And finally, if you create a condition class, it becomes part of the API. client code may expect to receive this condition from time to time. If it never occurs, useless code may be written, transitions not taken and program not working.
* |3b| thought format-control and format-arguments were part of standard simple-condition
<elderK> I guess I'll look around on Github, try and see how often people do like, condition stuff. To try and get a feel for how I should write my stuff.
<pjb> Yes, but file-error is not a simple-error, etc.
<|3b|> "how often people do" and "should" don't always match :/
<|3b|> if users might want to distinguish them, you should probably define specific ones
<pjb> elderK: you'd start by using (error "message ~S" argument). Then when you try to handle errors, you will notice what specific errors you want to deal with, and define conditions for them.
<pjb> So yous hould create your own condition when you know what errors you want to handle.
<pfdietz> I also suggest you do not count on the errors provided by the implementation. For example, (car x) is supposed to throw a type-error if X is not a list, in safe code. But in code with safety < 3 anything could happen.
<pfdietz> Using assertions to signal errors rather than as signs something has gone horribly wrong with your program is also bad.
<pjb> Yes, CL is way too underspecified about conditions signaled. They're a late addition to the standard…
<pjb> pfdietz: this is discutable. assert signals a continuable error when you give places to modify in restarts…
* |3b| would count on errors from (car x) for safety > 0, and not use any implementation where it doesn't :p
<pjb> so assert may behave like check-type.
<pfdietz> The restatability of asserts is another reason not to use them as error signals, if you don't actually want that restartability. Lots of code gets generated. Internally, SBCL uses AVER which skips the restarts.
<ggole> Using type-errors as flow control seems pretty nasty
<ggole> Relying on them to protect you from your mistakes seems OK though
<pfdietz> I put in a wishlist ticket for SBCL to mark all error signalling code as "cold" and try to move it out of line with other code, so it doesn't clog the instruction cache.
<elderK> Well, I'll make sure to use check-type at the "top level" of my stuff. Assertions and things too as per usual. But, those are for me, not for the users.
<|3b|> just don't put CHECK-TYPE inside scope of DECLARE TYPE for same variable/type :)
<elderK> I'm not sure what you mean by that :)
<elderK> Do you mean within the (declare (...))?
<elderK> I've just been using check-type like an ordinary kind of function, before I do "the stuff" :)
<|3b|> like (lambda (a) (declare (fixnum a)) (check-type a 'fixnum))
<pfdietz> A declare is an assurance to the compiler about what the values of variable will be. The compiler could use it to optimize away the check.
<|3b|> the check-type might be ignored, since you already told it a is a fixnum
<|3b|> so instead (lambda (a) (check-type a 'fixnum) (locally (declare (fixnum a))))
<pfdietz> "If you lie to the compiler, it will get its revenge." -- Henry Spencer
<|3b|> (if your implementation isn't smart enough to figure that out for itself, sbcl usually is)
<pfdietz> And if A is never assigned to, you don't need the declare. Type propagation from check-type should do what you want.
void_pointer has joined #lisp
xkapastel has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
dddddd has joined #lisp
lumm has quit [Quit: lumm]
lumm has joined #lisp
<elderK> Thank you for that - that's a good piece of information :)
<elderK> When should I like, annotate code to add types?
<elderK> I imagine like, you generally don't until you really need to?
<elderK> I find check-type useful, as it prevents you know, stupid mistakes. And also adds documentation in a sense. Assertions for more "stupid mistake" checking :)
<void_pointer> elderK: I think most people do it when the API has converged a bit and they need more performance.
<elderK> Makes sense to me :)
<elderK> It seems like, unless you really really need the performance, adding them is like, polish )
<void_pointer> check-type and assert are very useful at the beginning of functions
<void_pointer> that and it can sometimes limit the code
<elderK> I was also wondering how expensive destructuring-bind is for simple.. destructuring, like, extracting stuff from a cons pair and stuff.
<elderK> I imagine the annotations would make it more difficult to refactor.
<elderK> Trade offs, eh? :)
<void_pointer> forcing the numbers to say be a fixnum means that you can't handle big integers where the definition of big is implementation dependent
<elderK> That sounds a bit painful.
<elderK> So, a 32bit unsigned integer may or may not be a fixnum.
<void_pointer> declarations do indeed make it harder to refactor since you have to track them all down, especially for things passed between many pieces of code
<beach> elderK: DESTRUCTING-BIND should translate to a sequence of CAR and CDR.
<elderK> Makes sense, tag requirements etc, impl-dep. And like, they probably would be on 64bit, but not on 32bit.
<elderK> beach: Ah, good. So, unless I'm doing something really heavy, I shouldn't feel too bad about using it?
<beach> It will likely do it in the most economic way.
<elderK> Sweet :)
<beach> ... keeping intermediate steps in GENSYMed variables.
<void_pointer> elderK: on most systems, the size of a fixnum is a signed integer with a number of bits equal to the pointer size minus a few bits. So on 64 bit systems, it is often something like 60 bits. On 32 bit systems, it is often something like 28, 29, or 30 bits
<elderK> I guess it's too early in my experience to really care about performance too much but like, I'm having a hard time getting a feel for like, how expensive some things are.
<void_pointer> but some use much lower values. I think clips uses 29 bits even on 64 bit systems if I remember correctly
<elderK> I mean the high level stuff, sure, I can get that. Use the right data structures, etc.
<elderK> But like, if I have a few sequential uses of say, (class-slot obj)
<elderK> I imagine the compiler will optimize that out
<elderK> Sometimes I don't want to add another level of nesting, just to have a let to store the info
<void_pointer> A good one will
<ggole> elderK: disassemble might help, if you are comfortable grovelling through low level code
<beach> elderK: It may not be able to optimize that.
<elderK> What are the "good" implementations? I've stuck with SBCL mostly because it seems to be well supported. I use my own package of it. I've seen Roswell before, and that seems interesting. Perhaps a good way to ensure what I write is "portable".
<beach> elderK: If there is a function call in between, that call may well result in a CHANGE-CLASS.
<elderK> So basically, if I need to use something from a slot several times, I should create a binding to "cache" that, as it wer.e
<void_pointer> elderK: there are quite a few good implementations. One approach is to develop primarily in one but at least check if your code works in other ones.
<elderK> (let ((whatever (class-slot obj))) ....)
<beach> elderK: Yeah.
<void_pointer> elderK: common choices are SBCL, CCL, and ECL.
<elderK> I started with ECL long ago - but had problems. But then, that was like ten years ago :)
<void_pointer> elderK: historically, CLISP was a go to implementation as well
<elderK> I have a bunch of questions about CFFI, too, mostly to do with libraries on different systems. But, I think I'll leave them for another day.
<void_pointer> elderK: now days, though, it has some issues due to it not receiving much development in a long time
<elderK> What, ECL or CFFI?
<void_pointer> elderK: CLISP
<elderK> Ah, yes.
<void_pointer> sorry for the pronoun ambiguity
<elderK> NP :)
Bike has quit [Quit: Lost terminal]
<void_pointer> other implementations that some people use are Clasp and ABCL, which are useful for working with C++ and Java respectively. Should mention that if ECL is compiled with C++ support, it works with C++ as well, well enough that it has Qt5 bindings available
<void_pointer> SBCL, CCL, and ECL seem to be the main ones people use
heisig has quit [Quit: Leaving]
nly has quit [Ping timeout: 268 seconds]
Necktwi has joined #lisp
<elderK> Goodnight all :)
<elderK> Thank you for your answers and feedback today :)
Necktwi has quit [Client Quit]
notzmv has quit [Quit: WeeChat 2.3]
shka_ has joined #lisp
ggole has quit [Ping timeout: 260 seconds]
Necktwi has joined #lisp
buffalofrank has joined #lisp
ggole has joined #lisp
<buffalofrank> Does lisp have anything like scikitlearn and jupyter?
<void_pointer> buffalofrank: I don't know about scikitlearn, but with regards to jupyter, yes
<buffalofrank> :O
<void_pointer> buffalofrank: in fact it can be used with jupyter with https://github.com/fredokun/cl-jupyter
<void_pointer> buffalofrank: and https://github.com/tamamu/darkmatter provides similar functionality
<buffalofrank> awesome <3
<void_pointer> buffalofrank: https://common-lisp.net/libraries is a very good reference for some of the libraries, utilities, programs, etc out there
<buffalofrank> thanks 8)
<void_pointer> there are a few machine learning entries on that page
cross has quit [Ping timeout: 252 seconds]
<buffalofrank> does guy steele do any more work on lisp?
<buffalofrank> why do neither his nor paul graham's books have exercises?
lumm has quit [Quit: lumm]
lumm has joined #lisp
<pfdietz> Most books don't have exercises.
<beach> buffalofrank: You need to ask them.
lumm has quit [Client Quit]
lumm has joined #lisp
<void_pointer> buffalofrank: it is only really textbooks that have exercises. Most other technical books do not. Some text books do not, even. Writing a textbook is a whole different ball game than other kinds of technical books largely because of exercises. The other kinds of technical books have their own special things.
dueyfinster has joined #lisp
<jcowan> K&R being an exception, so much so that it has even spawned an "answer book".
<void_pointer> oh, interesting.
<void_pointer> one of the hard things about making exercises is that one has to make sure it is actually possible to do them and then be able to do them correctly. Otherwise, lots of unsolvable problems and errors slip through. Even with diligence, it can still happen.
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
<beach> "Write a program P that takes a program Q and some input data D to Q and that answers YES if Q always terminates on D and NO otherwise."
warweasle has joined #lisp
<void_pointer> beach: well known to be unsolvable unless restrictions are placed on Q. An example restriction would be to make it sub-turing-complete and if it is sub-turing in the right way, it can be done
<void_pointer> as in, force Q to be written in a sub-turing-complete language or something like that
kuwze has joined #lisp
<kuwze> does anyone know how to get sly to work with company? It looks like sly-company was integrated into sly, going by the repo: https://github.com/joaotavora/sly-company
Oladon has joined #lisp
anewuser has joined #lisp
<kuwze> sorry, I meant it doesn't work in the repl. it seems to work fine in a file by comparison.
<buffalofrank> void_pointer: The Art of the Metaobject Protocol is another example with exercises :o
<void_pointer> buffalofrank: that book is on my todo list to get
<void_pointer> since I have been steadily running into a need to customize classes beyond what is doable just with the ANSI standard. That, and the MOP is pretty interesting as a whole
<beach> void_pointer: What kind of customization?
<pjb> beach: What does "always" mean when the input data is fixed to D? Do you assume random internal functions, or unspecified input data?
<beach> It was a joke.
Roy_Fokker has joined #lisp
<void_pointer> beach: making some slots read-only (like struct), making others so they can't be changed eveh with slot-value to something without a validation function running on them first, etc.
<pjb> It felt a little like it indeed.
<void_pointer> beach: in principle, one can make wrapper types and use those for the slots, but that is a bit of a hack and seems brittle
<void_pointer> beach: though I haven't tried it yet. Right now, I just am careful about making my own writers and not using slot-value outside of the package the class is defined in
<beach> void_pointer: I just never use SLOT-VALUE, period.
<beach> Nor WITH-SLOTS.
<void_pointer> basically, if I somehow manage to get an instance into a valid state, I want to make sure it can only change states to other valid states
<beach> If you don't use slot-value, then that's not too hard.
<beach> Just define a consistent protocol.
<void_pointer> that is what I have been doing for the most part so far
<beach> But you only need standard CLOS machinery for that.
<void_pointer> yes
<void_pointer> only if one wants to go further and make it work for slot-value, would one need more
<beach> Though, it might be a good exercise for learning about the MOP.
<void_pointer> at some point, i want to do that. Just, not yet
<beach> I understand, but it's much easier never to use slot-value.
<beach> But I guess you don't want easy. You want to learn about the MOP.
<beach> Fair enough.
<void_pointer> eventually
asarch has joined #lisp
<void_pointer> but also, it is useful for when others use the code. Easy to discipline oneself, hard to discipline others
<void_pointer> but this is for a long ways down the road. Maybe in a year. For now, I just keep myself in line on the protocol
<beach> If they don't respect package borders, then they get what they deserve.
<void_pointer> true point
buffalofrank has quit [Remote host closed the connection]
<void_pointer> guess it is a bad habit of mine that I almost write more code verifying input and checking internal consistency than code that actually does stuff
<beach> Now for a multi-user Common Lisp system, something else must be cooked up.
<loke`> beach: Wrt your never using SLOT-VALUE. I am of the same opinion, but I have ome exception: I sometimes use it in INITIALIZE-INSTANCE methods.
<void_pointer> INITIALIZE-INSTANCE is an acceptable place to use it. After all, one already knows one's hands are in the fire
<beach> loke`: I see. I tend to use reinitialize-instance instead. That way I am consistent with the protocol, which consists of accessors and initargs, but not slots.
n3k0_t has quit [Ping timeout: 244 seconds]
trittweiler has joined #lisp
doubledup has quit [Remote host closed the connection]
orivej has joined #lisp
orivej has quit [Ping timeout: 252 seconds]
notzmv has joined #lisp
themsay has joined #lisp
<kuwze> does anyone know how to get sly-mrepl to work with company? It looks like sly-company was integrated into sly, going by the repo
<beach> You already asked that, no?
ryan_vw has joined #lisp
elderK has quit [Quit: Connection closed for inactivity]
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
<mfiano> kuwze: It does, assuming you have the proper company backend available in each buffer
<mfiano> You could inspect the company-backends buffer-local variable, and ensure it has company-capf
<shka_> damn
<shka_> baggers is such awesome
<shka_> just watching this
jmercouris has joined #lisp
<jmercouris> how can I iterate through all char-codes?
<jmercouris> sorry, I mean, how can I iterate through all things like #\Space
<jmercouris> phrased another way, how can I iterate through all objects for which char-codes returns an integer value?
<jmercouris> s/char-codes char-code
<kuwze> mfiano: thank you so much!
<mfiano> kuwze: No problem. If you need help configuring Sly to be more usable, you can take a look at the common-lisp-sly project, which is a Spacemacs layer I wrote when I was using such garbage (just google for it should take you to my github)
<mfiano> It's used by a good deal of people that I know of with great success still
<kuwze> I was surprised, it seemed like the author trashed it: https://github.com/joaotavora/sly-company/blob/master/sly-company.el
sjl has joined #lisp
wusticality has joined #lisp
<mfiano> beach: sly-company is obsolete
<kuwze> also, does common lisp support advising functions?
<mfiano> It was once an external linux package, requiring more work to integrate with Sly. Now, it's a first-class citizen with no configuration needed
<kuwze> but company mode isn't showing any completions for defad... so what am I doing wrong?
<dim> jmercouris: I just found sb-unicode::char-code-limit which might answer your question if you're using SBCL, see https://github.com/sbcl/sbcl/blob/e98378ca004ef6d101b384f6c3130f24b7a1bc1f/tests/unicode-misc.pure.lisp#L47
<mfiano> kuwze: generic functions
<kuwze> mfiano: ah okay, thank you
<mfiano> sorry beach, pinged the wrong person
<jcowan> jmercouris: The best you can do is iterate between 0 and (- char-code-limit 1), calling code-char on each, but being prepared to deal with char-code returning nil.
<jcowan> s/char-code/code-char/2
<wusticality> Am I right in assuming that this channel is dedicated mostly to CL? Or are topics like Clojure ok to discuss
<sjl> wusticality: this is for CL only. #clojure for clojure
<jmercouris> jcowan: that's a lot of values
<wusticality> sjl: aighty thanks
<jmercouris> I got 1114112 on my machine
<wusticality> currently working my way through Practical Common Lisp (I'm a Clojure dev)
<jmercouris> jcowan: let me describe what I'm trying to do, and tell me if you think this is a smart or a unsmart idea
<jmercouris> so far I have a ton of lines that look like this:
<jmercouris> (define-key *minibuffer-mode-map* (kbd "b") #'(lambda () (self-insert (mode *minibuffer*) "b")))
<pjb> void_pointer: you need to check inputs only in public API functions. ("entry points"). Internal functions can assume correct inputs and types, since you will have proved them.
<jmercouris> so I was thinking, it would be nice to write a macro that iterates through all of the supported chars and sets up a self-insert for minibuffer-mode-map
<pjb> jmercouris: (loop for code below char-code-limit for ch = (code-char code) when ch do …)
<jmercouris> however, with 1 million values on my machine, I imagine that will take some time...
<pjb> jmercouris: welcome to the unicode world!
<jmercouris> pjb: yes, but char-code-limit is an absurdly high value of 1114112
<pjb> Aren't you happy to have all those emoticons?
<jmercouris> no not at at all actually
<sjl> wusticality: if you have questions about CL, or like "I would do X in clojure, how would I do this in CL?" those would be okay here. But if it's just general chat about Clojure, that would be ->#clojure
<jmercouris> I think they are completely pointless
<mfiano> jmercouris: I have some other advise for that snippet, that is totally unrelated
<jmercouris> mfiano: I'm listening
<pjb> Nope, it's (+ (expt 2 20) (expt 2 16)) #| --> 1114112 |# a perfectly reasonable number.
<pjb> jmercouris: why would you want to deprive chineses of their words?
<jmercouris> uh, well, it's not that exactly
<jmercouris> but I don't imagine many people need to enter chinese characters into the minibuffer
<jmercouris> and why should everyone suffer for the few that do?
<dim> a billion and some people I guess
<jmercouris> I highly doubt I'll get more than 100 chinese users ever
<mfiano> The lambda macro expands to (function (lambda ...)) which is the same as #'lambda, just less code. More importantly though, if you're in code position the macro will do the correct thing, or you're in data position and using #'lambda will expand to (function (lambda ...)) which is not evaluated. lambda may not even be cl:lambda so the expansion of (cl:function (pkg:lambda ...)) won't even be valid. So best
<mfiano> case, it does nothing. Worst case it breaks stuff.
<jcowan> No Unicode character will ever be assigned a codepoint higher than #3FFFF. (People who have bet against me on this, with a time limit, have always lost.)
<pjb> (time (loop for code below char-code-limit for ch = (code-char code) when ch do (identity ch))) took 17,230 microseconds (0.017230 seconds) to run.
<dim> jcowan: then use EBCDIC or maybe plain ASCII and call it good?
<pjb> jmercouris: so discussing my answer already ate your budget for a hundred years!
<jmercouris> :D
<jmercouris> I guess .017230 seconds is nothing to make a huge fuss about
* jcowan nods.
<jcowan> of course, as with all benchmarks YMMV.
<jmercouris> mfiano: what would you suggest instead?
<mfiano> (lambda ...) instead of #'(lambda ...)
<mfiano> 2 less characters. More chance of being correct
<mfiano> win win
<jmercouris> ok, your argument has convinced me :D
<jmercouris> thanks for the advice
<jcowan> Aren't you all so glad ISLisp crammed that down your throats now?
<jmercouris> ISLisp? I haven't read this book it seems
<jmercouris> I do know about the expansions of ' and #'
<jmercouris> It was just out of habit, and I hadn't even considered what mfiano had said
<jcowan> Not a book, another Lisp language. It was to make ISLisp easily implementable in Common Lisp that the lambda macro (as opposed to ((lambda ...) ...) and #'(lambda ...) was added, almost at the last minute, to Common Lisp.
<jcowan> ISLisp never caught on, but I for one am interested in it.
<wusticality> sjl: got it
wusticality has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
wusticality has joined #lisp
rozenglass has quit [Read error: Connection reset by peer]
rozenglass has joined #lisp
macaroni_destroy has joined #lisp
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<macaroni_destroy> Hi folks. I'm trying to solve this problem in hopes of helping to get SBCL added to the Kattis online judge. https://open.kattis.com/problems/different
<macaroni_destroy> I was wondering, how do I go about reading from standard input in SBCL :)
<beach> macaroni_destroy: (READ)
Inline has joined #lisp
wusticality has quit [Remote host closed the connection]
wusticality has joined #lisp
<beach> macaroni_destroy: Do you want a suggested solution, or do you want to work on it yourself for a while?
wusticality has quit [Remote host closed the connection]
wusticality has joined #lisp
<macaroni_destroy> I'd like a suggested accepted solution, yes. I'd also need to provide solutions that result in the various other judgement types, those being 'Wrong Answer', 'Time Limit Exceed', 'Output Limit Exceeded', and 'Compile Error'. They're interested in seeing the different ways the program for the program to crash or run out of memory, as well as what is
<macaroni_destroy> safe to return to the user when it comes to output from a crashing program.
<macaroni_destroy> Seeing an 'Accepted' solution would be a great help, though, beach, Yes.
<macaroni_destroy> I'm still learning Lisp myself, but trying to help get it added to more online judges, because I think they help a lot and are just nice for solving problems in spare time.
<sjl> wrong answer: (print "this is probably not the answer")
<sjl> compile error: (oops
<sjl> output limit exceeded: (loop (repeat 10000) (print "wow"))
<sjl> time limit exceeded: (sleep (* 60 60 24))
<macaroni_destroy> Thank you. I'm making a git repo now with various types of submissions. Going to use these when turning in the results.
<beach> (loop for first = (read *standard-input* nil nil) until (null first) do (print (abs (- first (read)))))
<beach>
<jmercouris> is a looping approach more memory intensive than using map on a list of objects?
<beach> No
<jmercouris> are there any fundamental differences in CPU time and memory? or is it just preference
<jmercouris> I guess it is implementation dependent, but I am asking the "in-general" question, whatever that means
<sjl> Well, you need to *have* the list of objects to map over it.
<beach> jmercouris: If you use MAP, you typically need to create a closure and invoke it several times.
<jmercouris> don't you also have a closure within a loop? isn't the loop body a closure?
<beach> jmercouris: And what sjl says, of course.
<beach> jmercouris: No.
<sjl> If you can generate the objects as you go, a LOOP approach would let you avoid ever having to create the list all at once in memory.
<beach> jmercouris: It turns into a TAGBODY.
<jmercouris> oh, I see
<beach> jmercouris: What made you think it turns into a closure?
<pjb> jmercouris: Nothing prevents you to specify a given character set, and to iterate only over that character set. Nothing will prevent users to reject your software if it doesn't support unicode either. That said, if you write the software to drive a time machine, I wouldn't care at all if it used only ASCII.
<jmercouris> I'm not sure, it just felt like it would
<jmercouris> pjb: Well, I'm not working on a time machine... so unicode it is I guess :D
<pjb> jmercouris: use time!
<pjb> clhs time
<jmercouris> I will time it, I'm actually quite interested to see how much of an impact it will have
<pjb> implementation usually report memory usage too.
<pjb> Otherwise, use room
<pjb> clhs room
<jmercouris> I'm going to try it literally this moment
<jmercouris> give me a second, I had to just rewrite the minibuffer class :D
<mfiano> jmercouris: By the way, how did the funding go?
<jmercouris> mfiano: it went well, it is not nearly enough to cover the costs, I guess that will come out of pocket :D
<jmercouris> however, I car enough about the project, that it is okay
<jmercouris> s/car/care
<jmercouris> beach: I'm so close to the dream that you described approximately a year ago with the lisp core and the separate gui process/framework communicating over IPC
<jmercouris> I've grown so much in that time that I look over my old lisp code, and it makes me cry :D
<beach> jmercouris: Great!
<beach> jmercouris: I know the feeling.
<jmercouris> beach: what OS are you using btw?
<jmercouris> I would be very excited for you to be one of the first users to try Next
<beach> Right now? Ubuntu 18.04.
<jmercouris> perfect
ryan_vw has quit [Ping timeout: 276 seconds]
<jmercouris> how can I turn #\a --> "a"?
<beach> (string #\a)
<jmercouris> thanks
evilem is now known as emerson
fikka has joined #lisp
<jmercouris> pjb: so here's how much start-up time it added 1.832 seconds of real time
orivej has joined #lisp
<macaroni_destroy> Well I'm going through all the variations of the programs provided, and for the one for output limit exceeded, I don't think I'm getting the appropriate response from the repl. Perhaps compiling it would yield different results? I'm running (loop (repeat 10000) (print "wow")) and getting "The function COMMON-LISP-USER::REPEAT is undefined".
<macaroni_destroy> Shouldn't there be a ton of wows printed. Is repeat defined in SBCL?
Oladon has quit [Quit: Leaving.]
<jmercouris> macaroni_destroy: REPEAT is not part of the CL spec
<beach> macaroni_destroy: (LOOP REPEAT 10000 DO (PRINT "wow"))
<beach> The syntax sjl gave you was not correct.
<macaroni_destroy> ahh
<jmercouris> macaroni_destroy: you can read about the loop macro here: http://www.gigamonkeys.com/book/macros-standard-control-constructs.html
<jmercouris> macaroni_destroy: you were trying to invoke a function REPEAT with an argument of 10000, and since REPEAT is not a function, that's the complaint you got
<macaroni_destroy> woops :p
dddddd has quit [Remote host closed the connection]
_whitelogger has joined #lisp
<dim> (defun sql-lock-waiting-p (waiting) (member waiting '(:nowait :skip-locked))) (deftype sql-lock-waiting () '(or null (satisfies sql-lock-waiting-p))) (defstruct sql-lock (strength nil :type sql-lock-strength) (table-name nil :type (or null string)) (waiting nil :type sql-lock-waiting))
<dim> is there a better way to do that?
<dim> maybe you need the code easier to read on a paste thing somewhere :/
<dim> my goal is to simply define what I expect in some struct slots, here it's a member of a list of keywords
<dim> for that I had to define a predicate function, then a type that uses it, and then assign the type to the structure... I don't guess it's possible to do something like :type (or null (member :a :b:c)) directly in defstruct?
<macaroni_destroy> I have an accepted answer, wrong answer, time limit exceeded, output limit exceeded, and compile error. Any advice on how I could achieve a Run Time Error for the problem (https://open.kattis.com/problems/different)? I am trying to follow https://open.kattis.com/help/judgements#rte to understand how the online judge judges runtime errors.
<macaroni_destroy> Also trying to achieve Memory Limit Exceeded (https://open.kattis.com/help/judgements#mle). :P
<jmercouris> Here's a very interesting problem
<jmercouris> if I manually write define-key for each key code it works properly, if I do it in a loop, everything is set to the last value in the loop
<jmercouris> not sure what is going on here
<dim> macaroni_destroy: (handler-case (main-code-here) (condition (e) (format *standard-error* "~a" e) (uiop:exit 1))) at the top-level might get you covered?
scymtym has quit [Ping timeout: 250 seconds]
<dim> jmercouris: loop creates a single binding (ch here) that is assigned the values one after the other, and you keep changing the binding, and everything points to that binding...
<jmercouris> dim: but I'm doing (string ch)
<jmercouris> that's what perplexes me about it, I'm getting the value of the binding at that time, not using the symbol or anything
<macaroni_destroy> dim in terms of run time error?
<dim> jmercouris: yeah but I think the do block in your loop exists only once, you can see that when expanding the loop (macroexpand-1 '(loop ...))
<dim> macaroni_destroy: yeah, capture anything that might happen with handler-case and exit 1 in that case, that's your run-time error right?
meepdeew has joined #lisp
<jmercouris> dim: you were correct, thanks
<macaroni_destroy> dim I'm seeing "Symbol "EXIT" not found in the UIOP/DRIVER package."
<macaroni_destroy> Is that code SBCL compliant?
<macaroni_destroy> Or is that the runtime error I should expect from it?
<dim> sorry that's (uiop:quit 1)
ryan_vw has joined #lisp
<dim> beware that it will shutdown your lisp process, so kill your Emacs SLIME session if you're using that
<macaroni_destroy> Hmm ok I think that worked.
<macaroni_destroy> But how did it work I wonder :p
nly has joined #lisp
macaroni_destroy has quit [Remote host closed the connection]
macaroni_destroy has joined #lisp
wusticality has quit [Ping timeout: 245 seconds]
scymtym has joined #lisp
dra has joined #lisp
<pjb> macaroni_destroy: sbcl compliant is not a notion. You can choose to write conforming code, that will run on all conforming CL implementation the same way. Or you can choose to write implementation specific code, which is unintersting to me.
<pjb> macaroni_destroy: there's no quit or exit in Common Lisp. Once you start CL, you remains in CL forever.
notzmv has quit [Quit: WeeChat 2.3]
<macaroni_destroy> Ahh alright. Wrong verbiage
<macaroni_destroy> Sry about that :)
jmercouris has quit [Remote host closed the connection]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 264 seconds]
equwal has quit [Remote host closed the connection]
jdw4000 has joined #lisp
anamorphic has joined #lisp
equwal has joined #lisp
kushal is now known as micah42
<macaroni_destroy> I think the last thing I'll need is a program that generates a Memory Limit Exceeded error and "a list of the Ubuntu packages for the language that needs to be installed, what directories needs to be available in the sandbox for the language to work well, and a reasonable set of compiler and runtime flags for competitive programming"
<macaroni_destroy> I'm pretty sure the only necessary ubuntu package is sbcl, right?
puchacz has joined #lisp
<macaroni_destroy> As far as particular compiler flags for optimization, I'm a bit stumped there.
micah42 is now known as kushal
equwal has quit [Ping timeout: 252 seconds]
fikka has quit [Ping timeout: 245 seconds]
<puchacz> hi, can I write something like (my-function :size <value-indicating-using-default>) ?
<puchacz> (defun my-function (&key (size 30)) ...)
<macaroni_destroy> This was the email I got from them, if anyone wondered, so I would guess I'm almost done providing everything https://0bin.net/paste/QdhVj5DR8zDDmM4a#L6T+U8M8V4aHTXyR+VFwoTUyMYMx4QYPXDf6YHQauLD
<anamorphic> puchacz, yeah that will use 30 for size if it's not provided when called
<macaroni_destroy> I'm going to donate to their patreon once I've submitted everything to them so there's extra incentive
<puchacz> anamorphic: but I would like to call it with :size, but for certain values I want it to use default
<anamorphic> Not sure what you mean
<puchacz> so I would have a code (my-function :size size-passed-from-surrounding-code) without any conditionals
<puchacz> (defun my-surrounding-function (&key (size 30 size-provided?)) ... (if size-provided? (my-function :size size) (my-function)))
<puchacz> not very elegant, is it?
<puchacz> surrounding function may default to 30, my function to say 50
<puchacz> so I want to say use default without (if ...)
<anamorphic> puchacz, perhaps a variable with dynamic extent then?
<puchacz> ah, ok :)
<puchacz> I hoped there was a syntactic trick for it
<puchacz> thanks
<anamorphic> (let ((*size* 30)) (my-surrounding-function)), where (defun my-surrounding-function (&key (size *size*)) .. (my-function)) where (defun my-function (&key (size *size)) ...)
<puchacz> yup, it would work
<trittweiler> puchacz, (apply #'the-function `(1 2 :foo 23 ,@(when size-p (list :size size))))
<puchacz> trittweiler: tks
loli has joined #lisp
<trittweiler> puchacz, One another way is to make sure that NIL will be interpreted as the default value to. So in your my-function make sure that you use (or size 30) at the appropriate place
pierpal has quit [Ping timeout: 252 seconds]
<macaroni_destroy> What are some ways to allocate a lot of memory in SBCL? Let's say I wanted to allocate more than 1024MB.
<shka_> macaroni_destroy: you will need bigger heap size
<puchacz> trittweiler: yes, this is is how I am writing it now
Guest70792 has joined #lisp
fikka has joined #lisp
<macaroni_destroy> shka_ I'm talking about the simplest program that can allocate 1024MB. Are you saying SBCL can not run programs that grow that large in memory, while running, by default?
<macaroni_destroy> Well a little larger than 1024. 2048MB I guess.
<shka_> macaroni_destroy: can grow to a limit
<shka_> but limit is settled when sbcl starts
<anamorphic> macaroni_destroy, http://www.sbcl.org/manual/#Runtime-Options
<on_ion> puchacz: (defun my-surround (&optional (size 30 size-provided-p)) .. ) ?
pierpal has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
<macaroni_destroy> anamorphic thanks
<macaroni_destroy> going to step out for a moment and will be back to try to make a simple program that can grow past 1024mb
wusticality has joined #lisp
<anamorphic> (make-array (1+ (expt 1024 3)) :content-type '(unsigned-byte 8))
wusticality has quit [Remote host closed the connection]
wusticality has joined #lisp
<pjb> (time (make-array (1+ (expt 1024 3)) :content-type '(unsigned-byte 8))) ?
Jesin has quit [Quit: Leaving]
jeosol has quit [Quit: Page closed]
macaroni_destroy has quit [Ping timeout: 240 seconds]
nly has quit [Read error: Connection reset by peer]
anamorphic has quit [Ping timeout: 244 seconds]
ggole has quit [Quit: ggole]
Jesin has joined #lisp
<sjl> Ugh, I'm too used to iterate
<shka_> sjl: i feel ya!
<sjl> yeah, (loop :repeat 10000 :do (print "wow"))
<pfdietz> I don't use keywords in LOOP.
<sjl> I do
* sjl shrugs
<dim> I do too
<pfdietz> Which is ok.
<pfdietz> Just noting the style difference.
<dim> it just feels strange that symbols from any package would "magically" work with loop, and also that would intern all those symbols in the package too, well, I think?
<jcowan> If it distresses you, use keywords instead: they are also in a package.
<dim> yeah that's what I'm doing, I'm not sure what you mean here...
robotoad has joined #lisp
Guest70792 has quit [Ping timeout: 252 seconds]
<jcowan> Avoiding interning random symbols is mostly a micro-optimization nowadays.
<frgo> Hi there. Anybody here having experience with cl-autowrap? I need to pass a "-DFRGO=1" to c2ffi - How would I do that with autowrap? Thx for any hints!
rumbler31 has joined #lisp
<wusticality> can someone remind me of the professional lisp options
<wusticality> I can't remember the company
<frgo> AllegroCL from Franz Inc, Lispworks from Lispworks
<sjl> lispworks and allegro are the two main ones
<wusticality> do either of those have mobile ports?
<void_pointer> Also, worth noting that Clozure offers commercial support for CCL
flazh has joined #lisp
<frgo> Mobile ports?
<sjl> there's also https://wukix.com/mocl -- no idea if that's still alive
<sjl> mocl seems not active since 2015. oh well.
<void_pointer> wusticality: not commercial, but ECL does work on Android
<void_pointer> with Qt5 even
asarch has quit [Quit: Leaving]
void_pointer has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Mr-Potter has joined #lisp
rpg has joined #lisp
<jcowan> sjl: "Sometimes things aren't abandoned, they are just finished." 2015 is not particularly long ago in Lispworld.
<sjl> jcowan: Yeah, but the point of mocl was to interface with iOS/android. Unfortunately those move a lot faster.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cage_ has quit [Quit: Leaving]
me` has joined #lisp
<me`> Back in my day, we would keep our eyes open all day for a honey bee swarm. A swarm is when a nest of bees gets so large that part of the population leaves with a new queen to form a new colony.If you saw a swarm on a tree branch you could cut the branch and literally shake them off into a box so you could later have your own bee hive. But I always shook mine off into a crudley constructed wooden dildo and shove it up my ass. That's what
SaganMan has quit [Quit: WeeChat 1.6]
<me`> Back in my day, we would keep our eyes open all day for a honey bee swarm. A swarm is when a nest of bees gets so large that part of the population leaves with a new queen to form a new colony.If you saw a swarm on a tree branch you could cut the branch and literally shake them off into a box so you could later have your own bee hive. But I always shook mine off into a crudley constructed wooden dildo and shove it up my ass. That's what
me` has quit [K-Lined]
<shka_> this spam gets more interesting every day
<no-defun-allowed> You gotta do what you gotta do.
makomo has quit [Ping timeout: 268 seconds]
<no-defun-allowed> (reminds me of the 4chan guy who had a bunch of snails doing a similar thing. Don't look that up.)
pfdietz has quit [Remote host closed the connection]
pfdietz has joined #lisp
equwal has joined #lisp
cross has joined #lisp
angavrilov has quit [Ping timeout: 244 seconds]
dra has quit [Remote host closed the connection]
cross has quit [Remote host closed the connection]
dueyfinster has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<puchacz> sjl: android deliver from lispworks works.
makomo has joined #lisp
Guest70792 has joined #lisp
<puchacz> you load your program into lisp in arm emulator and then deliver .so binary file
Guest70792 has quit [Ping timeout: 245 seconds]
Guest70792 has joined #lisp
Bike has joined #lisp
Guest70792 has quit [Ping timeout: 268 seconds]
vlatkoB has quit [Remote host closed the connection]
wusticality has quit [Ping timeout: 252 seconds]
svillemot has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
svillemot has joined #lisp
pierpal has quit [Ping timeout: 250 seconds]
fikka has joined #lisp
Lycurgus has joined #lisp
shka_ has quit [Ping timeout: 252 seconds]
rumbler31 has quit [Remote host closed the connection]
<aeth> Is there any way to get just the final count of notes/warnings/errors/etc. without getting the full :verbose t in Quicklisp?
orivej has quit [Ping timeout: 252 seconds]
mange has joined #lisp
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Zaab1t has quit [Quit: bye bye friends]
nirved has quit [Quit: Leaving]
moei has quit [Quit: Leaving...]
pierpal has joined #lisp
<pjb> or you can use gensyms too: (loop #:repeat 10 #:collect 'foo) #| --> (foo foo foo foo foo foo foo foo foo foo) |#
<pjb> Notice however that the interning of symbols is done at read-time, which usually occurs at compilation-time and that the compiler "throws away" those symbols. They won't be present at run-time (when you load the compiled files in a fresh image).
<aeth> I use keywords in loop so I can do :=
<aeth> And so the keywords are clearly highlighted
<pjb> I like := too :-)
* jcowan chuckles at "=
<jcowan> er, :=
<on_ion> pascal smalltalk eh
<aeth> If loop was its own language, emacs would highlight for, repeat, collect, do, in, across, etc. Since it's just a macro you have to do :for, :repeat, :collect, :do, :in, :across, etc. if you want the highlighting
<on_ion> keywords. ~_~.
<on_ion> aeth it works the same way though ?
<puchacz> I also use keywords in loop :)
<aeth> Complaining about keywords is like complaining about parentheses imo. Eventually you get used to the syntax and you no longer see ":foo" you see "the keyword foo"
<on_ion> nah, false
<on_ion> dont agree. =)
<on_ion> i will always have that possibly ignorant adversity
<aeth> on_ion: Emacs always highlights :foo so by using keywords in macros the "keyword" part is instantly apparent
<aeth> without having to edit emacs to highlight things properly
<on_ion> aeth: yeah =) but i mean for the loop to work, of course it works with keyword symbol right? silly question
<on_ion> ah, yeah. to add similar topic, i think it is just fine if emacs were to highlight the first element of any sexp list
<aeth> Yes, but apparently iterate doesn't work with keywords, so loop is actually better than iterate there. Everyone :uses CL so you don't really notice, but since :use on a package is discouraged, you do notice with iterate, since you shouldn't :use :iterate
<on_ion> as for :keywords watch how i start typing english with it on the wrong :side the reckoning
<aeth> imagine having to use seemingly random symbols for one macro to work
dddddd has joined #lisp
<White_Flame> on_ion: it'd have to know whcih lists were evaluatable sexprs for that to work
<on_ion> ah dont know much about iterate
<on_ion> White_Flame: hmm... regexp with something like "(%s ..)" ?
<aeth> In case I'm unclear, the only reason it's *not* inconvenient to use regular symbols in LOOP even if it only accepted its own symbols and not keywords is that you're importing every symbol from the CL package.
<LdBeth> goot afternoo
<aeth> In general, you want keywords for that sort of thing if you're not going to accept symbols from any package
<White_Flame> on_ion: with brackets as highlighting: ([defun] foo ([a] b c) ...)
<on_ion> i have a feeling that some parts of emacs, scheme or cl or slime or redshank or lisp-mode or something, does this sometimes
<on_ion> aeth: ah, makes sense
<on_ion> White_Flame: yeap =)
Mr-Potter has quit [Quit: Leaving]
<aeth> on_ion: I think it's a mistake to think of programming like writing English. It's best to think of it as its own language that happens to borrow some words from English, although sometimes the words have a different meaning (e.g. vector).
<pjb> what english? (si (= a b) (afficher a) (afficher :different))
<on_ion> aeth: hmm, wrong way around. i think of english as programming actually.
<on_ion> pjb =)
ryan_vw has quit [Ping timeout: 260 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
<aeth> pjb: The parts specified in Common Lisp's hyperspec borrow some words from English, and invent some creative new words like rplaca, too
<on_ion> 'whereas for trains, car is used for elements after the engine, in the case of lisp...'
<on_ion> ^ for you aeth, ur favorite =)
Guest70792 has joined #lisp
<aeth> on_ion: You're absolutely right, trains should have called them cadrs instead
<on_ion> Like It! now i wonder where define and defun became different dieties
<on_ion> =P depending which one. little train speak, ohh the caaaddr!
<on_ion> (apparently when trains were big all over the world it was big things with train stations)
<aeth> on_ion: it'd all be d's
<aeth> on_ion: the first train car is the cadr, the last is the caddd...dr
<aeth> there is no train car
<on_ion> lol. true, what was i thinking? a train structured like a tree??? how unwieldly =-)
<aeth> well, the train car isn't the train car
<aeth> s/the train car/a train car/
<aeth> oops, probably should clarify
puchacz has quit [Quit: Konversation terminated!]
void_pointer has joined #lisp
<on_ion> (engine . (coal-car . (cafe-car . (sleep-car . caboose))))
<aeth> the train car (i.e. first element) isn't a train car (i.e. of type train-car)
<on_ion> yeah =)
<aeth> on_ion: it's (caboose . NIL) at the end, actually.
<aeth> You can attach things to the end of it, it's just that NIL is attached to it
<aeth> Besides, if that wasn't the case, then the caddd...dr pattern wouldn't hold. That assumes a proper list.
hhdave has joined #lisp
<on_ion> oops, true. know what i meant
<on_ion> sorta mind half-divided checking out some prolog
Essadon has quit [Quit: Qutting]
phlm has joined #lisp
macaroni_destroy has joined #lisp
<macaroni_destroy> ping
<no-defun-allowed> pong
<macaroni_destroy> So (make-array (1+ (expt 1024 3)) :content-type '(unsigned-byte 8)) should be sufficient to make a program that uses more than 1024MB of memory?
<no-defun-allowed> presumably if you write to it all
<White_Flame> in practice, the implementation will initialize the slots to something
<no-defun-allowed> iirc on linux it doesn't really allocate until you touch it but maybe :initial-element 0 will help
<no-defun-allowed> also make sure your heap can fit that
<White_Flame> yeah, SBCL has a fixed heap size, with cmdline parameters to set a different max
<no-defun-allowed> yep you need to set it above 1gb
<no-defun-allowed> (im so so sorry i actually tried that)
<no-defun-allowed> use something like --dynamic-space-size 4096
<macaroni_destroy> If I wanted to initialize each element to 0, to ensure that I use that memory, how would I do so? :)
<White_Flame> ooh, the spec allows for undefined behavior of reading uninitialized array slots
<White_Flame> :initial-element 0
<no-defun-allowed> :initial-element 0
<no-defun-allowed> also it's :element-type
<no-defun-allowed> alsoalso make sure you don't print it
<macaroni_destroy> (make-array (1+ (expt 1024 3)) :content-type '(unsigned-byte 8) :initial-element 0)
<macaroni_destroy> Like so?
<no-defun-allowed> :element-type '(unsigned-byte 8)
<White_Flame> (progn (setf foo (make-array)) nil), so the big array isn't returned
<no-defun-allowed> ok without i-e it's at around 2.74mb apparently
<no-defun-allowed> devar
<no-defun-allowed> *defvar
hhdave_ has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
hhdave_ is now known as hhdave
<no-defun-allowed> still hasn't moved, i wonder what heathenry linux is doing behind my back
<no-defun-allowed> it took a split second to actually initialise so
<no-defun-allowed> hmm i wonder if cl-vep goes faster without i-e
<no-defun-allowed> can't be bugged to try that actually
<no-defun-allowed> hey LdBeth
<LdBeth> hi
<macaroni_destroy> i'm trying to make a program that would exceed the memory limit of 1024MB for https://open.kattis.com/problems/different
<macaroni_destroy> in hopes of passing it and a couple of variants of the program (like the accepted solution) on to the kattis team so they can add sbcl as an official language
<macaroni_destroy> i'm quite the lisp noob however
<White_Flame> macaroni_destroy: http://www.sbcl.org/manual/#Runtime-Options
hhdave has quit [Quit: hhdave]
<White_Flame> "dynamic space" is the total heap size, including garbage collection spaces
<macaroni_destroy> so I should be able to run the program with `sbcl mem_limit.lisp --dynamic-space-size 1024`?
<no-defun-allowed> you'll need higher
<White_Flame> runtime options come first, before the .lisp file
<no-defun-allowed> also sbcl requires --load to load a file
phlm has quit [Remote host closed the connection]
<White_Flame> yeah, --load or --script
<no-defun-allowed> so `sbcl --d-s-s 4096 --load memlimit.lisp`
<macaroni_destroy> oh nice
<macaroni_destroy> i just wanted to see the heap exhaustion error
<no-defun-allowed> rude
<macaroni_destroy> haha :)
<macaroni_destroy> ok now that i have all the variants of solution to that problem -- accepted, wrong answer, time limit exceeded, run time error, memory limit exceeded, output limit exceeded, and compile error, I can get to writing up some things about what a lisp sandbox would look like for the language to work well for competitive programming
<macaroni_destroy> i vaguely know what some of that means
<macaroni_destroy> in terms of compiler optimizations, are there any special flags used for speeding sbcl up?
<macaroni_destroy> sbcl doesn't have a virtual machine, like java, does it?
<no-defun-allowed> nope, but you can use DECLAIM
<no-defun-allowed> clhs declaim
<no-defun-allowed> clhs declare
<no-defun-allowed> that's for individual function
<macaroni_destroy> "We would also need a list of the Ubuntu packages for the language that needs to be installed, what directories needs to be available in the sandbox for the language to work well, and a reasonable set of compiler and runtime flags for competitive programming."
<macaroni_destroy> I suppose the only package necessary is sbcl.
<macaroni_destroy> I don't think there are any special directories that need to be available for sbcl to work well.
<macaroni_destroy> Perhaps flags, if this is a flag, is just making sure that the heap is set to an appopriate amount, like 4096 linked above?
<macaroni_destroy> Hmm I guess I should look up how to make a compiled sbcl program, because `sbcl --d-s-s 4096 --load memlimit.lisp` likely is only for the interpreter, right?
_whitelogger has joined #lisp
<macaroni_destroy> since java uses -Xss64m
<no-defun-allowed> aight
mange has quit [Ping timeout: 260 seconds]
<gendl> ok. the issue isn't really with output-translations, it's with the system registry following symbolic links (which I guess is what it's intended to do..)
<pjb> aeth: what warning would you want?
<macaroni_destroy> s/script/load
<aeth> pjb: I was expecting the SBCL redefine function warning, but I actually got a package lock error, which I guess is even better for catching this kind of redefinition bug.
<aeth> pjb: I'm guessing this will work for everything except defparameter
<pjb> aeth: perhaps you should read again 11.1.2
<pjb> It says nothing about a package named alexandria.
<pjb> I would be very unhappy to get a package lock error. It should work smoothly.
<aeth> pjb: try (ql:quickload :alexandria) (use-package :alexandria) (defun factorial (x) x) (alexandria:factorial 42)
<aeth> In SBCL I do get a package lock error and would have to press 0 to continue
sauvin has joined #lisp
<aeth> pjb: and in CCL I get #.(format nil "Using #<Package "ALEXANDRIA.0.DEV"> in #<Package "COMMON-LISP-USER"> ~%would cause name conflicts with symbols inherited by that package: ~%ALEXANDRIA.0.DEV:COPY-FILE COPY-FILE")
<aeth> oops, need to escape the "s
<aeth> #.(format nil "Using #<Package \"ALEXANDRIA.0.DEV\"> in #<Package \"COMMON-LISP-USER\"> ~%would cause name conflicts with symbols inherited by that package: ~%ALEXANDRIA.0.DEV:COPY-FILE COPY-FILE")
Kaisyu has joined #lisp
<no-defun-allowed> aeth: well LOCK-PACKAGE and UNLOCK-PACKAGE live in sb-ext, and i couldn't find any mention of package locks in the CLHS
<aeth> no-defun-allowed: Ahah! Looks like it has "#+sb-package-locks (:lock t)" and CCL pretends to be SBCL there to also read that lock
<no-defun-allowed> hah
<pjb> aeth: one reason more why not use sbcl. If you can't redefine your function, it's useless.
<aeth> pjb: I'm guessing the package lock only affects if you're in a user package.
<no-defun-allowed> ignore the lock then if you really want to break things, you schmutz
<no-defun-allowed> but considering most people don't, it's probably a safer idea
<pjb> ccl doesn't pretend anything: you're using alexandria in a package that has already a copy-file symbol!
<no-defun-allowed> if you need to do a whole bunch, use SB-EXT:UNLOCK-PACKAGE
<pjb> use mkupack!
<pjb> (mkupack :use '(:cl :alexandria))
rumbler31 has joined #lisp
<aeth> pjb: Oh you're absolutely right I didn't read the message, it errored with cl-user
<aeth> pjb: not with the redefinition of factorial
random-nick has quit [Read error: Connection reset by peer]
<aeth> Looks like this test could be used: (ql:quickload :alexandria) (defpackage #:foo (:use #:cl #:alexandria)) (in-package #:foo) (defun factorial (x) x) (alexandria:factorial 42)
rumbler31 has quit [Ping timeout: 252 seconds]
<pjb> Yes.
<pjb> And it works perfectly, returning 42.
<aeth> Silently creating bugs! Perfect!
<pjb> (eq 'factorial 'alexandria:factorial) ; why do you qualify it?
<pjb> The bug is in your head.
<pjb> You don't understand what you're doing.
<pjb> There's no bug.
<aeth> pjb: The bug is using something other than CL
<pjb> In a way.
<pjb> You're not thinking in lisp.
<aeth> pjb: So you're basically saying "Just perfectly understand the full system and everything is fine"
<pjb> Yes.
pierpal has quit [Ping timeout: 244 seconds]
<aeth> Modern software doesn't work like that.
igemnace has joined #lisp
<pjb> symbols and packages are rather simple.
<pjb> Then go write your program in modern software programming languages.
<pjb> Try Eiffel.
<aeth> My point is, in modern software, even in CL, it's impossible to understand the entire environment you're using.
<pjb> Or Haskell.
<dim> it's more than we assumer our coworkers and lib authors to not be adversarial, in general
<dim> -r
pierpal has joined #lisp
equwal has quit [Remote host closed the connection]
<on_ion> heh eiffel and haskell. prolog been doing those things since time began
equwal has joined #lisp
<macaroni_destroy> i really hope kattis will take this request seriously
equwal has quit [Remote host closed the connection]
<macaroni_destroy> having sbcl available on that online judge would be a real treat for me
<macaroni_destroy> and help me learn the language lol