freenode/#lisp - IRC Chatlog
Search
1:14:45
aeth
pragmaticmonkey: Lisp is good for many things, but finding a job is not one of those things.
1:21:52
malice
Xach: I am explaining methods in CL and when reading Keene I noticed that she mentions that you have to invoke method through the generic function.
1:22:25
malice
I was curious whether it was always the case, or if you could, by some other mechanisms, retrieve a method object and then invoke it on some arguments, bypassing the generic function, though perhaps doing the same work as it would.
1:24:49
Bike
in an implementation with mop you can get the method function. but calling methods like that is not normal or anything, and pretty hairy to do.
1:24:55
sjl
is there a less awful way of handling the if-exists argument here? http://paste.stevelosh.com/5a5ea5a9e5abd80008d72afb
1:25:33
jasom
malice: if you know you are going to do it ahead of time, you can implement the method with a vanilla function and then inline the function into the method
1:25:42
sjl
I want to pass along the if-exists to the with-open-file, but passing nil and not passing it are two different things
1:26:19
sjl
and I can't hack around it with (apply ... (if if-exists-given `(:if-exists ,if-exists) nil) because w-o-f is a macro
1:28:54
jasom
you could open-code the wtih-open-file using unwind-protect, or you could manually calculate the default value
1:30:03
sjl
If you're writing a new file and get an error, it tries to clean up the partially-written file for you
1:30:42
sjl
I mean, I can reimplement that too... but I think I can live with the ugly if that's the solution
1:35:46
jasom
something like (defun write-foo-to-file path data &key (if-exists (if (eql (pathname-version (pathname path)) :newest) :new-version :error)
1:55:18
Xach
I tease. I really do think you can indent how you like. The last IF is the only style I like.
1:57:30
Xach
sjl: Really? I have never seen your style before. The only similar variant I've seen is the dedented ELSE clause, but that seems to be from people with lisps that have an implicit progn in else.
3:35:49
jmercouris
So within next, there is a concept of *active-buffer*, what it is, is just like a defparameter that points to the object of type buffer that is the currently active buffer
3:36:06
jmercouris
the active buffer can be activated by opening the minibuffer, switching the buffer in focus etc
3:36:38
jmercouris
I was thinking, this is a problem, because if we are to oen day support multiple panes, there will be multiple buffers on screen, and the user may click on a different buffer, and not just switch buffers via the keyboard
3:37:03
jmercouris
so the issue is, now we have a *active-buffer* that is pointing to something ONLY settable by keyboard, whereas the user may click on a different buffer, therefore making the *active-buffer* incorrect
3:37:45
jmercouris
I was therefore thinking any functions that wish to operate upon the active-buffer should actually invoke some function get-active-buffer, which will query the UI to determine which is actually the currently selected buffer
3:41:41
beach
Usually, user gestures are relative to a [let's call it a] window. The window contains a buffer, and that buffer is the one that is meant for gestures emitted to that window.
3:42:45
beach
While I am at it, some terminology: There is no such thing as "a defparameter". There is such a thing as "a defparameter FORM", resulting in the creation of a "special variable".
3:45:31
jmercouris
and I need to know which window is selected, so I should query the interface before some operation
3:45:52
jmercouris
ignore my first "okay, yeah, definitely, but a window may contain several buffers"
3:47:11
beach
I personally "select" my windows by moving the mouse into one. But I guess that is a kind of selection.
3:47:52
jmercouris
what if the user performs some action right, some long running action or they open the minibuffer and then do something else
3:48:09
beach
I don't know how your GUI layer works, but usually, the selection is an OS-wide thing, and gestures get delivered with an explicit window attached.
3:51:22
sjl
stylewarning: you merged my commit to cl-charms that has that indent style, must not be THAT horrible https://github.com/HiTECNOLOGYs/cl-charms/commit/e41103ac6b47c2464209f03141cc3d54426dc3a8
3:56:01
sjl
I don't think I've looked at the CCL codebase much at all so I can't have gotten it from there
4:16:19
beach
There is no particular reason to indent the `then' and `else' forms of and IF more than two spaces.
4:16:48
sjl
It's more consistent with [ec](type)?case -- the value you're checking comes on the first line, then all the possible branches come indented 2 spaces each below.
4:18:38
sjl
Yeah, indenting the branches at the same level as the test makes it look less like a control structure and more like an ordinary function to me.
4:43:01
fiddlerwoaroof_
I'm trying to figure out what the "right" way to mark an ASDF operation as done is, if you're skipping it
4:48:01
stylewarning
sjl I guess I’ve programmed into my brain that the code is wrong if IF doesn’t have two branches
4:48:35
sjl
I feel like they should have either gone all the way and let it have 0 branches, or force it to have 2.
4:57:50
fiddlerwoaroof_
And, Xach, I have a fix that makes LINEDIT compile again, does Nikodemus Sivola still maintain his libraries?
5:08:37
beach
fiddlerwoaroof_: Emacs indents the `then' part by 4 positions, and the `else' part (which can have more than one form in it) by 2 positions.
5:11:13
fiddlerwoaroof_
It does that in emacs-lisp mode, but not (for me) when slime is loaded and it's in common-lisp mode
5:12:24
beach
If you are using slime-indentation, then both the `then' and the `else' parts are indented 4 positions.
5:15:18
fiddlerwoaroof_
beach: yeah, I have 4-space indents for both branches when editing .lisp files
5:15:47
shaftoe
fiddlerwoaroof_: looking at linedit pull requests, seems like some have been around for a while
5:17:59
fiddlerwoaroof_
Maybe I can takeover that project? Fare has a fix that I'm planning to merge with my fix
5:43:32
jmercouris
I would like to make a defcommand macro, the only ideas I have to go off of are ones suggested to me from stumpwm, and the other which I can see in lispkit: https://github.com/AeroNotix/lispkit/blob/master/commands.lisp#L29
5:44:21
jmercouris
I was further thinking of prefixing all commands with some sort of namespace like next-command, so that I can provide some sort of m-x completion by being able to query the symbols in a package
5:59:05
beach
More inspiration: https://github.com/robert-strandh/Second-Climacs/blob/master/Command/command.lisp
6:00:19
beach
With this technique, the types of the arguments are kept with the function, so that arguments can be acquired according to the types when the command is invoked interactively.
6:07:36
jmercouris
so as you can see, bookmark-url can be called with arguments as it doesn't need to accept args
6:08:09
jmercouris
that's where you can specify all sorts of things like, completion function to call, any setup etc
6:09:47
beach
Hard to say. I am inspired by the presentation-type system of CLIM II, which I think is excellent in terms of the modularity that it provides.
6:11:03
jmercouris
something I may do now, I may regret a year from now for completely unforseen circumstances
6:11:11
beach
Oh, and it is a bad idea to use #'bookmark-url in define-key. It is much better to use 'bookmark-url in case you want to redefine the function later.
6:11:17
jmercouris
I guess there is no way to prevent large scale refactoring, no matter how clever I might try to be
6:12:29
beach
jmercouris: I recommended you use CLIM, because a lot of the things you are doing already exist in better versions of CLIM. But you rejected that solution.
6:12:44
chenbin
https://pastebin.com/raw/3gAPvJQr ,please help sbcl on windows . I make sure the SBCL_HOME environment variable isn't set.
6:12:58
jmercouris
believe me, I would rather not be writing code for several platforms and reinventing GUI paradigms
6:13:14
beach
jmercouris: If, instead of re-inventing the wheel, you would work on a backend for McCLIM that would work for you, then everyone would benefit, and it would be less work for you in the end.
6:14:00
jmercouris
Even so, I don't see how it would be possible to take an existing webkit port and use it in a different context
6:14:40
jmercouris
Fair enough, I just want to make it clear, it is not because I don't want to, nor do I not see the advantages
6:17:51
jmercouris
fiddlerwoaroof_: I have a feeling that project may be more complicated than you imagine
6:18:08
beach
jmercouris: I think you are wrong about that. You are not alone. There are plenty of people here and in #clim to help you. And if everyone has your attitude, then nothing will ever be shared.
6:18:48
fiddlerwoaroof_
I have a demo app that loads a nib using only lisp code + a tiny bit of objc
6:18:51
jmercouris
beach: I wasn't talking about the port of mcclim, that wouldn't be too bad, I mean the objc-cffi project he is working on
6:20:09
jmercouris
why do you need to implement any cffi at all? are there not c bindings for the carbon framework?
6:20:28
beach
jmercouris: I see this very often here. People work on their own little thing, because they want it done as fast as possible. By doing that, they re-invent things that exist, and the invent things that could have been shared if done right, thereby cutting down the global development effort.
6:21:59
jmercouris
beach: Well, I think my project is a little unique :D I have also contributed a little bit to other projects, particularly to eql
6:23:35
jmercouris
maybe he'd be willing to give you some advice that could save you hundreds of hours
6:24:29
jackdaniel
I feel the urge to chip in in this discussion, but I have nothing interesting to say ;-)
6:26:16
jmercouris
fiddlerwoaroof_: here's a different question, why don't you just want to use CCL?
6:26:34
fiddlerwoaroof_
Because why do something in an implementation-dependent way if it can be done portably?
6:27:42
fiddlerwoaroof_
I'm interested, at least, in seeing how far I can get before abandoning this path.
6:30:01
jackdaniel
you forgot to add, that this another way doesn't met original requirement (of portability)
6:31:00
jackdaniel
it simply is (as far as I understand fiddlerwoaroof_), fact that you don't care about portability is fine by me, but doesn't make a compelling argument to discourage others
6:31:29
beach
jmercouris: Because this is freenode, and it is about free software that is preferable to share as much as possible.
6:31:31
jmercouris
let's not muddy the waters, you haven't actually provided an argument for portability other than "You don't care about portability, but others do"
6:32:14
jackdaniel
jmercouris: actually I didn't want to judge requirements which others put in front of themself. I've just pointed out, that your "easy" solution doesn't meet them
6:32:47
jackdaniel
and missing goals you put before yourself because something *may not* be easy is not very sound approach to solve problems
6:34:12
jackdaniel
good for you, still that misses the point. some people do hard stuff because they find it interesting (to them), not because they underestimate the effort involved
6:34:39
jmercouris
I don't remember saying "people do things that are hard because they underestimate the effort involved"
6:38:36
jmercouris
at any rate, whether x or y, doesn't matter, we have different opinions on the value of portability and the "WHY" but, as long as we are doing our own thing, is okay
6:39:51
beach
People are free to do what they want of course, but I find it sad to see that so many people do their "own thing" instead of trying to collaborate to decrease the global effort.
6:40:15
aeth
jmercouris: At the moment, it's best to try to get something to run on at least SBCL, CCL, and ECL. Why? Well, one reason is that all of the people who wrote code that only works on CLISP 10 years ago are in a bad position in 2018 even if CLISP was a reasonable choice in 2008. You never know which implementation(s) you want to use in 10 years.
6:40:22
jmercouris
this is a tragedy of the open source world, things like quicklisp help, but still
6:40:53
beach
jmercouris: And you think Quicklisp came about because Xach was doing his "own thing"?
6:45:00
jmercouris
but for 99% of users, they are ql:quickload some project and hitting the quicklisp servers
6:45:24
jackdaniel
fact that people trust quicklisp servers is a matter of authority not dictatorship
6:45:24
aeth
Quicklisp avoids about 90% of the problems that the JS world faces because it goes through Xach
6:46:02
jmercouris
if it was a community effort, you'd still have oversight, but something closer to an oligarchy perhaps
6:46:14
jackdaniel
of course it makes him a non-dictator :-) if beach suggests, that some code doesn't follow well-estabilished practice I'll think twice before I stick to this code passage
6:46:57
fouric
(quick minor question, not to distract from ongoing conversation: any suggestions as to where i can find information on hotpatching running CL programs? specifically, I know how to do it in Emacs+SLIME (because that's trivial), i'm more interested in learning how to do things like have the patched program "know" that a function was updated and then run code that updates the associated data structures, too...)
6:47:06
beach
jmercouris: I wasn't talking about access to servers at all. You completely missed the point. I'll drop it now. It's a futile discussion.
6:47:27
fouric
(where would i go about learning about that? i found *two* stack overflow posts, neither of which either have the information i'm looking for nor have links that point to the same)
6:47:47
aeth
jmercouris: Quicklisp would be a dictatorship if it came bundled with all implementations and was the only way to do things in that implementation imo. If Quicklisp was bad, people would use some other thing.
6:48:26
jackdaniel
hm, apparently word "authoritiy" is a false friend in English. In polish "autorytet" means "respect and credibility" (among other things)
6:48:27
jmercouris
aeth: I am not saying quicklisp is bad, nor that xach is a bad dictator, but it is a dictator project
6:49:56
jmercouris
at any rate, we can solve the worlds problems tomorrow, perhaps we can settle tabs vs spaces as well :D
6:50:18
jackdaniel
actually it's not a sign of pessimism but a sign of the fact that people value their time and don't want to spend it on something futile
6:55:02
jackdaniel
after reading into it word "authority" has three estabilished meanings where two of them match polish word
6:57:46
aeth
jackdaniel: jmercouris might have been referencing Python's BFDL. https://en.wikipedia.org/wiki/Benevolent_dictator_for_life
6:58:40
jackdaniel
I know, but it doesn't match well with Quicklisp architecture and the context of discussion
7:11:33
aeth
As far as what's best for the Lisp community, I think what drives people to languages are popular applications, engines, frameworks, libraries, etc. But you cannot control what becomes popular. So I don't think divided efforts are necessarily wasted efforts. Just make lots of very different things that are programmable in Lisp imo.
9:03:57
sigjuice
fiddlerwoaroof_ looks like madeira-port can be made unnecessary for linedit quite easily. https://github.com/LispLima/linedit/commit/c07816b8f29f6a54a13616d6bc71b46715618c42
9:11:56
beach
Question about error reporting in the compiler: A Cleavir-based compiler is meant to be used in several situations, to implement COMPILE, EVAL, and COMPILE-FILE, of course, but also for things like processing top-level forms in an editor so as to give more information to the user.
9:12:05
beach
Now, it seems to me that each such use of the compiler requires a different way of reporting errors. The file compiler might just give a warning, whereas EVAL might signal an error for the same situation. An editor much handle the signal and turn it into some kind of highlight of the buffer.
9:12:11
beach
So, it seems that the core of the compiler should not attempt to determine what the application is. As a result, I am thinking that the core of the compiler should always signal an error and propose one or more restarts. Each individual application can selectively convert the error to a warning and/or invoke a restart.
9:19:39
Shinmera
I'm wondering whether it would be useful to automatically create subclasses for each variant of error, and then allow the context to change-class the condition to the appropriate subclass. (Yes I know this forces conditions to be classes)
9:19:42
beach
Cleavir is also meant to be implementation customizable, so the core can't even make a decision between error, warning, style warning, etc. in all cases, because different implementations might want something different.
9:21:14
beach
I do need different types for each situation so that client code can selectively handle.
9:22:18
Shinmera
If you could just change-class to the appropriate variant, that would preserve identity and circumvent having to transfer the data
9:23:31
beach
It would. But it would only be moderately useful. Conditions are signaled in exceptional situations, so there is no performance problem with the transfer. Perhaps you see the use for preserving the identity, but I don't immediately see it.
9:23:52
Shinmera
The data transfer bit makes me iffy because it means a change in cleavir's condition definition means you need to update everywhere you transfer this data.
9:52:33
TMA
if the conditions are part of the interface (API) then a change to the conditions is a change to the API that the client has to deal with as it is the case with other API changes
9:55:24
Shinmera
If you implement it the way I illustrated, the amount of changes that need to be made is far less than if you forced transfering.
9:56:11
TMA
which can be easily done with one more level of indirection -- the changeable part would be in some other object that would be held in a nonspecific DATA slot -- with the transfer you can transfer the whole data object unchanged
11:10:11
phoe
Is there some variant of SUBSEQ that does not copy the data but creates displaced arrays instead?
11:56:35
schweers
Is there an easy, portable way to find out the values of C “constants” like O_TMPFILE?
12:00:02
shka
i should set it in the session, like this? (setf (session:field 'landing-page) (uri-to-url "dzienniczek/entry" :representation :external))
12:00:17
Shinmera
schweers: In general unless you're writing a C compiler entirely there is no way other than just running the C compiler on a sample program.
12:00:54
Shinmera
So the "portable" way is to emit a C program that prints the constant, call a C compiler, and run the resulting executable.
12:43:09
schweers
I’m trying my hands at it, but I just realized that my problem is not cffi-grovel, but is on the C side
12:43:45
schweers
I want to expose O_TMPFILE to lisp in order to open(2) temporary files. Yet I can’t get a C program to see the file, so my problem is not with cffi ;)
12:47:25
_death
"The O_DIRECT, O_NOATIME, O_PATH, and O_TMPFILE flags are Linux-specific. One must define _GNU_SOURCE to obtain their definitions."