freenode/#lisp - IRC Chatlog
Search
14:02:14
beach
didi: In combination with WITHOUT-ERRORS it can be used to write a very simple function for determining whether a list is a proper list.
14:05:05
didi
I'm yet to use an improper list. I can imagine there's an use case for circular lists, but for what would one use a dotted list?
14:05:46
pjb
didi: actually, once I had a case, were I didn't want NIL as the end of the list. IIRC, I had to distinguish two cases for the end of the list.
14:06:09
pjb
But otherwise, it's more often an error, indeed. Hence the use of ENDP and list-length.
14:06:47
pjb
notably, length may do an infinite loop on circular lists, so if you have them, better use list-length (or my list-lengths which gives more info).
14:16:58
jcowan
didi: my implementation of lazy sequences uses improper lists to represent an incompletely materialized sequence, with the generator function in the cdr of the last pair.
14:17:48
jcowan
you can cdr down the already realized values, and when you get to a pair whose cdr is nil then you are done, but if you get a function then you call it and add a new pair.
14:20:08
jcowan
See https://github.com/scheme-requests-for-implementation/srfi-127/blob/master/lseqs/lseqs-impl.scm (in Scheme, but should be readable to any Lisper), specifically the lseq-cdr procedure
14:25:15
jcowan
Scheme returns a dedicated "end-of-file object" when any input function reaches end of file (rather than raising a condition) and I use the same convention for generator functions.
18:02:10
anamorphic
Hmm how would I ensure a text file I write to always produces Unix-style line endings, even on Windows?
18:05:39
jcowan
anamorphic: https://bugs.launchpad.net/sbcl/+bug/310185 suggests that sbcl always writes LF only, even on Windows, though this may have been fixed and not recorded there
19:24:56
solene
hello, is it possible to use a pipe command like echo foo | wc using uiop:run-program?
19:54:13
mrblack
what would be a good lisp project (that is not too hard) for the Linux environment that would solve things lispers need?
19:59:32
aeth
solene: you might want launch-program instead because it has a :stream option for :input and :output (but it's harder to work with because it's async).
20:00:30
solene
aeth: I'm quite happy with run-program, I just wanted to use a list because it prevents errors in passing parameters
20:05:04
mrblack
solene, I had this idea of implementing some of the gnu coreutils because hackability... but I don't know if that makes sense.
20:05:43
aeth
(defun uiop-pipe () (let* ((echo (uiop:launch-program "echo foo" :input :stream :output :stream)) (echo-output (uiop:process-info-output echo)) (wc (uiop:launch-program "wc" :input echo-output :output :stream)) (wc-output (uiop:process-info-output wc))) (loop :for line := (read-line wc-output nil :eof) :until (eql line :eof) :do (write-line line))))
20:19:33
aeth
Even though launch-program is technically async, this sort of resyncs it and makes it basically the same as run-program. run-program doesn't have :stream for some reason, possibly because :stream could hang.
20:26:09
aeth
It looks like these are the potential errors: https://github.com/fare/asdf/blob/b6d2f9b44c047a5e65520692159cab7d3e9e072e/uiop/launch-program.lisp#L507-L532
21:18:36
gendl
but i'm seeing old code where it looks like they expected this kind of thing to work.
21:19:27
gendl
Is anyone familiar with the "metabang.bind" system? I'm looking at code in cl-markdown, which uses metabang.bind:bind, and it's doing this kind of thing and failing
21:21:47
gendl
it's doing (metabang.bind:bind (((a b c nil) (list 1 2 3 4)) ...) ... ) which I assume bubbles down into some kind of multipe-value-bind thing -- and it fails similarly as with mutiple-value-bind but with a slightly different error message.
21:27:26
phoe
"This seems to be what the standard mandates, so conforming code should not be affected."
21:29:31
gendl
Well SBCL is doing its job - non-conforming code should be shaken out of the ecosystem. And that's exactly what's happening right now.
21:30:02
gendl
i'm just not sure whether metabang.bind aims to smooth over this kind of thing or not
21:30:39
gendl
(the thing is, I know how to fix it in cl-markdown, but not in metabang.bind, so my only real option is the former)
21:30:56
phoe
I suggest you open an issue on metabang-bind asking them to clarify and define that behavior.
21:32:22
gendl
I'd like it to work for everyone, not just for my application (in this case the application is the clnet site generator)
21:32:51
phoe
gendl: I think the proper way to make it work for everyone is to ask BIND authors for clarification, and to do what they say.
21:33:18
gendl
I'm gonna do the following: 1. lodge a merge request against cl-markdown, which they can feel free to reject if they can fix it in metabang.bind instead (it happens to be the same author).
21:33:39
gendl
2. Make a local patch in my application with a flag to remove it if/when the issue is fixed in Quicklisp.
21:35:53
gendl
Bike: thanks for tracking down the change in sbcl which explains why it was working before.
21:47:36
montxero
phoe: lol if you mean actually looking in there, I already do that. I just figured there ought to be a way to do it without leaving a the repl
23:32:58
gendl
or better: `(directory (merge-pathnames "dists/quicklisp/installed/systems/" ql:*quicklisp-home*))`
0:54:26
gendl
I just spent 15 minutes wondering why files I had just committed were not showing up on my repository listing on the website
1:06:59
gendl
I've been thinking it would be a good idea to have all gitlab.common-lisp.net projects mirrored on github as well, since it seems a lot of statistics reporting assumes everything is just on github and only mines that for their stats.
1:08:09
aeth
Well, CL projects can be (and probably should be) at one of three locations, generally: github, gitlab.com, and gitlab.common-lisp.net
1:09:00
aeth
Probably best to mirror at all three, though, so you have an authoritative copy on them. Especially a github mirror.
1:09:31
aeth
gendl: If someone wants to make the argument that C/C++/Java/etc. is dead and JS is the new big language, they'll use Github stats.
1:10:31
gendl
aeth: In principle I agree with mirroring things around, but is there a danger of it causing confusion?
1:11:49
gendl
aeth: I agree with mirroring things around, but how to avoid confusion - e.g. what if someone sees a CL repo on github, but the active one is actually on gitlab, and they open a Pull Request etc.
1:13:00
gendl
i mean the active one is actually on gitlab.common-lisp.net... I mean, how to avoid a chaos of Issues, Pull Requests or Merge Requests on other mirrors
1:13:22
gendl
are they identified as mirrors, and point to the place where Issues and Pull Requests should go?
1:14:12
aeth
I'm not sure if there is a way to disable pull requests. I think you can disable the rest, e.g. issues/wiki/etc.
1:14:36
aeth
I don't think you can disable pull requests because... https://github.com/torvalds/linux/pulls
1:14:36
gendl
like right now I'm seeing this: https://github.com/gwkkwg/cl-markdown and this: https://gitlab.common-lisp.net/cl-markdown/cl-markdown
1:16:06
gendl
I just did a different Merge Request on the common-lisp.net one, and trying to figure out how to transfer the ancient github Pull Request over to the common-lisp.net one
1:17:29
gendl
By the way, this is jumping the gun a bit, but what kind of CL-specific services would people like to see from common-lisp.net?
1:18:13
gendl
I've been thinking that it would be nice if common-lisp.net could maintain a continuous integration thingie with several up-to-date CL implementations
1:18:59
gendl
such that projects hosted at gitlab.common-lisp.net could press a button and get a report of their build and/or test pipeline run through a bunch of CL implementations