2017-08-13T03:53:33Z ccl-logbot joined #lisp
2017-08-13T03:53:33Z
2017-08-13T03:53:33Z names: ccl-logbot coetry_ fkac panji joast schoppenhauer hylisper jamtho epony felipedvorak sz0 daemoz l04m33[m] astronavt[m] ArthurAGleckler[ hiq[m] hdurer[m] Sovereign_Bleak RichardPaulBck[m thorondor[m] Jach[m] hvxgr al-damiri MrBusiness holycow BlueRavenGT kozy mikecheck _paul0 safe larsen kajo2 wheelsucker Mon_Ouie brendos DingoSaar doesthiswork zooey raynold yeticry_ anticrisis mxh- vtomole gremdrus engblom vaporatorius blt groovy2shoes defaultxr kolko
2017-08-13T03:53:33Z names: Lowl3v3l ryanwatkins Zotan fouric grublet wooden larme phoe oleo DeadTrickster d4ryus2 pjb Bike hvxgr_ beach moei g0d355__ ski QualityAddict angavrilov shiranuidong Bock zacts slyrus jrm cromachina karswell zulu_inuoe azrazalea aindilis drcode mfiano gko djinni` vhost- edgar-rft basket yrdz mood gremly Younder Merv drmeister mbrock tkd gendl abbe joga Oladon dan nikivi snits pillton ikopico wizzo grumble dmiles davsebamse flazh CrazyEddy |3b| chu xantoz
2017-08-13T03:53:33Z names: kjak__ _krator44 heurist theBlackDragon temporal1 froggey cibs_ DGASAU` ryanbw sjl capisce_ q-u-a-n-1 basket` whoman xristos borodust Colleen cross Khisanth jdz koenig antoszka tokik eschatologist hotbobby muzik stee_3 megalography jibanes Patzy ssake dcluna __main__ Tristam AntiSpamMeta rotty thinkpad copec Firedancer ``Erik HDurer2 hjudt sbryant oystewh zchlyg SiCC mikaelj samebchase misv jackdaniel gadwin pok Grue` angelo_ lieven samograd tessier
2017-08-13T03:53:33Z names: himmAllRight nydel Posterdati askatasuna Lord_of_Life rjeli bitch caffe ircbrowse Suzuran cmatei_ tonton foom drot flip214 dlowe djh argoneus Lord_Nightmare amerlyq GGMethos brucem nsnc_ MerinoBailon malcom2073 ramus dTal minion watersoul gigetoo aeth phadthai @fe[nl]ix Blkt Fade nullman ineiros mathrick cyberlard arrsim Intensity libreman LyndsySimon brandonz happy_gnu les billstclair Middernacht troydm Xach ym gabiruh axion z0d malm gilberth nicdev
2017-08-13T03:53:33Z names: specbot whartung mrSpec vsync beaky sparkyy creat jasom mason gingerale fluxit eMBee j0ni micro_ pankracy ericmathison ozzloy Tordek cods eagleflo tuturto baroncha3lus koisoke_ Enderbsd_ vert2_ Shinmera stylewarning Cthulhux alandipert dmh convexferret e kushal Guest17892 catern kbtr_ stux|RC-only tmc arrdem tokenrove ult Ellenor Zhivago pareidolia lxpz zagura sveit mingus mulk vibs29 White_Flame SAL9000 itruslove tephra newcup dptd p_l jself drdo voidlily
2017-08-13T03:53:33Z names: odin lonjil SlashLife adulteratedjedi trig-ger gz_ jerme_ gbyers trn joeygibson redcedar rann tobel Oddity easye loke uint Mandus clamchowder ck_ sigjuice nimiux clog zbigniew kilimanjaro mjl shaftoe_ butterthebuddha neuri8 guaqua swflint raydeejay _death pacon mnoonan zuz Sigyn kini Meow-J jyc__ dim cyraxjoe lemoinem nopf zymurgy tomaw cpape jsnell zkat AeroNotix sword fiddlerwoaroof cpt_nemo Aritheanie emerson pchrist ft Vivek bend3r ecraven spacepluk
2017-08-13T03:53:33Z names: kjeldahl dxtr sukaeto eschulte_ filwisher mklk_ TMA ec\ justinmcp_ isoraqathedh danlentz a7f4 fluter nhandler velvetcore_ l1x felideon shenghi Subfusc Riviera rvirding c0dehero tfb alms_clozure PuercoPop Nikotiini renard_ otwieracz jurov add^_ funnel ggherdov dan64 asedeno angular_mike_ CEnnis91 d4gg4d_ splittist XachX aaronjensen benny luis banjiewen gabot
2017-08-13T03:54:53Z coetry joined #lisp
2017-08-13T03:55:27Z jamtho quit (Ping timeout: 240 seconds)
2017-08-13T03:56:35Z coetry_ quit (Ping timeout: 240 seconds)
2017-08-13T03:57:57Z mikecheck quit (Remote host closed the connection)
2017-08-13T03:58:19Z mikecheck joined #lisp
2017-08-13T04:01:30Z wooden quit (Read error: Connection reset by peer)
2017-08-13T04:02:08Z pjb: beach: well, people adopting non-GPL have their own punishment bestowed upon themselves very quick. Witness how Apple's keeping its modifications of clang for itself!
2017-08-13T04:02:37Z beach: Yeah.
2017-08-13T04:03:02Z holycow: good point.
2017-08-13T04:03:20Z coetry quit (Quit: Lost terminal)
2017-08-13T04:03:33Z beach: I am not using xGPL at the moment, because of what I said (other people reject it). But then, at the moment, I am writing code that Apple would not be interested in.
2017-08-13T04:04:21Z fkac quit (Remote host closed the connection)
2017-08-13T04:05:44Z wooden joined #lisp
2017-08-13T04:07:38Z holycow: its prevalent in the lisp community for some reason
2017-08-13T04:07:43Z holycow: i don't get it really
2017-08-13T04:10:00Z doesthiswork quit (Quit: Leaving.)
2017-08-13T04:12:44Z scymtym joined #lisp
2017-08-13T04:23:47Z neoncontrails joined #lisp
2017-08-13T04:23:56Z Oladon1 joined #lisp
2017-08-13T04:26:07Z Oladon quit (Ping timeout: 246 seconds)
2017-08-13T04:28:14Z beach: holycow: Yeah, it's a mystery.
2017-08-13T04:32:25Z vtomole: how is numberp usually implemented? I know it's not a cond of all the numbers hahaha
2017-08-13T04:33:24Z Bike: tag checks, probably
2017-08-13T04:33:36Z beach: vtomole: Depends on the implementation.
2017-08-13T04:33:57Z vtomole: I've been playing with this all day http://norvig.com/paip/interp1.lisp
2017-08-13T04:34:10Z muzik is now known as muzik_
2017-08-13T04:34:21Z vtomole: I want to implement an eval inside the simple intepreter
2017-08-13T04:34:56Z vtomole: So the first check would be self-evaluatingp
2017-08-13T04:35:04Z vtomole: Which would include numbers and strings
2017-08-13T04:35:16Z vtomole: So i need to implement stringp and numberp...
2017-08-13T04:35:39Z Bike: it's easier to just do (not (or symbolp consp))
2017-08-13T04:35:52Z beach: vtomole: So the thing here is that numberp is not usually implemented in an interpreter like this, but in a system that runs in the form of native machine code.
2017-08-13T04:36:08Z vtomole: ah
2017-08-13T04:39:14Z vtomole: How does that work? By checking the storage size?
2017-08-13T04:39:26Z beach: In a native implementation, you mean?
2017-08-13T04:39:50Z vtomole: Yeah
2017-08-13T04:39:55Z beach: For example, in SICL, you would first check for the last two bits being 00 in which case it is a fixnum.
2017-08-13T04:40:45Z beach: Then you would check whether the last two bits are 10 or 01 in which case it is a CONS or another immediate such as a character, and then the answer is no.
2017-08-13T04:41:09Z beach: Then, it must be 11, so it's a general instance. Then you go to memory and check the class.
2017-08-13T04:41:27Z beach: Er, actually, there could be some immediate floats.
2017-08-13T04:41:38Z beach: Anyway, very low-level stuff.
2017-08-13T04:43:52Z muzik_ is now known as muzik
2017-08-13T04:43:53Z vtomole: Thanks
2017-08-13T04:44:36Z basket: In very, very early Lisps atoms were objects whose cars were a specific invalid pointer and whose cdr pointed to a plist, and for numbers the numerical value would be hung on the plist under some key just as a symbol's print name was
2017-08-13T04:46:32Z vtomole: I guessing stringp would also be low-level?
2017-08-13T04:46:53Z beach: Yes, stringp would check the tag and then go to memory to get the class.
2017-08-13T04:47:04Z beach: ... in SICL.
2017-08-13T04:47:13Z mikecheck quit (Ping timeout: 248 seconds)
2017-08-13T04:55:03Z mikecheck joined #lisp
2017-08-13T04:55:19Z Lowl3v3l quit (Ping timeout: 276 seconds)
2017-08-13T04:55:21Z vtomole: In that implementation I linked, Norvig implements macros in common lisp by using def-scheme-macro. Is there a way to define the macros in scheme instead?
2017-08-13T05:00:33Z Bike: what would that mean?
2017-08-13T05:00:50Z Bike: oh, you mean let interpreter code define macros?
2017-08-13T05:01:37Z vtomole: Yes
2017-08-13T05:01:56Z vtomole: He says in the book that you can
2017-08-13T05:02:11Z Bike: sure. just provide a set-macro-function for scheme, that does the setf get with an interpreter function.
2017-08-13T05:02:22Z Bike: interpreter functions are also host functions so there's no problem there
2017-08-13T05:04:53Z vtomole: intepreter functions are host functions? I tried doing (numberp 3) in the the intepreter that was defined and it says "Unbound scheme variable: NUMBERP"
2017-08-13T05:05:17Z vtomole: Which is strange cause 'list', car, cdr and friends work
2017-08-13T05:06:09Z Bike: i mean, (interp '(lambda ...)) gets you a Lisp function
2017-08-13T05:06:45Z Bike: the default scheme interpreter environment is set up specifically, mostly with *scheme-procs*
2017-08-13T05:06:55Z Bike: which includes list, car, cdr, but not numberp
2017-08-13T05:07:18Z vtomole: ah
2017-08-13T05:07:28Z Lowl3v3l joined #lisp
2017-08-13T05:09:18Z mikecheck quit (Quit: Leaving)
2017-08-13T05:09:35Z vtomole: Thanks Bike
2017-08-13T05:10:27Z panji quit (Ping timeout: 240 seconds)
2017-08-13T05:14:06Z vtomole: Seems like implementing a lisp on a lisp is the easiest cause you can borrow features from the undelying implementation. I can't imagine how difficult implementing a lisp using C would be....
2017-08-13T05:15:07Z beach: vtomole: Hold on a second....
2017-08-13T05:15:34Z beach: vtomole: Implementing Lisp by writing an interpreter in Lisp makes it possible to borrow stuff from the host.
2017-08-13T05:15:43Z Bike: yeah, but if you don't allow yourself to do any borrowing it gets tedious
2017-08-13T05:16:43Z beach: vtomole: But implementing Lisp written as a standalone system that bootstraps from a different Common Lisp implementation still requires attention to every detail because you can't borrow anything from the host.
2017-08-13T05:17:38Z vtomole: Bike: Thats what I wanted to do. For the learning experience (like numebrp). But it looks like it will take too long.
2017-08-13T05:18:21Z beach: vtomole: Writing it in C is even harder, because then you end up with a small subset of the final system, and then you have to write the rest of the system in that small subset, which is very painful.
2017-08-13T05:21:45Z vtomole: Is that true of most language implementations? (write subset and write the rest in the subset), or is it only lisp?
2017-08-13T05:22:32Z basket: The subset is normally smaller in Lisp than in other languages
2017-08-13T05:22:33Z beach: Good question.
2017-08-13T05:23:09Z panji joined #lisp
2017-08-13T05:23:27Z beach: vtomole: I suppose it must be the same for things like Python, assuming it is written in C.
2017-08-13T05:24:58Z beach: vtomole: But, to me, it's an aberration to write a Lisp system in a lower-level language, unless you need for it to be that way for some independent reason.
2017-08-13T05:25:58Z beach: vtomole: Presumably, the reason someone is writing a Lisp system is that that person want to program in Lisp. Why then would that person turn around and use a different language for implementing it?
2017-08-13T05:26:15Z beach: wants
2017-08-13T05:28:43Z nsrahmad joined #lisp
2017-08-13T05:29:05Z Bike quit (Ping timeout: 246 seconds)
2017-08-13T05:36:39Z panji quit (Quit: Leaving)
2017-08-13T05:37:12Z nsrahmad quit (Quit: Leaving)
2017-08-13T05:38:27Z vtomole: I've considered writing a simple intepreter like that in C for the learning experience. But I've realized that it would hard (writing a parser and all)
2017-08-13T05:40:14Z beach: Well, parsing (a subset of) Lisp is fairly trivial. If your language has a richer syntax, it may be significantly harder.
2017-08-13T05:42:51Z beach: So, you can write a simple interpreter in C for a simple version of Lisp, provided you don't care much about performance. The trouble comes when you want a full Lisp and good performance. Then the use of a lower-level language becomes problematic.
2017-08-13T05:44:18Z beach: One quickly realizes that in order to do all the sophisticated optimizations required to get good performance, the compiler has to be written in Lisp. And one also quickly realizes that complex functions such as the sequence functions must also be written in Lisp. So then, one is stuck with that subset to write all this code in.
2017-08-13T05:45:18Z vtomole: Macros make writing in the subset less painful right?
2017-08-13T05:45:42Z beach: Not really.
2017-08-13T05:46:25Z doesthiswork joined #lisp
2017-08-13T05:46:43Z beach: You end up creating a large set of functions, where they must be loaded into the system in a carefully chosen sequence, because they depend on each other.
2017-08-13T05:47:05Z beach: So each function can only use the previously loaded ones for its implementation.
2017-08-13T05:48:19Z grouzen joined #lisp
2017-08-13T05:48:20Z beach: And since you need the compiler to implement CLOS, you must write the compiler using a kind of pre-CLOS Common Lisp subset. That quickly becomes very painful.
2017-08-13T05:48:50Z vtomole: How is that different from writing an implementation on lisp? Wouldn't you need to load those functions and macros in order either way?
2017-08-13T05:49:37Z beach: No, because you can use a host Lisp system to create the initial image and that image can contain all the stuff you need, including CLOS.
2017-08-13T05:50:50Z beach: You will still need to load the rest of the functionality of course, but the initial image can contain all the basic tools you need to write the rest. Not just a pre-CLOS subset.
2017-08-13T05:51:03Z beach: But you are right...
2017-08-13T05:51:58Z beach: If you create the initial image without much functionality, you basically have the same problem. This is the case for SBCL. It uses the PCL implementation of CLOS and PCL was designed to be loaded into a pre-CLOS Common Lisp implementation.
2017-08-13T05:52:14Z beach: For that reason, the SBCL compiler does not use generic functions.
2017-08-13T05:53:32Z vtomole: Why write a new implementation if your host has everything?
2017-08-13T05:53:37Z vtomole: Oh. You are talking about common lisp which has one standard.
2017-08-13T05:55:09Z beach: Well, you might want better performance. Or you might want a Common Lisp system that uses first-class global environments. Or you may want the compiler to be more maintainable and you want to use generic functions for that. Or you might want a system that uses a faster generic dispatch algorithm so as to encourage the use of generic functions.
2017-08-13T05:55:29Z beach: Or you might want a system in which a debugger runs in one thread and debugs another thread.
2017-08-13T05:55:53Z beach: Or you might want a system with a better garbage collector, given the past decades of progress.
2017-08-13T05:55:57Z beach: Or, or, or...
2017-08-13T05:56:02Z vtomole: :)
2017-08-13T05:56:17Z beach: Those are all SICL goals by the way.
2017-08-13T05:56:44Z vtomole: sbcl is hard to maintain?
2017-08-13T05:56:57Z beach: I have heard that nobody fully understand the compiler code.
2017-08-13T05:57:02Z beach: I haven't looked myself.
2017-08-13T05:57:32Z grouzen quit (Quit: Lost terminal)
2017-08-13T05:58:55Z shka joined #lisp
2017-08-13T05:59:05Z beach: vtomole: Here is an amusing example: https://gitlab.com/embeddable-common-lisp/ecl/blob/develop/src/clos/hierarchy.lsp
2017-08-13T05:59:21Z beach: vtomole: Check out all those DEFPARAMETER forms.
2017-08-13T05:59:49Z beach: ... like +specializer-slots+, +class-slots+, etc.
2017-08-13T05:59:56Z beach: vtomole: What do you think?
2017-08-13T06:00:32Z beach: jackdaniel: Sorry, I am using ECL here, just because I have looked at it before, not because it is any worse than other systems.
2017-08-13T06:00:50Z phoe: well, that's a CLOS implementation
2017-08-13T06:01:04Z vtomole: They are short which is good. jackdaniel uses generic functions for his clos?
2017-08-13T06:01:27Z beach: So why is it (defparameter +class-slots+ `(,@+specializer-slots+....) ...)
2017-08-13T06:01:43Z beach: rather than (defclass class (specializer) (...))
2017-08-13T06:02:04Z beach: phoe: Can you think of a reason?
2017-08-13T06:02:51Z shka: good morning all
2017-08-13T06:03:10Z vtomole: shka: morning
2017-08-13T06:03:10Z shka: how are you?
2017-08-13T06:03:28Z vtomole: Good you?
2017-08-13T06:03:44Z beach: phoe: I am waiting...
2017-08-13T06:03:51Z shka: awesome, day is not blazing at the very least
2017-08-13T06:04:03Z beach: vtomole: Can you think of a reason why DEFCLASS is not used?
2017-08-13T06:04:04Z shka: which is not major improvement since yesterday
2017-08-13T06:06:06Z beach: phoe: Compare to this: https://github.com/robert-strandh/SICL/blob/master/Code/CLOS/class-defclass.lisp
2017-08-13T06:06:27Z beach: vtomole: Which of the two do you prefer?
2017-08-13T06:06:56Z vtomole: beach: Lemme read them more closely
2017-08-13T06:07:15Z beach: vtomole: No need.
2017-08-13T06:07:35Z beach: In ECL, a different mechanism is required for defining the slots.
2017-08-13T06:07:53Z beach: In SICL, the standard mechanism, i.e DEFCLASS, is used.
2017-08-13T06:08:05Z vtomole: What mechanism is that? The defparameter one?
2017-08-13T06:08:07Z damke_ joined #lisp
2017-08-13T06:08:12Z beach: That kind of stuff has a direct impact on maintainability and readability.
2017-08-13T06:08:18Z beach: vtomole: Yes.
2017-08-13T06:08:26Z phoe: beach: sorry! I went away for a moment
2017-08-13T06:09:11Z phoe: beach: I know the reason - that's a bolt-on CLOS. There's no CLOS in the system before, therefore it needs to be implemented without CLOS.
2017-08-13T06:09:28Z beach: phoe: Exactly my point.
2017-08-13T06:09:32Z vtomole: I was gonna say that ECL is pre-clos....
2017-08-13T06:09:43Z vtomole: I means what needs to build it
2017-08-13T06:09:45Z vtomole: *mean
2017-08-13T06:09:48Z phoe: vtomole: yes, you're right
2017-08-13T06:10:11Z sdemarre joined #lisp
2017-08-13T06:10:29Z beach: Yes, sort of. A large part of ECL must be written in a subset of Common Lisp that does not include CLOS.
2017-08-13T06:11:10Z beach: I am also guessing (I should ask jackdaniel about it) that the order between the slots in those DEFPARAMETERs is important.
2017-08-13T06:11:35Z beach: So imagine that I need to add a slot to the class CLASS.
2017-08-13T06:11:50Z beach: I am almost sure to break the entire system.
2017-08-13T06:12:52Z beach: vtomole: That's what I mean by the maintainability aspect of things.
2017-08-13T06:13:59Z damke joined #lisp
2017-08-13T06:14:31Z muzik is now known as muzik_
2017-08-13T06:16:01Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T06:16:41Z beach: Oh, and one wonders why in ECL, since EQL-SPECIALIZER is a subclass of SPECIALIZER, it doesn't say (defparameter +eql-specializer-slots+ `(,@+specializer-slots+ ...)) (see http://metamodular.com/CLOS-MOP/graph.png).
2017-08-13T06:17:49Z beach: Compare to: https://github.com/robert-strandh/SICL/blob/master/Code/CLOS/eql-specializer-defclass.lisp
2017-08-13T06:17:59Z beach: phoe: Any explanation?
2017-08-13T06:18:14Z beach: vtomole: Maybe you know?
2017-08-13T06:18:35Z phoe: beach: I actually don't know that one.
2017-08-13T06:18:41Z beach: There you go.
2017-08-13T06:19:16Z phoe: Because don't know what "subclassing" means at CLOS-build-time?
2017-08-13T06:19:24Z phoe: No, wait a second...
2017-08-13T06:19:54Z beach: phoe: That is why, in SICL, I am working very hard to make those definitions look "natural" and to make them behave in the standard way.
2017-08-13T06:20:19Z phoe: beach: I see no reason for that. I bet it could say that since we're operating on lists now.
2017-08-13T06:21:27Z phoe: We have backquote working, so I bet it could be doing that.
2017-08-13T06:22:00Z muzik_ is now known as muzik
2017-08-13T06:22:07Z beach: ... and what do you think will happen if I swap the order between two slots in one of the lists?
2017-08-13T06:22:17Z damke_ joined #lisp
2017-08-13T06:22:25Z g0d355__ quit (Ping timeout: 248 seconds)
2017-08-13T06:22:29Z beach: All this stuff is information that should not be required.
2017-08-13T06:22:38Z phoe: Undefined behavior? :)
2017-08-13T06:22:59Z beach: But that is imposed by the way the system is BUILT rather than by the way the system SHOULD BEHAVE.
2017-08-13T06:23:16Z vtomole: Why do you have a file with just one defclass in it? Is this to make maintence easier?
2017-08-13T06:23:28Z beach: So that I can load them separately.
2017-08-13T06:23:59Z beach: It is not strictly necessary all the time.
2017-08-13T06:24:49Z beach: Anyway, I think I made my point about bootstrapping and about different consequences of different ways of writing a Common Lisp system.
2017-08-13T06:25:01Z damke quit (Ping timeout: 240 seconds)
2017-08-13T06:25:12Z beach: Whether my point impressed upon anybody is a different matter, of course.
2017-08-13T06:26:12Z shka: beach: does sicl requires strictly cl standard clos?
2017-08-13T06:26:30Z beach: No, it requires the MOP as well.
2017-08-13T06:26:47Z shka: uh
2017-08-13T06:29:18Z beach: uh what?
2017-08-13T06:30:06Z shka: well, i think you know :P
2017-08-13T06:30:13Z beach: Nope.
2017-08-13T06:30:17Z damke joined #lisp
2017-08-13T06:30:56Z shka: it is just, that you still need working MOP for SICL in order to work, and so you have more code to maintain
2017-08-13T06:31:18Z beach: *sigh* I have utterly failed to get my point across.
2017-08-13T06:31:31Z beach: I use a different Common Lisp system to bootstrap.
2017-08-13T06:31:35Z beach: I don't have to maintain that.
2017-08-13T06:31:52Z beach: Once SICL works, I can use it to bootstrap new versions if I like.
2017-08-13T06:32:13Z shka: i was thinking about implementation (ecl, sbcl), not about SICL
2017-08-13T06:32:21Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T06:32:25Z beach: I don't maintain those.
2017-08-13T06:32:32Z shka: i know
2017-08-13T06:32:45Z beach: "and so you have more code to maintain"?
2017-08-13T06:33:19Z shka: I agree that this sentence makes no sense
2017-08-13T06:33:28Z beach: OK, I'll drop it then.
2017-08-13T06:33:55Z jackdaniel: shka: it's about being able to bootstrap from any conforming CL+MOP system. At start it might be bootstrapped from say SBCL, but when SICL is complete, it will be CL+MOP as well, so there will be no need to bootstrap from (say) SBCL
2017-08-13T06:34:17Z jackdaniel: like with C compilers - you may bootstrap gcc from clang (actually not, but you got the drill ;)
2017-08-13T06:34:51Z shka: yes, i understand now
2017-08-13T06:34:53Z damke_ joined #lisp
2017-08-13T06:34:54Z beach: jackdaniel: Thanks. And I hope you understand that I am not picking on ECL here. I am sure it is a fine implementation.
2017-08-13T06:35:19Z jackdaniel: yes, I do. and yes, it is. ;-)
2017-08-13T06:35:26Z beach: Good! :)
2017-08-13T06:35:57Z shka: well, ok
2017-08-13T06:36:06Z beach: Anyway, I have lunch guests today, and I need to go pick up some stuff from the store.
2017-08-13T06:36:07Z shka: i had wrong idea what SICL is trying to be
2017-08-13T06:36:15Z jackdaniel: CLOS was added to ECL as an afterthought and it's not as well integrated as it could be
2017-08-13T06:36:18Z shka: beach: take care! :-)
2017-08-13T06:36:29Z jackdaniel: but it will hopefully change in the future
2017-08-13T06:36:44Z jackdaniel: (ad backlog)
2017-08-13T06:37:00Z beach: shka: Thanks. Yes, and I fear that if you had the wrong idea, that is also the case for many others. In other words, I utterly failed to get my point across.
2017-08-13T06:37:15Z beach: Oh, well.
2017-08-13T06:37:17Z beach: I'm off.
2017-08-13T06:37:21Z damke quit (Ping timeout: 240 seconds)
2017-08-13T06:37:28Z shka: beach: perhaps FAQ can be added
2017-08-13T06:37:59Z jackdaniel: shka: I'm sure he will accept pull request with well-written FAQ
2017-08-13T06:38:05Z vtomole: beach: Yes an FAQ would be awesome. Right on the README.
2017-08-13T06:38:22Z jackdaniel gets to his toys
2017-08-13T06:38:29Z jackdaniel: no Sunday lasts forever
2017-08-13T06:38:58Z damke joined #lisp
2017-08-13T06:40:41Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T06:41:49Z damke_ joined #lisp
2017-08-13T06:44:02Z hylisper quit (Ping timeout: 260 seconds)
2017-08-13T06:44:21Z damke quit (Ping timeout: 240 seconds)
2017-08-13T06:46:05Z BlueRavenGT quit (Ping timeout: 246 seconds)
2017-08-13T06:53:10Z FreeBirdLjj joined #lisp
2017-08-13T06:57:44Z FreeBirdLjj quit (Ping timeout: 255 seconds)
2017-08-13T07:00:26Z KongWubba joined #lisp
2017-08-13T07:01:52Z damke joined #lisp
2017-08-13T07:03:41Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T07:04:48Z mishoo_ joined #lisp
2017-08-13T07:10:58Z rngoodn joined #lisp
2017-08-13T07:20:05Z FreeBirdLjj joined #lisp
2017-08-13T07:24:47Z safe quit (Read error: Connection reset by peer)
2017-08-13T07:28:05Z mishoo_ quit (Ping timeout: 246 seconds)
2017-08-13T07:41:38Z al-damiri quit (Quit: Connection closed for inactivity)
2017-08-13T07:44:28Z beach: Where is a good place to put an FAQ? Just FAQ.text next to README?
2017-08-13T07:46:47Z phoe: I think so.
2017-08-13T07:46:52Z phoe: You can link to it from the README.
2017-08-13T07:46:52Z beach: OK, thanks.
2017-08-13T07:47:03Z beach: Good idea.
2017-08-13T07:47:36Z rngoodn quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
2017-08-13T07:47:51Z defaultxr quit (Quit: gnight)
2017-08-13T07:49:35Z beach: Not that I think it will help very much, but it can't hurt.
2017-08-13T08:04:51Z mishoo_ joined #lisp
2017-08-13T08:06:54Z damke_ joined #lisp
2017-08-13T08:07:00Z damke quit (Ping timeout: 240 seconds)
2017-08-13T08:10:05Z damke joined #lisp
2017-08-13T08:10:12Z paul0 joined #lisp
2017-08-13T08:12:15Z DeadTrickster quit (Remote host closed the connection)
2017-08-13T08:12:16Z _paul0 quit (Ping timeout: 276 seconds)
2017-08-13T08:12:34Z damke_ quit (Ping timeout: 246 seconds)
2017-08-13T08:15:43Z mishoo joined #lisp
2017-08-13T08:16:40Z phoe: How can I set BUFFER-POSITION with FAST-IO?
2017-08-13T08:17:05Z mishoo_ quit (Ping timeout: 248 seconds)
2017-08-13T08:17:14Z damke quit (Read error: Connection reset by peer)
2017-08-13T08:17:27Z damke_ joined #lisp
2017-08-13T08:18:17Z phoe: I have a single file stream - I want to jump around it like I would with FILE-POSITION.
2017-08-13T08:18:41Z rippa joined #lisp
2017-08-13T08:18:44Z phoe: But FAST-IO seems not to provide such interfaces, instead forcing me to create multiple buffers from one stream.
2017-08-13T08:20:28Z damke joined #lisp
2017-08-13T08:23:20Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T08:24:55Z damke__ joined #lisp
2017-08-13T08:26:53Z damke quit (Ping timeout: 240 seconds)
2017-08-13T08:26:55Z hylisper joined #lisp
2017-08-13T08:27:23Z damke joined #lisp
2017-08-13T08:30:23Z damke__ quit (Ping timeout: 258 seconds)
2017-08-13T08:40:53Z mishoo quit (Ping timeout: 246 seconds)
2017-08-13T08:42:17Z anticrisis quit (Quit: ERC (IRC client for Emacs 25.2.1))
2017-08-13T08:43:17Z random-nick joined #lisp
2017-08-13T08:48:14Z FreeBirdLjj quit (Remote host closed the connection)
2017-08-13T08:55:21Z elfmacs joined #lisp
2017-08-13T09:02:35Z doesthiswork quit (Quit: Leaving.)
2017-08-13T09:11:23Z damke__ joined #lisp
2017-08-13T09:12:20Z damke quit (Ping timeout: 240 seconds)
2017-08-13T09:15:55Z damke joined #lisp
2017-08-13T09:18:20Z damke__ quit (Ping timeout: 240 seconds)
2017-08-13T09:20:40Z hylisper quit (Remote host closed the connection)
2017-08-13T09:23:55Z fsmunoz joined #lisp
2017-08-13T09:25:07Z damke_ joined #lisp
2017-08-13T09:25:08Z varjag joined #lisp
2017-08-13T09:25:16Z shka: phoe: well, you can just say "screw it" and just mmap this file
2017-08-13T09:26:40Z dddddd joined #lisp
2017-08-13T09:27:00Z damke quit (Ping timeout: 240 seconds)
2017-08-13T09:27:48Z damke joined #lisp
2017-08-13T09:30:20Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T09:30:38Z phoe: shka: ...
2017-08-13T09:30:54Z shka: that's what i would do
2017-08-13T09:31:15Z shka: osicat is not terrible
2017-08-13T09:33:18Z damke_ joined #lisp
2017-08-13T09:35:40Z damke quit (Ping timeout: 240 seconds)
2017-08-13T09:36:15Z shka: anyway
2017-08-13T09:36:26Z shka: phoe: i am serious
2017-08-13T09:40:08Z nowhere_man joined #lisp
2017-08-13T09:47:57Z Mon_Ouie quit (Quit: WeeChat 1.9)
2017-08-13T09:47:59Z maarhart joined #lisp
2017-08-13T09:50:17Z maarhart quit (Client Quit)
2017-08-13T09:51:01Z karswell quit (Ping timeout: 240 seconds)
2017-08-13T09:57:38Z damke joined #lisp
2017-08-13T09:58:19Z jamtho joined #lisp
2017-08-13T09:58:52Z elfmacs quit (Ping timeout: 260 seconds)
2017-08-13T10:00:16Z axion: phoe: hello
2017-08-13T10:00:20Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T10:00:21Z axion: Mind if I send a pm?
2017-08-13T10:01:01Z phoe: axion: Sure
2017-08-13T10:01:03Z phoe: Send me
2017-08-13T10:08:02Z grublet quit (Ping timeout: 246 seconds)
2017-08-13T10:08:13Z sdemarre quit (Quit: Leaving.)
2017-08-13T10:09:49Z xaotuk joined #lisp
2017-08-13T10:10:51Z random-nick quit (Remote host closed the connection)
2017-08-13T10:13:07Z pjb quit (Ping timeout: 258 seconds)
2017-08-13T10:16:50Z Mon_Ouie joined #lisp
2017-08-13T10:20:18Z elimik31 joined #lisp
2017-08-13T10:23:19Z teggi joined #lisp
2017-08-13T10:29:26Z shka: how can i reninitialize class allocated slots?
2017-08-13T10:32:42Z axion: There are methods for INITIALIZE-INSTANCE and REINITIALIZE-INSTANCE you can specialize with an :after qualifier for example.
2017-08-13T10:40:32Z zulu_inuoe_ joined #lisp
2017-08-13T10:42:49Z zulu_inuoe quit (Ping timeout: 255 seconds)
2017-08-13T10:46:43Z Shinmera: shka: if I remember correctly you can either change the slot on any instance, or use the class prototype (mop:class-prototype)
2017-08-13T10:47:04Z shka: Shinmera: thanks, i figured out prototype with the help of inspector
2017-08-13T10:53:52Z jamtho quit (Ping timeout: 248 seconds)
2017-08-13T10:54:13Z random-nick joined #lisp
2017-08-13T10:56:29Z quazimodo joined #lisp
2017-08-13T11:00:50Z jamtho joined #lisp
2017-08-13T11:00:50Z marvin2 joined #lisp
2017-08-13T11:01:09Z damke_ joined #lisp
2017-08-13T11:03:40Z damke quit (Ping timeout: 240 seconds)
2017-08-13T11:06:05Z nirved joined #lisp
2017-08-13T11:06:09Z jamtho quit (Ping timeout: 248 seconds)
2017-08-13T11:06:30Z nirved quit (Client Quit)
2017-08-13T11:07:32Z scymtym quit (Ping timeout: 246 seconds)
2017-08-13T11:10:24Z pjb joined #lisp
2017-08-13T11:29:12Z pjb quit (Ping timeout: 255 seconds)
2017-08-13T11:36:54Z sellout- joined #lisp
2017-08-13T11:37:42Z sunset_NOVA joined #lisp
2017-08-13T11:44:10Z Kyo91_ joined #lisp
2017-08-13T11:50:28Z nowhere_man quit (Quit: Konversation terminated!)
2017-08-13T11:51:23Z nowhere_man joined #lisp
2017-08-13T11:57:00Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T11:57:18Z AndreasO joined #lisp
2017-08-13T11:57:47Z damke_ joined #lisp
2017-08-13T11:57:56Z Kyo91_ quit (Ping timeout: 246 seconds)
2017-08-13T12:00:22Z rpg joined #lisp
2017-08-13T12:03:22Z nowhere_man quit (Ping timeout: 255 seconds)
2017-08-13T12:05:22Z AndreasO quit (Remote host closed the connection)
2017-08-13T12:08:40Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T12:09:55Z xaotuk quit (Quit: WeeChat 1.4)
2017-08-13T12:11:04Z damke_ joined #lisp
2017-08-13T12:15:05Z Mon_Ouie quit (Ping timeout: 246 seconds)
2017-08-13T12:22:34Z varjag quit (Ping timeout: 240 seconds)
2017-08-13T12:25:00Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T12:27:23Z damke_ joined #lisp
2017-08-13T12:31:29Z Karl_Dscc joined #lisp
2017-08-13T12:32:32Z Mon_Ouie joined #lisp
2017-08-13T12:36:01Z scymtym joined #lisp
2017-08-13T12:40:03Z d4ryus3 joined #lisp
2017-08-13T12:41:27Z varjag joined #lisp
2017-08-13T12:42:57Z d4ryus2 quit (Ping timeout: 240 seconds)
2017-08-13T12:46:57Z KongWubba quit (Ping timeout: 240 seconds)
2017-08-13T12:49:01Z oleo quit (Quit: irc client terminated!)
2017-08-13T12:54:55Z Kyo91_ joined #lisp
2017-08-13T12:55:32Z dim: hi
2017-08-13T12:55:48Z dim: is it me or the docstring of uiop:run-program is about impossible to read?
2017-08-13T12:56:26Z EvW1 joined #lisp
2017-08-13T12:56:31Z dim: “One and only one of the stream slurping or vomiting may or may not happen in parallel in parallel with the subprocess, depending on options and implementation,”
2017-08-13T12:56:38Z dim: I guess that's supposed to be helpful?
2017-08-13T12:57:55Z phoe: dim: xD
2017-08-13T12:58:06Z phoe: This is unreadable to me, yes.
2017-08-13T12:59:25Z rpg quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
2017-08-13T13:00:09Z dim: what I want is to call `psql` and then send SQL input to it and retrieve output, several times within a single invocation
2017-08-13T13:00:13Z Kyo91_ quit (Ping timeout: 246 seconds)
2017-08-13T13:00:31Z doesthiswork joined #lisp
2017-08-13T13:00:33Z phoe: dim: why not postgresql?
2017-08-13T13:01:18Z dim: what do you mean?
2017-08-13T13:01:35Z damke joined #lisp
2017-08-13T13:03:20Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T13:05:16Z phoe: sldjfhksdhf
2017-08-13T13:05:20Z phoe: dim: why not postmodern?
2017-08-13T13:06:32Z arbv joined #lisp
2017-08-13T13:06:43Z Bike joined #lisp
2017-08-13T13:06:55Z dim: ah, yeah, sorry the question is obvious
2017-08-13T13:07:27Z dim: well I'm writing a book about SQL, in Markdown, and I'm including SQL files in there, and I want to run the files and produce the `psql` output for the examples automatically
2017-08-13T13:07:50Z dim: I want the output to be the real psql one with the setup I'm sharing in the book
2017-08-13T13:08:00Z phoe: I see
2017-08-13T13:08:12Z dim: it's all UTL-8 enhanced output, quite nice to work with really
2017-08-13T13:08:21Z dim: \pset null '⦱'
2017-08-13T13:08:21Z dim: \pset null '¤'
2017-08-13T13:08:21Z dim: \pset linestyle 'unicode'
2017-08-13T13:08:32Z dim: you could try those settings in your ~/.psqlrc ;-)
2017-08-13T13:10:22Z FreeBirdLjj joined #lisp
2017-08-13T13:11:00Z DeadTrickster joined #lisp
2017-08-13T13:16:00Z oleo joined #lisp
2017-08-13T13:16:00Z quazimodo quit (Read error: Connection reset by peer)
2017-08-13T13:16:18Z quazimodo joined #lisp
2017-08-13T13:19:54Z damke_ joined #lisp
2017-08-13T13:22:40Z damke quit (Ping timeout: 240 seconds)
2017-08-13T13:24:51Z nirved joined #lisp
2017-08-13T13:25:32Z damke joined #lisp
2017-08-13T13:26:19Z ryanwatkins quit (Ping timeout: 258 seconds)
2017-08-13T13:27:28Z ebzzry joined #lisp
2017-08-13T13:28:00Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T13:34:24Z kajo2 quit (Ping timeout: 248 seconds)
2017-08-13T13:35:12Z ebzzry_ joined #lisp
2017-08-13T13:36:06Z Shinmera: dim: You might be able to use simple-inferiors: http://shinmera.github.io/simple-inferiors/
2017-08-13T13:36:33Z ebzzry__ joined #lisp
2017-08-13T13:36:40Z kajo2 joined #lisp
2017-08-13T13:37:24Z KongWubba joined #lisp
2017-08-13T13:37:27Z ebzzry quit (Ping timeout: 240 seconds)
2017-08-13T13:37:44Z KongWubba quit (Client Quit)
2017-08-13T13:39:44Z ebzzry_ quit (Ping timeout: 258 seconds)
2017-08-13T13:44:45Z dim: having a look, thanks!
2017-08-13T13:45:01Z ebzzry__ quit (Ping timeout: 246 seconds)
2017-08-13T13:48:48Z axion: As a few of you know, I've spent the week writing my own PNG image parser, after a few years being frustrated with the performance issues and poor code quality of png-read. Here is a poor-man's benchmark of a large-ish file decoded so far: https://gist.github.com/mfiano/2a794c26c1538b7b9f51a6d562adc274
2017-08-13T13:49:48Z whoman: nice !!
2017-08-13T13:49:53Z Shinmera: You sure you tested png-read with hot caches?
2017-08-13T13:50:02Z axion: I suppose that wasn't fair. Let me rerun
2017-08-13T13:50:03Z Shinmera: that "lambdas converted" implies to me that it wasn't.
2017-08-13T13:50:09Z axion: I just noticed before you said that
2017-08-13T13:50:17Z whoman: hm i was wondering what that was
2017-08-13T13:50:53Z Shinmera: whoman: It means the compiler was invoked. Usually this happens when generic functions are first invoked.
2017-08-13T13:51:21Z whoman: ahh
2017-08-13T13:51:28Z whoman: cool metrics tho too =)
2017-08-13T13:51:44Z axion: https://gist.github.com/mfiano/d9b7c73fd2f2eeadd08c5d79b38c370f
2017-08-13T13:52:11Z Shinmera: Not much difference, as I thought.
2017-08-13T13:52:44Z axion: My parser is doing more work too, as png-read refuses to parse certain metadata chunks it thinks are not important. Mine is fully parsable
2017-08-13T13:52:54Z Shinmera: Nice
2017-08-13T13:55:29Z ebzzry joined #lisp
2017-08-13T13:55:41Z axion: It still has some more improvements to be made to it, and more room for optimizations. I have to finish the deinterlacing code for bit depths <8. While I'm at it, let me just say that I don't even know why I am doing that. 1995 technology to progressively show an image as it is downloaded by a dialup modem is complicated code
2017-08-13T13:55:56Z axion: 3b has been helping with that, and he's doing a great job.
2017-08-13T13:59:05Z Shinmera: It's still useful today for very large images.
2017-08-13T13:59:16Z axion: and for comparison, sdl2-image (libpng) including FFI overhead on same hardware is about 0.03s
2017-08-13T13:59:35Z Shinmera: axion: What about cl-soil / libsoil?
2017-08-13T13:59:42Z axion: cl-soil has bugs.
2017-08-13T13:59:48Z axion: well, no.... SOIL itself
2017-08-13T14:00:03Z Shinmera: I meant speed-wise.
2017-08-13T14:00:04Z whoman: should you try with large images as Shinmera hints?
2017-08-13T14:00:32Z axion: Sure one sec
2017-08-13T14:00:34Z Shinmera: whoman: I meant that in the context of downloading from the web.
2017-08-13T14:00:42Z dim: mm, seems I can't figure out how to run several batches of input and get corresponding output from a subprogram in CL :/
2017-08-13T14:01:06Z axion: sdl2-image: 00.29s. cl-soil: 0.038s
2017-08-13T14:01:15Z ebzzry quit (Read error: Connection reset by peer)
2017-08-13T14:01:18Z Shinmera: Okey, that's pretty good.
2017-08-13T14:01:36Z axion: 0.029s*
2017-08-13T14:01:46Z ebzzry joined #lisp
2017-08-13T14:03:42Z axion: Note to self: remember to deallocate ffi memory before going past *** in the repl
2017-08-13T14:03:47Z doesthiswork quit (Quit: Leaving.)
2017-08-13T14:04:42Z Kyo91_ joined #lisp
2017-08-13T14:08:07Z ebzzry_ joined #lisp
2017-08-13T14:09:08Z phinxy joined #lisp
2017-08-13T14:10:57Z ebzzry quit (Ping timeout: 246 seconds)
2017-08-13T14:14:05Z jrm: Anyone here associated with Alexandria development? There seems to be a problem with the GitLab page. Downloading an archive gives an empty tarball.
2017-08-13T14:14:08Z jrm: https://gitlab.common-lisp.net/alexandria/alexandria
2017-08-13T14:15:14Z dim: so, anyone have a working example of controling a subprocess in CL? I want to send input, read output, in a loop, from a subprocess (here psql)
2017-08-13T14:17:29Z zulu_inuoe_: What OS are you running on? And what CL are you using?
2017-08-13T14:18:32Z dim: macosx, Clozure
2017-08-13T14:20:35Z zulu_inuoe_: Let me see if I can dig up something relevant. Maybe other people here can answer but I suspect there shouldn't be any gotchas with that combination.
2017-08-13T14:20:36Z ebzzry_ quit (Remote host closed the connection)
2017-08-13T14:20:38Z ebzzry joined #lisp
2017-08-13T14:25:23Z dim: slowly getting there, of course I made stupid mistakes that made it all fail, like not starting the command in the test-case ;-)
2017-08-13T14:25:58Z ebzzry quit (Ping timeout: 246 seconds)
2017-08-13T14:26:10Z zulu_inuoe_: Sorry. I guess I don't have anything useful. All my uses are input only. Meaning I call a command and read its output
2017-08-13T14:26:19Z EvW1 quit (Ping timeout: 246 seconds)
2017-08-13T14:26:56Z ebzzry joined #lisp
2017-08-13T14:30:52Z felipedvorak quit (Ping timeout: 246 seconds)
2017-08-13T14:30:56Z Mon_Ouie quit (Quit: WeeChat 1.9)
2017-08-13T14:33:24Z ebzzry quit (Ping timeout: 258 seconds)
2017-08-13T14:34:11Z dim: yeah here I want to avoid running the command so many times
2017-08-13T14:34:26Z dim: so I run the command and then dialog with it, in `expect` style
2017-08-13T14:34:49Z ebzzry joined #lisp
2017-08-13T14:38:18Z teggi quit (Quit: Leaving...)
2017-08-13T14:41:03Z felipedvorak joined #lisp
2017-08-13T14:42:44Z rgrau joined #lisp
2017-08-13T14:43:32Z EvW joined #lisp
2017-08-13T14:50:32Z damke_ joined #lisp
2017-08-13T14:50:42Z Kyo91_ quit (Ping timeout: 276 seconds)
2017-08-13T14:52:00Z damke quit (Ping timeout: 240 seconds)
2017-08-13T14:53:05Z nowhere_man joined #lisp
2017-08-13T14:53:24Z HTTP_____GK1wmSU joined #lisp
2017-08-13T14:53:49Z HTTP_____GK1wmSU left #lisp
2017-08-13T14:54:52Z knicklux joined #lisp
2017-08-13T14:55:24Z elimik31 quit (Remote host closed the connection)
2017-08-13T14:55:28Z Mon_Ouie joined #lisp
2017-08-13T15:04:07Z dim: read-char reads correctly from the command :output, but read-char-no-hangs immediatly returns nil
2017-08-13T15:05:29Z ebzzry_ joined #lisp
2017-08-13T15:05:31Z EvW quit (Ping timeout: 246 seconds)
2017-08-13T15:08:41Z ebzzry quit (Ping timeout: 255 seconds)
2017-08-13T15:08:48Z zulu_inuoe_: I see. I've had bad experiences doing this sort of thing in the past, so much of my code is set up to either output to a file, which I then read, and/or using CFFI to call OS level API, because of some issue when using the CL layer
2017-08-13T15:09:16Z zulu_inuoe_: I'm not recommending you do either. I'm just empathizing. #thestruggle
2017-08-13T15:10:56Z dim: maybe I shouldn't try to do that in CL, been wasting time when an hour of Python would have solved it, I guess. But I like CL.
2017-08-13T15:10:56Z quazimodo quit (Read error: Connection reset by peer)
2017-08-13T15:11:23Z nowhere_man quit (Ping timeout: 255 seconds)
2017-08-13T15:12:06Z Kyo91_ joined #lisp
2017-08-13T15:12:33Z zulu_inuoe_: Many times in the past I've wanted to write a good compatibility API to do shell calls reliably, similar to the Python API's, but I've never been motivated enough to write it and put it up on QuickLisp
2017-08-13T15:12:59Z neoncont_ joined #lisp
2017-08-13T15:13:34Z zulu_inuoe_: I really wish I had, though. I can't count the number of times I've had to just smash my head against the wall trying to do a relatively simple "call command, read output" thing
2017-08-13T15:14:14Z zulu_inuoe_: I know uiop has API for it, but I haven't had a chance to use it, so I can't say whether it's good enough or not
2017-08-13T15:14:21Z dim: call/read is easy enough, ccl run-program just works (https://ccl.clozure.com/manual/chapter9.4.html)
2017-08-13T15:14:39Z strelox joined #lisp
2017-08-13T15:14:52Z dim: start subprocess, send command, read ouput, and again; that's where it fails
2017-08-13T15:15:01Z neoncontrails quit (Ping timeout: 260 seconds)
2017-08-13T15:15:10Z zulu_inuoe_: I'm on Windows most of the time.. never works how it should on here
2017-08-13T15:15:18Z dim: uiop docstrings are a mess, code is too, it's all undocumented basically
2017-08-13T15:17:10Z zulu_inuoe_: I can't comment. Luckily. Since I love any and all who have/continue to work on it and ASDF. I love you all unconditionally.
2017-08-13T15:17:30Z zulu_inuoe_: That's not to say constructive criticism isn't good. I just don't have any
2017-08-13T15:17:40Z |3b| 's only suggestion is make sure you are flushing output streams
2017-08-13T15:18:44Z edgar-rft signals a 'love condition back to zulu_inuoe_
2017-08-13T15:18:59Z dim: |3b|: is using terpri good enough?
2017-08-13T15:19:22Z phoe: edgar-rft: debugger invoked on a SIMPLE-TYPE-ERROR: LOVE does not designate a condition class.
2017-08-13T15:19:42Z |3b|: maybe, i'd throw in some finish-output just to make sure
2017-08-13T15:19:47Z phoe: dim: finish-output
2017-08-13T15:20:22Z zulu_inuoe_: phoe: I recognize love as a condition, but I've no handle bound to deal with it
2017-08-13T15:20:28Z dim: wow it wasn't, thanks |3b|
2017-08-13T15:20:34Z brendos quit (Ping timeout: 246 seconds)
2017-08-13T15:21:29Z ebzzry_ quit (Ping timeout: 240 seconds)
2017-08-13T15:24:29Z dim: ok read-char-no-hang is still returning nil immediatly
2017-08-13T15:24:46Z |3b|: isn't that what it's supposed to do?
2017-08-13T15:24:54Z |3b|: (assuming no input yet)
2017-08-13T15:25:18Z |3b| would try sleeping for a bit and see if it returns something then
2017-08-13T15:25:35Z arbv quit (Quit: ZNC - http://znc.in)
2017-08-13T15:25:38Z dim: ok read the first char with read-char, because we know there's at least one
2017-08-13T15:25:43Z dim: then read the rest with read-char-no-hang
2017-08-13T15:26:10Z dim: I don't like sleeping for arbitrary amount of time in something that should be automated, feels subpar
2017-08-13T15:28:04Z |3b|: yeah, if you want to wait for a char, read-char first sounds reasonable
2017-08-13T15:28:23Z phoe: dim: peek-char-no-hang?
2017-08-13T15:28:34Z |3b|: otherwise, sleep and check again in loop
2017-08-13T15:28:41Z arbv joined #lisp
2017-08-13T15:28:43Z phoe: http://paste.lisp.org/display/353374
2017-08-13T15:28:49Z phoe: oh, wait - your problem might be different
2017-08-13T15:29:58Z dim: I expect to have a char to read here, every time, unless end-of-file, which I can handle manually
2017-08-13T15:35:04Z KingMeow joined #lisp
2017-08-13T15:45:42Z KingMeow quit (Remote host closed the connection)
2017-08-13T15:48:57Z rngoodn joined #lisp
2017-08-13T15:48:58Z _death: why do you need read-char-no-hang then
2017-08-13T15:49:52Z nirved quit (Quit: Leaving)
2017-08-13T15:50:01Z _death: if you do it to "detect" the end of output, then it's obviously racey
2017-08-13T15:50:04Z Kyo91_ quit (Ping timeout: 240 seconds)
2017-08-13T15:50:44Z varjag quit (Quit: ERC (IRC client for Emacs 25.2.1))
2017-08-13T15:52:07Z HTTP_____GK1wmSU joined #lisp
2017-08-13T15:52:11Z HTTP_____GK1wmSU quit (K-Lined)
2017-08-13T15:55:08Z dim: racey implies that there's more than one thing happening at once, yes?
2017-08-13T15:57:31Z _death: if there's more output coming, then it could be intercepted before read-char-no-hang chooses to return nil, or after
2017-08-13T15:59:05Z _death: you'd need to poll w/ a timeout, or use something like iolib
2017-08-13T16:01:26Z wooden quit (Read error: Connection reset by peer)
2017-08-13T16:01:29Z dim: oh.
2017-08-13T16:01:39Z sz0 quit (Quit: Connection closed for inactivity)
2017-08-13T16:01:42Z rngoodn quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
2017-08-13T16:02:38Z rpg joined #lisp
2017-08-13T16:04:53Z rngoodn joined #lisp
2017-08-13T16:05:42Z rngoodn quit (Client Quit)
2017-08-13T16:05:55Z wooden joined #lisp
2017-08-13T16:06:48Z rngoodn joined #lisp
2017-08-13T16:09:27Z dim: then I'd better run a new command for each input
2017-08-13T16:13:52Z strelox quit (Ping timeout: 248 seconds)
2017-08-13T16:17:33Z rngoodn quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
2017-08-13T16:21:25Z safe joined #lisp
2017-08-13T16:23:49Z eazar001 joined #lisp
2017-08-13T16:39:29Z damke joined #lisp
2017-08-13T16:39:38Z damke_ quit (Read error: Connection reset by peer)
2017-08-13T16:40:05Z sunset_NOVA quit (Quit: Leaving)
2017-08-13T16:42:14Z xor-xor joined #lisp
2017-08-13T16:49:55Z damke_ joined #lisp
2017-08-13T16:51:16Z Mon_Ouie quit (Ping timeout: 260 seconds)
2017-08-13T16:52:20Z damke quit (Ping timeout: 240 seconds)
2017-08-13T16:55:27Z EvW1 joined #lisp
2017-08-13T17:02:42Z defaultxr joined #lisp
2017-08-13T17:02:55Z varjag joined #lisp
2017-08-13T17:08:27Z scymtym quit (Ping timeout: 240 seconds)
2017-08-13T17:11:32Z damke joined #lisp
2017-08-13T17:11:48Z madmalik joined #lisp
2017-08-13T17:14:00Z damke_ quit (Ping timeout: 240 seconds)
2017-08-13T17:16:24Z X-Scale joined #lisp
2017-08-13T17:18:19Z Mon_Ouie joined #lisp
2017-08-13T17:20:45Z xor-xor quit (Quit: leaving)
2017-08-13T17:22:09Z pjb joined #lisp
2017-08-13T17:23:41Z slyrus: So if I compile some code with *break-on-signals* T, and the code has a defclass and some defmethods, I get a signal that "There is no class named ..." when I get to the defmethod. Eventually this stuff must get compiled properly, but is this the intended behavior?
2017-08-13T17:25:05Z meowspergers joined #lisp
2017-08-13T17:25:40Z damke quit (Ping timeout: 240 seconds)
2017-08-13T17:26:52Z X-Scale left #lisp
2017-08-13T17:27:58Z _death: slyrus: maybe you want to bind it to ERROR instead
2017-08-13T17:28:33Z _death: slyrus: but why do you want to bind it at all?
2017-08-13T17:29:23Z Kyo91_ joined #lisp
2017-08-13T17:30:10Z slyrus: I'm trying to debug another problem and it's nice to have the compiler stop on signals. This is admittedly a distraction, but I'm curious if it's supposed to be this way.
2017-08-13T17:30:11Z Bike: slyrus: if there's a signal, and break-on-signals covers it, you get a break, even if it would be handled. is that what you mean?
2017-08-13T17:30:47Z slyrus: bike: why does the compilation of the defmethod form happen when the class is undefined?
2017-08-13T17:33:37Z Bike: that wouldn't be related to break-on-signals. if defclass is toplevel (and you're compile-file-ing) later defmethods specializing on the class should be okay.
2017-08-13T17:33:58Z Bike: though "okay" doesn't necessarily mean "without signals", i suppose.
2017-08-13T17:34:05Z phoe: or just generally with-compilation-unit
2017-08-13T17:34:22Z phoe: Bike: AFAIK all signals should be preserved until the end of the compilation unit, meaning, not signaled during it
2017-08-13T17:34:39Z phoe: in case they're no longer valid at the end of the unit, like, a missing function is later defined
2017-08-13T17:35:10Z Bike: phoe: that's not what that means
2017-08-13T17:35:31Z attila_lendvai joined #lisp
2017-08-13T17:35:42Z Bike: you can have with-compilation-unit establish a handler so that warnings are silenced during the compilation unit, but that doesn't mean that they aren't signaled
2017-08-13T17:35:48Z Bike: also, doing so is optional anyway
2017-08-13T17:35:57Z phoe: oh. I see.
2017-08-13T17:36:16Z _death: (sbcl) if I have (defclass cat () ()) (defmethod make-a-sound ((cat cat)) (write-line "meow")) I get two signals, one for defmethod w/o defgeneric (which should be eliminated in sbcl HEAD) and another for "no way to determine lambda list"..
2017-08-13T17:36:38Z _death: so presumably you're using another implementation.. each one has its quirks
2017-08-13T17:37:17Z slyrus: No, this is SBCL (head, at least as of yesterday)
2017-08-13T17:39:55Z caffe left #lisp
2017-08-13T17:40:05Z neoncont_ quit (Remote host closed the connection)
2017-08-13T17:45:02Z random-nick quit (Remote host closed the connection)
2017-08-13T17:45:25Z hernanex3 joined #lisp
2017-08-13T17:45:31Z rpg quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
2017-08-13T17:48:57Z ryanwatkins joined #lisp
2017-08-13T17:49:56Z Grue` quit (Ping timeout: 240 seconds)
2017-08-13T17:50:46Z Kyo91_ quit (Ping timeout: 260 seconds)
2017-08-13T17:52:25Z phinxy quit (Read error: Connection reset by peer)
2017-08-13T17:52:53Z phinxy joined #lisp
2017-08-13T17:53:26Z modula joined #lisp
2017-08-13T17:54:26Z phinxy quit (Max SendQ exceeded)
2017-08-13T17:54:54Z phinxy joined #lisp
2017-08-13T17:55:58Z defaultxr quit (Ping timeout: 246 seconds)
2017-08-13T17:55:59Z modula is now known as defaultxr
2017-08-13T17:57:40Z emerson quit (Quit: WeeChat 1.9)
2017-08-13T17:59:19Z scymtym joined #lisp
2017-08-13T18:06:18Z meowspergers quit
2017-08-13T18:08:18Z varjagg joined #lisp
2017-08-13T18:09:30Z varjag quit (Ping timeout: 240 seconds)
2017-08-13T18:18:24Z phinxy quit (Read error: Connection reset by peer)
2017-08-13T18:19:15Z phinxy joined #lisp
2017-08-13T18:20:27Z daemoz quit (Remote host closed the connection)
2017-08-13T18:20:46Z daemoz joined #lisp
2017-08-13T18:21:46Z phinxy quit (Max SendQ exceeded)
2017-08-13T18:22:20Z phinxy joined #lisp
2017-08-13T18:24:37Z acyed joined #lisp
2017-08-13T18:25:05Z Kyo91_ joined #lisp
2017-08-13T18:26:41Z shwouchk joined #lisp
2017-08-13T18:28:50Z hernanex3 left #lisp
2017-08-13T18:31:03Z rgrau quit (Ping timeout: 276 seconds)
2017-08-13T18:35:10Z acyed quit (Ping timeout: 246 seconds)
2017-08-13T18:45:29Z krasnal joined #lisp
2017-08-13T18:46:02Z neoncontrails joined #lisp
2017-08-13T18:46:34Z foom2 joined #lisp
2017-08-13T18:47:29Z random-nick joined #lisp
2017-08-13T18:49:28Z foom quit (Ping timeout: 258 seconds)
2017-08-13T18:53:00Z FreeBirdLjj quit (Remote host closed the connection)
2017-08-13T18:55:59Z rumbler31 joined #lisp
2017-08-13T19:02:59Z JuanDaugherty joined #lisp
2017-08-13T19:04:01Z watersoul quit (Ping timeout: 240 seconds)
2017-08-13T19:06:24Z nowhere_man joined #lisp
2017-08-13T19:07:31Z prxq joined #lisp
2017-08-13T19:09:54Z watersoul joined #lisp
2017-08-13T19:13:03Z phoe: I have two lists of equal length. What is the function to zip them?
2017-08-13T19:13:22Z phoe: other than (loop for x in list-x for y in list-y collect (list x y))?
2017-08-13T19:13:29Z phoe: ...well, now that I wrote it, I think I'll use it
2017-08-13T19:14:27Z Bike: or (mapcar #'list l1 l2)
2017-08-13T19:15:44Z nowhere_man quit (Quit: Konversation terminated!)
2017-08-13T19:16:01Z nowhere_man joined #lisp
2017-08-13T19:18:46Z moei quit (Quit: Leaving...)
2017-08-13T19:20:48Z phoe: Bike: !!!
2017-08-13T19:21:01Z phoe: now that is an amusing way of (mis)using MAPCAR and LIST
2017-08-13T19:21:03Z phoe: I giggled.
2017-08-13T19:21:32Z Bike: misuse?
2017-08-13T19:21:41Z phoe: I was teasing
2017-08-13T19:21:51Z phoe: I wouldn't think of such a thing on my own
2017-08-13T19:23:10Z basket: phoe: If you don't care about the order of the result sequence you could use PAIRLIS, too
2017-08-13T19:24:04Z Patzy quit (Ping timeout: 240 seconds)
2017-08-13T19:24:09Z nowhere_man quit (Ping timeout: 240 seconds)
2017-08-13T19:24:56Z phoe: basket: PAIRLIS returns an alist - I need a list of proper lists.
2017-08-13T19:25:32Z basket: Oh sorry, you said zip so I thought of 2-tuples
2017-08-13T19:25:41Z phoe: Well, correct.
2017-08-13T19:25:43Z slyrus quit (Remote host closed the connection)
2017-08-13T19:25:47Z phoe: I wasn't clear enough.
2017-08-13T19:26:05Z Patzy joined #lisp
2017-08-13T19:26:08Z rpg joined #lisp
2017-08-13T19:29:17Z prxq: phoe: a quiz: suppose you have '((a b c) (d e f) (g h i)) in variable x. What does (apply #'mapcar #'list x) do?? :-)
2017-08-13T19:31:31Z rgrau joined #lisp
2017-08-13T19:32:05Z _death: that's an old trick
2017-08-13T19:32:15Z _death: I think PAIP mentions it
2017-08-13T19:32:26Z krasnal quit (Ping timeout: 240 seconds)
2017-08-13T19:32:52Z krasnal joined #lisp
2017-08-13T19:32:52Z phoe: prxq: :D
2017-08-13T19:32:59Z oleo: it picks each car of the sublists
2017-08-13T19:33:06Z oleo: giving you (a d g)
2017-08-13T19:33:20Z oleo: ?
2017-08-13T19:33:28Z raynold quit (Quit: Connection closed for inactivity)
2017-08-13T19:33:56Z phoe: (let ((x '((1 2 3) (4 5 6) (7 8 9)))) (apply #'mapcar #'list x))
2017-08-13T19:34:03Z phoe: ;; => ((1 4 7) (2 5 8) (3 6 9))
2017-08-13T19:34:22Z oleo: ya
2017-08-13T19:34:42Z phoe: prxq: this is rad! :D
2017-08-13T19:35:01Z phoe: when a higher order function doesn't make it... grab two of them!
2017-08-13T19:35:06Z oleo: so it's picking cars while cdring
2017-08-13T19:35:41Z oleo: cause the next list is '((b c) (e f) (h i))
2017-08-13T19:36:15Z oleo: so the next thing it pushes onto a new list is (b e h)
2017-08-13T19:36:51Z oleo: what remains is '((c) (f) (i)) which then becomes (c f i)
2017-08-13T19:37:22Z axion: Many better ways to define a matrix transpose :)
2017-08-13T19:38:40Z prxq: axion: indeed! :-)
2017-08-13T19:38:49Z rippa quit (Quit: {#`%${%&`+'${`%&NO CARRIER)
2017-08-13T19:39:12Z eazar001 quit (Quit: WeeChat 1.9)
2017-08-13T19:39:56Z warweasle joined #lisp
2017-08-13T19:40:34Z arbv quit (Ping timeout: 240 seconds)
2017-08-13T19:40:49Z hexfive joined #lisp
2017-08-13T19:43:51Z slyrus joined #lisp
2017-08-13T19:44:36Z Kyo91_ quit (Ping timeout: 255 seconds)
2017-08-13T19:45:03Z EvW1 quit (Remote host closed the connection)
2017-08-13T19:45:13Z EvW joined #lisp
2017-08-13T19:45:18Z msb joined #lisp
2017-08-13T19:49:52Z arbv joined #lisp
2017-08-13T19:53:01Z DingoSaar_ joined #lisp
2017-08-13T19:54:06Z ft quit (Ping timeout: 255 seconds)
2017-08-13T19:55:10Z ft joined #lisp
2017-08-13T19:56:30Z DingoSaar quit (Ping timeout: 240 seconds)
2017-08-13T19:58:26Z mishoo joined #lisp
2017-08-13T19:58:29Z DingoSaar_ is now known as DingoSaar
2017-08-13T19:59:22Z fiddlerwoaroof: phoe a set of higher order functions like this make data manipulation much nicer
2017-08-13T19:59:24Z fiddlerwoaroof: https://github.com/fiddlerwoaroof/data-lens/blob/master/lens.lisp
2017-08-13T20:00:53Z fiddlerwoaroof: This would probably more efficient if implemented with something like the series library, because then it could do stream fusion transparently
2017-08-13T20:00:59Z anticrisis joined #lisp
2017-08-13T20:01:39Z phoe stars the library
2017-08-13T20:03:08Z phoe: I have an octet vector of dimensions (* 4 Y X). Can I turn it into a 3D array with dimensions (X Y 4) without copying?
2017-08-13T20:03:44Z shka quit (Ping timeout: 248 seconds)
2017-08-13T20:04:11Z nikivi quit (Quit: ZNC 1.6.5 - http://znc.in)
2017-08-13T20:04:18Z fiddlerwoaroof: clhs adjust-array
2017-08-13T20:04:19Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/f_adjust.htm
2017-08-13T20:04:21Z fiddlerwoaroof: Does that work?
2017-08-13T20:04:34Z varjagg quit (Ping timeout: 240 seconds)
2017-08-13T20:04:38Z fiddlerwoaroof: I've had this issue before, but I don't remember if I ever found a good solution.
2017-08-13T20:05:23Z fiddlerwoaroof: You might be able to create a displaced array with your desired shape that points to the original one
2017-08-13T20:05:38Z fiddlerwoaroof: Although, I think that has performance issues of its own
2017-08-13T20:06:15Z phoe: fiddlerwoaroof: "The number of dimensions not equal to rank of array."
2017-08-13T20:06:21Z phoe: gah
2017-08-13T20:06:50Z fiddlerwoaroof: Yeah, one pain point for me has always been the lack of a numpy-like array type
2017-08-13T20:06:56Z phoe: I'll need to copy, it seems.
2017-08-13T20:07:10Z fiddlerwoaroof: mgl-mat or something might have something that works the way you want it to
2017-08-13T20:08:39Z _death: a displaced array should work
2017-08-13T20:09:39Z phoe: _death: oh, correct.
2017-08-13T20:09:50Z phoe: Won't that be a performance hit if I have an octet vector?
2017-08-13T20:10:44Z _death: sure.. usually flat vectors are used for manipulation of octets..
2017-08-13T20:15:00Z paul0 quit (Read error: Connection reset by peer)
2017-08-13T20:15:49Z fiddlerwoaroof: From the standard it looks like adjusting a displaced array to be non-displaced copies the contents
2017-08-13T20:15:51Z paul0 joined #lisp
2017-08-13T20:15:57Z fiddlerwoaroof: Which is a cool trick...
2017-08-13T20:16:11Z Lowl3v3l quit (Quit: Leaving.)
2017-08-13T20:17:48Z phoe: When I have a vector, can I loop on four values at once?
2017-08-13T20:17:52Z phoe: like I'd do on a list?
2017-08-13T20:18:08Z fiddlerwoaroof: I think you have to write that yourself...
2017-08-13T20:18:21Z fiddlerwoaroof: Although, with a multi dimensional vector, you can just loop over one index
2017-08-13T20:18:31Z fiddlerwoaroof: or, that is, n-1 indices
2017-08-13T20:18:37Z phoe: vectors are one-dimensional
2017-08-13T20:18:44Z fiddlerwoaroof: Ah, :)
2017-08-13T20:18:47Z rpg: phoe: What do you mean loop on for values at once? You mean like a region, of index i, i-1, i+1?
2017-08-13T20:18:53Z fiddlerwoaroof: I confuse vector/array
2017-08-13T20:18:55Z rpg: s/for/four/
2017-08-13T20:18:58Z phoe: I have #(1 2 3 4 5 6) for example, and I want (loop for (x y) on #(1 2 3 4 5 6) ...)
2017-08-13T20:19:03Z phoe: ON works only for lists though
2017-08-13T20:19:12Z rpg: phoe: no, you can't do that.
2017-08-13T20:19:19Z _death: loop does not support that.. you can write your own macro
2017-08-13T20:19:45Z phoe: ...fast-io to the rescue
2017-08-13T20:19:59Z rpg: But you could probably do something like (loop :for x :across arr :using i :as y = (aref arr (1- i)) ....)
2017-08-13T20:20:36Z rpg is not sure he has the loop syntax exactly right
2017-08-13T20:20:56Z _death: hey, could be a good name for a lisp meetup: BYOB & WYOM
2017-08-13T20:21:11Z fiddlerwoaroof: You could also do something like (map 'vector fun (step vec :offset 0 :by 2) (step vec :offset 1 :by 2)) if you had a step function
2017-08-13T20:21:25Z fiddlerwoaroof: :)
2017-08-13T20:23:31Z prxq: phoe: if you start with a 1d vector, you can use a "front end" vector with dimension (x y 4) using the :displaced-to option of make-array
2017-08-13T20:24:06Z _death: this would bring about lots of multiplications
2017-08-13T20:24:12Z prxq: and it won't copy anything
2017-08-13T20:24:51Z prxq: _death: if you want to use dimensions x, y, and z, multiplications will happen anyway.
2017-08-13T20:25:53Z _death: prxq: usually processing is sequential, say pixel-by-pixel or row-by-row, so you can avoid some
2017-08-13T20:25:58Z DingoSaar quit (Remote host closed the connection)
2017-08-13T20:26:50Z pjb: phoe: adjust-array may and will copy an non-adjustable array. Use make-array with :displaced-to
2017-08-13T20:27:30Z phinxy quit (Quit: Leaving)
2017-08-13T20:27:38Z DingoSaar joined #lisp
2017-08-13T20:27:55Z pjb: phoe: displaced arrays are bound to be faster to your own (svref v (+ (* (+ (* x row) y) 4) z))!
2017-08-13T20:28:03Z pjb: s/to your/than your/
2017-08-13T20:28:13Z varjagg joined #lisp
2017-08-13T20:28:18Z phoe: pjb: thanks!
2017-08-13T20:28:50Z pjb: phoe: for vectors you can loop over multiple indices as you wish, since it's O(1) indexed access!
2017-08-13T20:29:15Z pjb: (loop for i below (length v) for x = (aref v i) for y = (aref v (1+ i)) do …)
2017-08-13T20:29:54Z pjb: you may also use adjust-array to change the :displaced-offset-to
2017-08-13T20:31:43Z pjb: I mean :displaced-index-offset
2017-08-13T20:34:16Z pjb: (let ((v (vector 1 2 3 4 5 6))) (loop with 2v = (make-array 2 :displaced-to v :displaced-index-offset 0) for i below (1- (length v)) do (setf 2v (adjust-array 2v 2 :displaced-to (array-displacement 2v) :displaced-index-offset i)) (prin1 2v) (princ " "))) #| #(1 2) #(2 3) #(3 4) #(4 5) #(5 6) --> nil |#
2017-08-13T20:34:37Z pjb: cf. also com.informatimago.common-lisp.cesarum.array:nudge-displaced-vector
2017-08-13T20:34:47Z sz0 joined #lisp
2017-08-13T20:35:42Z _death: think that's the first time I see array-displacement in the wild
2017-08-13T20:36:25Z pjb: _death: then you don't read enough cesarum :-)
2017-08-13T20:36:41Z BitPuffin|osx joined #lisp
2017-08-13T20:37:03Z _death: pjb: :)
2017-08-13T20:40:33Z hhdave joined #lisp
2017-08-13T20:45:01Z hhdave quit (Ping timeout: 246 seconds)
2017-08-13T20:48:37Z safe quit (Read error: Connection reset by peer)
2017-08-13T20:51:45Z rpg quit (Quit: Textual IRC Client: www.textualapp.com)
2017-08-13T20:52:49Z hhdave joined #lisp
2017-08-13T20:56:11Z seanzheng joined #lisp
2017-08-13T20:59:13Z paul0 quit (Read error: Connection reset by peer)
2017-08-13T20:59:21Z angavrilov quit (Remote host closed the connection)
2017-08-13T21:02:51Z seanzheng quit (Remote host closed the connection)
2017-08-13T21:13:48Z fiddlerwoaroof: Has anyone written a common list library for sanitizing html?
2017-08-13T21:13:53Z kora9 joined #lisp
2017-08-13T21:14:34Z fiddlerwoaroof: I've been working on something that needs such a library and, so far, I've been using a javascript library to do this client-side... but that's not really ideal
2017-08-13T21:14:43Z Shinmera: Well, HTML5 is "self-sanitising", so any parser of that will do. Alternatively, Plump will just slurp anything you throw at it, and allow you to serialise a DOM, so.
2017-08-13T21:14:44Z pjb: fiddlerwoaroof: I wrote something a long time ago, around html 4.01. It's entirely outdated. I guess somebody would have to write something for current html and html bugs.
2017-08-13T21:15:00Z kora9: Evening fellow Lisperatis! I'm wondering, why in for example (reduce #'+ '(1 2 3)) is the + preceded by #? I kind of understand that the + is preceded by '
2017-08-13T21:15:26Z fiddlerwoaroof: Shinmera: ? I don't mean validation/cleanup, I'm talking about removing things that could cause XSS or break styling
2017-08-13T21:15:33Z Bike: #'foo stands for (function foo)
2017-08-13T21:15:39Z kora9: Ohh
2017-08-13T21:15:46Z Bike: clhs #'
2017-08-13T21:15:47Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/02_dhb.htm
2017-08-13T21:15:47Z Shinmera: fiddlerwoaroof: Ah, in that sense.
2017-08-13T21:15:50Z oleo: ya a function designator
2017-08-13T21:16:40Z Shinmera: fiddlerwoaroof: Haven't seen a library for that before.
2017-08-13T21:16:42Z pjb: kora9: (defun add (x y) `(this is toplevel add ,x ,y)) (let ((add-q 'add) (add-f #'add)) (flet ((add (x y) `(this is local add ,x ,y))) (list (funcall 'add 1 2) (funcall #'add 1 2) (funcall add-q 1 2) (funcall add-f 1 2)))) #| --> ((this is toplevel add 1 2) (this is local add 1 2) (this is toplevel add 1 2) (this is toplevel add 1 2)) |#
2017-08-13T21:16:50Z kora9: Oh, cool. That's helpful to know. I just checked and (reduce (function +) '(1 2 3)) has the same result :)
2017-08-13T21:17:23Z oleo: so when do you need the # ?
2017-08-13T21:17:42Z pjb: kora9: however, for symbols in the CL package, rules ensure that (eq (symbol-function ',x) (function ,x)) so '+ and #'+ will always call the same function, as long as the + here is CL:+
2017-08-13T21:17:47Z fiddlerwoaroof: This works pretty well client-side: https://github.com/cure53/DOMPurify but, I'm starting to think it would be better to clean the html when I pull the RSS feed
2017-08-13T21:18:01Z pjb: oleo: check my example above with flet/labels!
2017-08-13T21:18:13Z kora9: pjb: oh
2017-08-13T21:18:21Z fiddlerwoaroof: Also, the DOMPurify library has unfortunate interactions with another frontend library I'm using...
2017-08-13T21:18:25Z Shinmera: fiddlerwoaroof: If you know which elements and tags to remove, using lQuery to do that job is pretty easy.
2017-08-13T21:18:53Z Shinmera: *elements and attributes
2017-08-13T21:19:42Z nikivi joined #lisp
2017-08-13T21:23:17Z Shinmera: Eg: (let ((dom (plump:parse ""))) (lquery:$1 dom "script,style,link" (remove) dom "[style]" (attr :style NIL) dom (serialize)))
2017-08-13T21:24:21Z Shinmera: Sanitizing HTML can be a tricky affair though.
2017-08-13T21:24:42Z sjl: fiddlerwoaroof: to be clear, are you looking for something like bleach https://github.com/mozilla/bleach but for CL?
2017-08-13T21:24:51Z fiddlerwoaroof: Basically
2017-08-13T21:24:58Z sjl: or are you looking to completely escape any and all html tags
2017-08-13T21:25:09Z kora9: I've been playing around with cl-who with my hunchentoot tests and it's pretty cool to make html look nice in lisp. But I don't know if that's what you're after
2017-08-13T21:25:15Z fiddlerwoaroof: My use case is an rss feed reader
2017-08-13T21:25:21Z prxq quit (Remote host closed the connection)
2017-08-13T21:25:58Z fiddlerwoaroof: I need to make sure that article content doesn't contain anything that will mess up the ui or allow arbitrary code execution
2017-08-13T21:26:19Z sjl: but you still want to allow reasonable tags
2017-08-13T21:26:22Z fiddlerwoaroof: Yeah
2017-08-13T21:26:40Z sjl: then yeah, a whitelist-based sanitizer like bleach would be ideal. unsure if anyone's built something like it in CL
2017-08-13T21:27:31Z madmalik quit (Quit: Connection closed for inactivity)
2017-08-13T21:27:35Z fiddlerwoaroof: I wonder if bleach plays nicer with Google's closure library: the current library I'm using (DOMPurify) seems to be broken by the google library
2017-08-13T21:27:54Z sjl: bleach is for python...
2017-08-13T21:28:13Z fiddlerwoaroof: Ah, missed that
2017-08-13T21:28:30Z sjl: I was just using it as an example of an approach that's probably ideal for your use case
2017-08-13T21:28:34Z fiddlerwoaroof: Yeah
2017-08-13T21:28:44Z sjl: Might be possible to implement something like it on top of an HTML parser like plump
2017-08-13T21:28:58Z sjl: although I think the html-entities package got removed from quicklisp a while ago for some reason
2017-08-13T21:29:10Z sjl: which might make escaping the bad stuff more tedious
2017-08-13T21:29:12Z fiddlerwoaroof: Probably because it stopped building...
2017-08-13T21:29:41Z sjl: I think it was because it was hosted on Google Code
2017-08-13T21:29:51Z sjl: and when that bit the dust the link broke
2017-08-13T21:29:59Z fiddlerwoaroof: I just realized I need to check the license of my dependencies.
2017-08-13T21:30:06Z anticrisis: pjb: so basically, do I understand correctly that 'add always refers to top-level, while #'add refers to whatever is lexically scoped as add? Hence why it's "safer" to always use #', because programmers expect lexical bindings to take precedence?
2017-08-13T21:30:32Z fiddlerwoaroof: I always use MIT or similar but there are libraries like cl-html5-parser that that rules out.
2017-08-13T21:30:44Z sjl: anticrisis: 'add is a symbol, and when you funcall a symbol it looks up the global function binding
2017-08-13T21:30:52Z KongWubba joined #lisp
2017-08-13T21:31:00Z phoe: sjl: not always global
2017-08-13T21:31:14Z phoe: FLET and LABELS affect that
2017-08-13T21:31:34Z phoe: ...wait a second
2017-08-13T21:31:38Z phoe: I'm wrong!
2017-08-13T21:32:37Z sjl: anticrisis: #'add expands to (function add) which is a special form, and can account for things like flet and labels
2017-08-13T21:33:16Z sjl: generally #' does what you'd expect more often, though there are cases where you might want to use the symbol
2017-08-13T21:33:34Z anticrisis: ok, i think i'm getting it, makes perfect sense when you think of lexical scope versus global scope
2017-08-13T21:33:47Z sjl: e.g. (defparameter *foo* 'my-function)
2017-08-13T21:33:56Z sjl: (funcall *foo*) will always call the latest definition of my-function
2017-08-13T21:34:03Z sjl: e.g. (defparameter *foo* #'my-function)
2017-08-13T21:34:25Z sjl: now (funcall *foo*) will always call that particular version of my-function, even if my-function is redefined later
2017-08-13T21:34:28Z kora9 quit (Remote host closed the connection)
2017-08-13T21:34:39Z Shinmera: fiddlerwoaroof: lQuery/CLSS allow negative matches, so you can do a whitelist based filter like this: (let ((dom (plump:parse ""))) (lquery:$1 dom ":not(foo)" (remove) dom (serialize)))
2017-08-13T21:34:44Z sjl: which can be tricky
2017-08-13T21:35:04Z Shinmera: Though that needs a patch to CLSS that I just pushed. Apparently the :not pseudo-selector has been broken for quite a while. Whoops!
2017-08-13T21:35:21Z anticrisis: right - seems like you'd want to avoid binding a particular function to a global variable
2017-08-13T21:35:21Z fiddlerwoaroof: Also, I like #' because it visually distinguishes functions from ordinary symbols
2017-08-13T21:35:41Z fiddlerwoaroof: (which is another argument for preferring it wherever possible)
2017-08-13T21:36:04Z sjl: see also: https://google.github.io/styleguide/lispguide.xml?showone=__FUN_vs.__FUN#__FUN_vs.__FUN
2017-08-13T21:36:38Z Shinmera: Good URL
2017-08-13T21:37:19Z anticrisis: it's not a good reason, but i'm still coming to terms with my dislike of the character # -- draws my eye's attention too much
2017-08-13T21:37:45Z sjl: the global variable thing was just an example -- you might also want to store functions in non-global variables
2017-08-13T21:37:53Z sjl: but still allow them to use the latest version of the code
2017-08-13T21:37:58Z Shinmera: Less social media will help forget about #
2017-08-13T21:38:18Z anticrisis: ha exactly
2017-08-13T21:38:28Z sjl: here's an example where I specifically use ' instead of #' in a little roguelike game: https://github.com/sjl/rldt/blob/master/src/main.lisp#L424-L432
2017-08-13T21:38:56Z sjl: that way all healing potion objects know their effect is 'use-healing-potion
2017-08-13T21:39:19Z sjl: and if I update use-healing-potion while the game is running, I odn't need to recreate all the healing potions
2017-08-13T21:40:00Z anticrisis: right, that makes sense -- it seems to me more common to think of a symbol as dynamically naming a function
2017-08-13T21:40:38Z Shinmera: It's just a question of whether you pass a literal function object, or a name that resolves to one.
2017-08-13T21:40:45Z sjl: exactly
2017-08-13T21:40:46Z anticrisis: so in that case, if you had used #'use-healing-potion, redefining the use-healing-potion function would not take effect for all of its users, right?
2017-08-13T21:41:04Z sjl: correct. all existing healing potions would still have pointers to the old function object
2017-08-13T21:41:14Z sjl: newly created ones would point to the new one
2017-08-13T21:41:29Z anticrisis: even though in theory the old function no longer exists
2017-08-13T21:41:53Z Shinmera: fiddlerwoaroof: Regarding licenses: All of my libraries are compatible with MIT/BSD, so you're free to use them as you deem fit.
2017-08-13T21:42:01Z fiddlerwoaroof: great
2017-08-13T21:42:17Z sjl: anticrisis: well it does still exist, because all the old healing potions would be pointing to it ;)
2017-08-13T21:42:31Z sjl: but yeah, the old function is no longer accessible through its old name
2017-08-13T21:42:43Z anticrisis: right, it just doesn't exist in source code anymore
2017-08-13T21:42:52Z anticrisis: ok, i think i've got it
2017-08-13T21:42:55Z fiddlerwoaroof: One consideration is how you want your code to behave during development
2017-08-13T21:43:01Z anticrisis: thanks for the explanation, super helpful
2017-08-13T21:43:27Z fiddlerwoaroof: If you're using slime or something, using a symbol rather than a function literal will mean that you don't have to recompile the reference to update the dependency
2017-08-13T21:43:37Z moei joined #lisp
2017-08-13T21:43:46Z EvW quit (Ping timeout: 255 seconds)
2017-08-13T21:44:18Z anticrisis: right - it feels more natural (to me, right now) to be dynamic
2017-08-13T21:45:30Z sjl: basically you want #' if you're using it immediately, and you *might* want a plain symbol if you're storing it and using it later
2017-08-13T21:46:05Z fiddlerwoaroof: On the other hand the plain symbol has all the disadvantages of dynamic variables...
2017-08-13T21:46:15Z attila_lendvai quit (Quit: Leaving.)
2017-08-13T21:46:26Z mishoo quit (Ping timeout: 260 seconds)
2017-08-13T21:46:38Z attila_lendvai joined #lisp
2017-08-13T21:46:38Z attila_lendvai quit (Changing host)
2017-08-13T21:46:38Z attila_lendvai joined #lisp
2017-08-13T21:47:24Z Shinmera: Also, (flet ((foo () (print "whoa"))) (funcall 'foo)) won't work.
2017-08-13T21:47:31Z pjb: anticrisis: correct.
2017-08-13T21:48:25Z pjb: anticrisis: however, using a symbol to denote a function also has some advantages: it's a later binding; if you redefine the function the symbol will refer to the new definition, while #'x will refer to the old function until it's re-compiled.
2017-08-13T21:48:42Z pjb: For reader macros, I would strongly advise to use symbols…
2017-08-13T21:49:14Z pjb: (this is also a reason to avoid anonymous functions in this kind of places (hooks), so that you may redefine the function at run-time without recompiling everything).
2017-08-13T21:50:08Z fiddlerwoaroof: For hooks, I generally store the function in a hash-table or some kind of datastructure
2017-08-13T21:50:29Z fiddlerwoaroof: So, as long as I remember the reference, it's generally fairly easy to replace a previously added hook
2017-08-13T21:51:03Z pjb: packages and symbols do that for you automatically.
2017-08-13T21:51:55Z anticrisis: pjb: thank you, that's very clear. i take it as #' means "use thing as it's defined now" versus ' means "use this thing as it's defined when you invoke it." Like storing a value versus a reference.
2017-08-13T21:52:09Z EvW joined #lisp
2017-08-13T21:52:13Z pjb: anticrisis: #'x is read as (CL:FUNCTION X)
2017-08-13T21:52:38Z pjb: cl:function is the only special operator that creates closures and anonymous functions.
2017-08-13T21:53:03Z pjb: cl:lambda is a macro that expand to (cl:function (cl:lambda …)) <- it's cl:function that creates the anonymous function!
2017-08-13T21:53:49Z pjb: such cl:lambda macro didn't exist in some language before CL, which is why some people write #'(lambda …) but it's useless in CL, where cl:lambda expands automatically to (cl:function (cl:lambda …))
2017-08-13T21:53:51Z gremdrus: how do you get the current directory? I want to save files to a relative directory
2017-08-13T21:53:54Z gremdrus: https://stackoverflow.com/questions/8409527/common-lisp-get-path-to-file is not helpful :(
2017-08-13T21:54:08Z pjb: gremdrus: when?
2017-08-13T21:54:13Z gremdrus: I mean absolute path to the current directory
2017-08-13T21:54:14Z phoe: (uiop:getcwd)
2017-08-13T21:54:36Z Shinmera: gremdrus: Depends on what you mean by "current directory"
2017-08-13T21:54:42Z gremdrus: but that gives me my home directory
2017-08-13T21:54:53Z phoe: gremdrus: that is because your current directory is your home directory
2017-08-13T21:55:05Z pjb: Usually, *default-pathname-defaults* set to #P"" will make pathnames without directory go to the posix current working directory.
2017-08-13T21:55:20Z phoe: (uiop:chdir ...) to change it
2017-08-13T21:55:29Z pjb: or you can set *default-pathname-defaults*
2017-08-13T21:55:40Z pjb: your program may run on non-posix systems one day!
2017-08-13T21:55:41Z gremdrus: but there's nothing like pythons -> https://stackoverflow.com/questions/5137497/find-current-directory-and-files-directory?
2017-08-13T21:55:50Z pjb: This is #lisp.
2017-08-13T21:56:09Z phoe: gremdrus: what do you expect the output to be?
2017-08-13T21:56:58Z gremdrus: the output should spit out the folder that contains the file
2017-08-13T21:57:09Z phoe: gremdrus: which file?
2017-08-13T21:57:19Z anticrisis: he's looking for the directory which contains the source file being evaluated
2017-08-13T21:57:33Z gremdrus: anticrisis: exactly
2017-08-13T21:57:34Z anticrisis: that's what python's __file__ means
2017-08-13T21:57:34Z pjb: When?
2017-08-13T21:57:39Z gremdrus: sorry I guess I wasn't being clear
2017-08-13T21:57:49Z pjb: At compilation-time? At load-time? At run-time?
2017-08-13T21:58:00Z gremdrus: at run-time I suppose
2017-08-13T21:58:06Z pjb: Where are the sources?
2017-08-13T21:58:32Z pjb: On a remote git server, miles away from your computer…
2017-08-13T21:58:36Z gremdrus: in my ~/src/lisp directory?
2017-08-13T21:58:38Z pjb: This is where you want to get some file?
2017-08-13T21:58:52Z gremdrus: err yes
2017-08-13T21:58:56Z Shinmera: If your usual MO is to compile or load the file, then (make-pathname :name NIL :type NIL :defaults #.(or *compile-file-pathname* *load-pathname* *default-pathname-defaults*))
2017-08-13T21:59:07Z pjb: So how will I access your ~gremdrus/src/lisp directory when I run your program?
2017-08-13T21:59:23Z Shinmera: Note that this will not give you what you want if you compile that snippet with, say, slime's C-c C-c.
2017-08-13T22:00:13Z pjb: gremdrus: you know, there's a reason all the programs take options such as -o output.file or use save panel to select a place where to save files…
2017-08-13T22:01:11Z pjb: gremdrus: alternatively you could use a default computed path, cf. the XDG standard, but you would do it in the (user-homedir-pathname), not relative to the sources!
2017-08-13T22:01:36Z anticrisis: it's likely he's thinking about a command line utility or something, which acts on files in the directory he's invoking it from -- just guessing here
2017-08-13T22:01:49Z pjb: This is very bad design.
2017-08-13T22:01:54Z pjb: Don't do that!
2017-08-13T22:02:15Z anticrisis: well what about for testing/learning/prototyping?
2017-08-13T22:02:25Z pjb: Never touch the files in the current working directory. Always use specifically indicated input and output files. Use command line arguments! (or configuration files).
2017-08-13T22:02:57Z pjb: Then again, there's no question about the sources! Just use the current directory: (open "file.txt" :if-does-not-exist :create) and that's it!
2017-08-13T22:03:33Z sjl: yeah that's why I manually craft my git commit hashes and pass -o./git/objects/abc123 to every git command
2017-08-13T22:03:35Z phoe: Geez... SKIPPY data-streams have such a weird API.
2017-08-13T22:03:53Z Karl_Dscc quit (Remote host closed the connection)
2017-08-13T22:03:55Z phoe: You can only add images to a data stream, not remove them.
2017-08-13T22:04:34Z phoe: Among other API things.
2017-08-13T22:04:38Z pjb: sjl: again, git doesn't save the repo in a directory relative the the fucking SOURCES OF GIT!
2017-08-13T22:04:55Z sjl: pjb: it also doesn't "Always use specifically indicated input and output files."
2017-08-13T22:05:16Z pjb: Anyways, there's also a reason why some things are hard to do: because it's not a good idea to do them!
2017-08-13T22:05:24Z gremdrus: jeez didn't mean to start something, just had trouble scraping a website
2017-08-13T22:05:35Z anticrisis: so what is the accepted way to write a command-line utility in CL?
2017-08-13T22:05:44Z sjl: gremdrus: read what Shinmera told you, that's probably what you want
2017-08-13T22:06:02Z anticrisis: is the website in your current directory? (ok just teasing)
2017-08-13T22:06:03Z pjb: gremdrus: if you want to do ( cd output ; command-to-fill-this-directory ) then you can, and you don't have to look up the directory where your sources are stored.
2017-08-13T22:06:04Z sjl: anticrisis: some people use Roswell and .ros
2017-08-13T22:06:11Z pjb: gremdrus: just use a relative path.
2017-08-13T22:06:13Z zulu_inuoe_: Hey all.. I have a question for somebody that has a pretty deep understanding of CLOS.. Is shared-initialize supposed to be calling initialize-instance ? I am reading and re-reading the documentation for 'shared-initialize' but I keep coming up with the answer that it should be the other way around: initialize-instance->shared-initialize
2017-08-13T22:06:17Z sjl: anticrisis: others use their implementations save-lisp-and-die
2017-08-13T22:07:00Z pjb: anticrisis: you write CLI tools in CL just like in C or in shell. (well, easier than in C or shell).
2017-08-13T22:07:00Z anticrisis: right, i like roswell's .ros approach, just haven't used it yet
2017-08-13T22:07:57Z sjl: anticrisis: it pretty much works, and the command line arg handling is okay. not as nice as python's argparse or getopt or whatever its name is (I forget) though
2017-08-13T22:08:29Z phoe: clhs shared-initialize
2017-08-13T22:08:30Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/f_shared.htm
2017-08-13T22:08:32Z sjl: anticrisis: roswell has always been kind of flaky for me though, especially when trying to upgrade it, so these days I mostly just have a makefile that runs a really small script to dump an SBCL executable
2017-08-13T22:08:37Z KongWubba quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
2017-08-13T22:08:45Z anticrisis: huh interesting
2017-08-13T22:08:45Z phoe: "The generic function shared-initialize is called by the system-supplied primary method for initialize-instance, reinitialize-instance, update-instance-for-redefined-class, and update-instance-for-different-class."
2017-08-13T22:08:49Z phoe: zulu_inuoe_: ^
2017-08-13T22:09:03Z anticrisis: i'm always sad when i see "save-lisp-and-die" -- seems so pessimistic
2017-08-13T22:09:16Z whoman: being a hero
2017-08-13T22:09:19Z phoe: it seems right, INITIALIZE-INSTANCE -> SHARED-INITIALIZE
2017-08-13T22:09:19Z anticrisis: or the tragic hero
2017-08-13T22:09:20Z zulu_inuoe_: phoe: Correct. So, shared-initialize -shouldn't- be calling initialize-instance, right?
2017-08-13T22:09:21Z anticrisis: right :)
2017-08-13T22:09:28Z whoman: =)
2017-08-13T22:09:31Z phoe: zulu_inuoe_: smells like it
2017-08-13T22:09:50Z zulu_inuoe_: phooey. Because it totally is..
2017-08-13T22:10:10Z zulu_inuoe_: Erm. I mean. I am calling shared-initialize and it's calling initialize-instance on me
2017-08-13T22:10:15Z pjb: And we should override shared-initialize rather than initialize-instance in general, but writing a shared-initialize is more complex, since you would have to take into account the cases of reinitialize-instance and update-instance-*
2017-08-13T22:10:15Z sjl: anticrisis: but tbh I still use roswell for commandliney scripts, mostly because I haven't gotten around to rewriting them
2017-08-13T22:10:34Z phoe: zulu_inuoe_: trace SHARED-INITIALIZE and INITIALIZE-INSTANCE
2017-08-13T22:10:37Z phoe: observe them
2017-08-13T22:10:42Z sjl: not that I make a lot of CLI scripts in CL...
2017-08-13T22:11:10Z anticrisis: sjl: at the very least, roswell was the only way i could install sbcl/ccl on windows
2017-08-13T22:11:45Z sjl: anticrisis: ah, yeah, I haven't used windows in years. I imagine if Roswell makes those easy there, that's a pretty big plus
2017-08-13T22:12:08Z zulu_inuoe_: phoe: That was a bad idea on my non-optimized game that is constantly spawning event objects :P
2017-08-13T22:12:15Z anticrisis: it's huge, actually -- really should be promoted in more getting-started guides
2017-08-13T22:12:34Z phoe: zulu_inuoe_: oh goodness
2017-08-13T22:13:05Z sjl: oh roswell is in homebrew now
2017-08-13T22:13:12Z sjl: maybe this will make the upgrade process less fragile
2017-08-13T22:13:22Z sjl: that would solve my main complaint about it
2017-08-13T22:14:00Z zulu_inuoe_: Whenever I write a CLI script I always use *load-truename*. At least for me it's always worked
2017-08-13T22:14:12Z zulu_inuoe_: All my build scripts etc are written in lisp
2017-08-13T22:14:38Z pjb: Only it changes. It can be ~/src/lisp/…, ~/.cache/common-lisp/… or NIL.
2017-08-13T22:15:01Z zulu_inuoe_: Not if I'm doing sbcl --load
2017-08-13T22:15:05Z pjb: depending on :compile-toplevel :load-toplevel :execute or running your code otherwise.
2017-08-13T22:15:31Z pjb: zulu_inuoe_: you're doing two errors: 1- using (assuming) sbcl and 2- assuming load of the source.
2017-08-13T22:15:41Z seanzheng joined #lisp
2017-08-13T22:16:48Z zulu_inuoe_: pjb: I don't see it as an error if it's well-defined for my scripts to be run that way
2017-08-13T22:17:27Z seanzheng quit (Remote host closed the connection)
2017-08-13T22:17:49Z anticrisis: pjb: this seems more complicated than it should be
2017-08-13T22:17:49Z seanzheng joined #lisp
2017-08-13T22:18:13Z pjb: parsing the argument list is as trivial as you want.
2017-08-13T22:18:29Z pjb: NOT using the source directory is even easier: you just fucking have NOTHING to do!
2017-08-13T22:18:38Z mejja joined #lisp
2017-08-13T22:19:06Z rngoodn joined #lisp
2017-08-13T22:19:39Z seanzheng quit (Client Quit)
2017-08-13T22:21:35Z safe joined #lisp
2017-08-13T22:22:27Z rngoodn quit (Client Quit)
2017-08-13T22:22:53Z mishoo joined #lisp
2017-08-13T22:24:09Z ebzzry_ joined #lisp
2017-08-13T22:24:46Z anticrisis: say i want to implement something like jekyll: i need to loop through files in ./_posts and output them to ./_site. don't i need access to the current directory somehow? because i want users to be able to type 'jekyll serve' and be done. i feel like i'm not understanding the point you're making.
2017-08-13T22:25:28Z varjagg quit (Ping timeout: 246 seconds)
2017-08-13T22:32:45Z rngoodn joined #lisp
2017-08-13T22:33:44Z pjb: (mapcar (lambda (path) (list path (make-pathnames :directory '(:relative "_site") :defaults path))) (directory "_posts/*.*"))
2017-08-13T22:34:05Z pjb: The point I'm making is that you fucking do not need the path to the sources!
2017-08-13T22:34:23Z phoe: Fuck!
2017-08-13T22:34:29Z pjb: yep.
2017-08-13T22:34:38Z phoe: SKIPPY:COMPOSITE does just what it should but exactly not what I want it to do!
2017-08-13T22:34:45Z pjb: :-)
2017-08-13T22:35:26Z sjl: 2017-08-13 18:02:26 Never touch the files in the current working directory. Always use specifically indicated input and output files.
2017-08-13T22:35:30Z sjl: that's probably what's confusing him
2017-08-13T22:35:38Z phoe: How the hell can I tell it to skip replacing transparent pixels?
2017-08-13T22:36:12Z sjl: touching files relative to the source file's location is pretty questionable
2017-08-13T22:36:24Z sjl: but touching files in the current directory is reasonable
2017-08-13T22:36:48Z pjb: sjl: yes, there was multiple points. The most important is about the directory of the sources. But it's also not a good practice to use the current working directory. It'd be better to take an option to tell the program what directory to process.
2017-08-13T22:39:45Z pjb: Also, in bash scripts, having to cd is always a problem. Either you have to do it in a subshell, or you have to deal with going back to the original working directory (cd - may work, but it's not always what you want or can do), and in all case you have to check for errors (when the directory doesn't exist or is not accessible, and it is particularly painful to do in bash (error handling), so it's rarely done, and so you have so m
2017-08-13T22:39:45Z pjb: bugs in scripts… Which again shows that it's just not a good idea to process the current directory.
2017-08-13T22:40:00Z pjb: You want to process A directory, then tell the command : do-something --with A
2017-08-13T22:41:11Z sjl: Ideally you allow both, e.g. ls defaulting to printing the current directory but allowing args, or git defaulting to ./.git but honoring --git-dir
2017-08-13T22:41:43Z sjl: sometimes explicit is better -- e.g. `rm` doesn't just blow away everything
2017-08-13T22:42:03Z random-nick quit (Remote host closed the connection)
2017-08-13T22:43:29Z sjl: not providing the current directory as a default even when it would often be useful can be annoying, e.g. always having to use 'find .'
2017-08-13T22:43:53Z whoman: constructive or destructive operations should be targetted explicitly, noncreative and nondestructive could be implicit
2017-08-13T22:44:04Z sjl: that's a good rule of thumb, sure
2017-08-13T22:44:10Z pjb: yes, as whoman says.
2017-08-13T22:44:20Z sjl: though again, I don't wanna pass git -o./.git/objects/hash
2017-08-13T22:44:45Z pjb: you could pass: git --repo .
2017-08-13T22:44:50Z sjl: like most things in life, it's not 100% always or never. there are usually tradeoffs
2017-08-13T22:44:59Z rngoodn quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
2017-08-13T22:45:08Z sjl: sure, it supports that with --git-dir=.git
2017-08-13T22:45:23Z Bike: huh, i didn't know about that. coolio
2017-08-13T22:45:25Z sjl: but folks seem happy with .git being the default
2017-08-13T22:45:31Z pjb: And then git has other implicit rules, such as looking into .. up to the root…
2017-08-13T22:45:40Z anticrisis: directory is quite useful. I just did this: (mapcar 'delete-file (directory "./*.fasl"))
2017-08-13T22:45:40Z anticrisis:
2017-08-13T22:45:57Z pjb: (which is nice when you're in your repo, but when you're lost (ie. in scripts), it can be a problem.
2017-08-13T22:46:00Z pjb: )
2017-08-13T22:47:40Z phoe: BEHOLD. http://paste.lisp.org/display/353409
2017-08-13T22:47:52Z phoe: I'm not satisfied with this code in the God damn slightest.
2017-08-13T22:48:13Z pjb: phoe: replace the let* with (loop with … with …
2017-08-13T22:48:30Z phoe: pjb: sounds sane.
2017-08-13T22:48:32Z pjb: phoe: and put the make-data-stream in a :finally (return …) clause.
2017-08-13T22:50:19Z anticrisis: loop is amazing
2017-08-13T22:50:25Z pjb: You could prehaps replace the push with a :collect new-image :into result and use :initial-images (nconc result (list (first images))) in the make-data-stream
2017-08-13T22:50:37Z pierpa joined #lisp
2017-08-13T22:50:39Z phoe: pjb: I just did.
2017-08-13T22:50:54Z pjb: good.
2017-08-13T22:50:55Z phoe: About the pushing, eh.
2017-08-13T22:51:02Z phoe: I'll keep it like that.
2017-08-13T22:52:27Z phoe: http://paste.lisp.org/display/353409#1 still.
2017-08-13T22:52:33Z phoe: There is something terrifying about this code.
2017-08-13T22:52:53Z cluck joined #lisp
2017-08-13T22:53:00Z Bike: eh, nah.
2017-08-13T22:53:08Z Bike: i mean it's long but it's just bindings.
2017-08-13T22:53:19Z pjb: phoe: you could macroify it, or avoid named variables.
2017-08-13T22:53:21Z Bike: what's bad is when i get carried away and two two levels of conditionals
2017-08-13T22:53:48Z pjb: All variable such as top-position that is used only once should be eliminated…
2017-08-13T22:53:56Z pjb: So you just get a big sexp.
2017-08-13T22:55:10Z Mon_Ouie quit (Quit: WeeChat 1.9)
2017-08-13T22:55:24Z pjb: As for the (skippy:… image) you can write a macrolet (macrolet ((ref (name) `(,(intern (string name) "SKIPPY") image))) (ref top-position) (ref left-position) …)
2017-08-13T22:55:35Z pjb: or in the worst cases, you can write a reader macro!
2017-08-13T22:56:25Z pjb: and a unicode character: ⎕top-position ⎕left-position etc.
2017-08-13T22:57:09Z pjb: or ∴top-position ∴left-position, you have a lot of esthetic and symbolic choice with unicode characters.
2017-08-13T22:57:09Z fiddlerwoaroof: pjb: as far as error handling in bash goes, a good rule of thumb is to always start a script with set -o pipefail -eu
2017-08-13T22:57:53Z anticrisis: ran across this amazing use of loop last night: https://github.com/fare/asdf/blob/1b0a0fd945ade1f341f3b2d3c0596cc4aa5244f3/uiop/package.lisp#L678
2017-08-13T22:58:18Z pjb: eg. you can use chinese ideograms: 图top-position 图left-position
2017-08-13T22:58:30Z pjb: So at least some of the programmers will understand the notation! :-)
2017-08-13T22:58:37Z Bike: it would be way more convenient if stuff like 'append' was a local macro instead of syntax.
2017-08-13T22:58:41Z Bike: i think that's how it is in iterate
2017-08-13T22:58:50Z pjb: fiddlerwoaroof: this is what I used to do, but it still has its problems.
2017-08-13T22:59:18Z fiddlerwoaroof: I was doing a algorithms course on Coursera, and I found that LOOP's syntax basically let me translate the pseudocode into something executable nearly word for word
2017-08-13T22:59:31Z pjb: fiddlerwoaroof: -u makes empty arrays signal an error. and -e doesn't apply everywhere anyways. So an erroneous cd in a lot of positions won't break the script.
2017-08-13T22:59:51Z fiddlerwoaroof: -o pipefail helps with -e's shortcomings
2017-08-13T23:00:08Z pjb: I'll have to try it.
2017-08-13T23:00:26Z fiddlerwoaroof: -u is annoying, I grant, especially when you're doing stuff like checking for possibly non-existent command line arguments
2017-08-13T23:00:39Z fiddlerwoaroof: In those cases, you have to do something like ${1:-default value}
2017-08-13T23:00:51Z pjb: fiddlerwoaroof: and the worst of all #!/bin/bash -eu -o pipefail is useless when people run the script (which is named foo.sh!) with bash foo.sh !
2017-08-13T23:01:04Z fiddlerwoaroof: that's why you use set at the top
2017-08-13T23:01:16Z pjb: fiddlerwoaroof: so you need both: #!/bin/bash -eu -o pipefail and set -eu -o pipefail # yes.
2017-08-13T23:01:18Z sjl: Bike: yeah, being able to define new iteration constructs as macros is the best part of iterate
2017-08-13T23:01:36Z fiddlerwoaroof: set -eu -o pipefail applies in both cases, so you don't need the options in the shebang line
2017-08-13T23:02:04Z pjb: fiddlerwoaroof: so it's just yet another turing tarpit. You can have fun and get paid for it, but it's just a silly time waste.
2017-08-13T23:02:10Z fiddlerwoaroof: :)
2017-08-13T23:02:29Z zulu_inuoe_: phoe: You remember how I was complaining about initialize-instance getting called? This is what my genious self was calling.. (shared-initialize (initialize-instance obj) slots-needing-init)
2017-08-13T23:02:36Z pjb: fiddlerwoaroof: there may be differences while reading .bashrc
2017-08-13T23:02:52Z zulu_inuoe_: past me is such a bloody idiot
2017-08-13T23:02:55Z pjb: which is why I like to have the options on both the shebang and set lines.
2017-08-13T23:03:44Z fiddlerwoaroof: anticrisis: here's the merge part of merge sort all in loop: http://paste.lisp.org/+7KP1
2017-08-13T23:04:13Z fiddlerwoaroof: I think this is conforming lisp code, but the part of the standard that specifies loop is a bit difficult to understand
2017-08-13T23:06:08Z fiddlerwoaroof: here's a version with better indentation: http://paste.lisp.org/+7KP1/1
2017-08-13T23:06:45Z eponym joined #lisp
2017-08-13T23:07:15Z epony quit (Read error: Connection reset by peer)
2017-08-13T23:09:35Z sjl: I'm pretty sure that's technically non-conforming, but will work in most implementations
2017-08-13T23:10:13Z sjl: according to the standard all var init clauses have to come before stuff like while
2017-08-13T23:10:16Z kolko quit (Ping timeout: 246 seconds)
2017-08-13T23:10:25Z sjl: wasn't this mentioned in a recent paper?
2017-08-13T23:11:24Z sjl: ah, yes http://metamodular.com/loop.pdf
2017-08-13T23:11:40Z sjl: > For example,
2017-08-13T23:11:42Z sjl: the standard requires all variable clauses to precede all main
2017-08-13T23:11:44Z sjl: clauses.
2017-08-13T23:12:28Z sjl: port it to iterate and it'll work :)
2017-08-13T23:15:53Z mishoo quit (Ping timeout: 258 seconds)
2017-08-13T23:16:14Z fiddlerwoaroof: Yeah, the confusing part is that it says "Termination-test control constructs can be used anywhere within the loop body. The termination tests are used in the order in which they appear. If an until or while clause causes termination, any clauses that precede it in the source are still evaluated. If the until and while constructs cause termination, control is passed to the loop epilogue, where any finally
2017-08-13T23:16:16Z fiddlerwoaroof: clauses will be executed.
2017-08-13T23:16:41Z fiddlerwoaroof: But, it makes sense if you pay attention: for .. in clauses are part of the "loop prologue"
2017-08-13T23:17:49Z Suzuran42 joined #lisp
2017-08-13T23:18:15Z sjl: a (loop ... while ... for) doesn't even parse according to the grammar defined in the spec, so everything else after that would seem irrelevant
2017-08-13T23:18:59Z eponym quit (Quit: QUIT)
2017-08-13T23:19:24Z sjl: iterate version: http://paste.lisp.org/display/353413#2
2017-08-13T23:19:36Z epony joined #lisp
2017-08-13T23:20:03Z sjl: though I'd probably unnest that second loop and just put it next in the prog1
2017-08-13T23:20:27Z mathi_aihtam joined #lisp
2017-08-13T23:20:34Z phoe: Xach: https://blog.teknik.io/phoe/p/363 Should it make it into SKIPPY?
2017-08-13T23:21:09Z Suzuran quit (Ping timeout: 246 seconds)
2017-08-13T23:21:09Z Suzuran42 is now known as Suzuran
2017-08-13T23:21:12Z daemoz quit (Quit: WeeChat 1.7.1)
2017-08-13T23:21:51Z varjagg joined #lisp
2017-08-13T23:22:17Z warweasle quit (Quit: Leaving)
2017-08-13T23:26:27Z varjagg quit (Ping timeout: 255 seconds)
2017-08-13T23:29:51Z daemoz joined #lisp
2017-08-13T23:31:20Z phoe: Xach: compare the differences in structure, https://imgtc.com/a/yZIULRO
2017-08-13T23:37:44Z rgrau quit (Ping timeout: 258 seconds)
2017-08-13T23:38:52Z rngoodn joined #lisp
2017-08-13T23:43:43Z brendos joined #lisp
2017-08-13T23:54:27Z kev1n joined #lisp
2017-08-13T23:55:19Z raynold joined #lisp
2017-08-13T23:55:53Z mejja quit (Quit: \ No newline at end of file)
2017-08-13T23:56:58Z kev1n quit (Remote host closed the connection)
2017-08-13T23:57:17Z kev1n joined #lisp
2017-08-13T23:58:52Z kev1n quit (Remote host closed the connection)
2017-08-13T23:59:07Z kev1n joined #lisp
2017-08-13T23:59:49Z fiddlerwoaroof: dwim.hu seems to be down.