freenode/lisp - IRC Chatlog
Search
5:36:59
kagevf
I tried to do touch ./new-directory/new-sub-directory/new-directory but bash complained because the parent directories didn't exist, so I just wrapped ensure-directories-exist in a very tiny app with sb-ext:save-lisp-and-die since it did what I wanted ...
5:39:39
Nilby
Or just have a list of your patched dependencies and re-create the fork directory from github, then have it populate local-projects.
5:40:21
lukego
splittist: I think so and what I'd need is a script that syncs it from quicklisp so that it doesn't go stale
5:43:37
lukego
Nilby: sounds messy for me, going to bite me if I want to e.g. hook up a CI that tests the same code as I'm developing, etc.
5:53:49
White_Flame
I always end up M-.'ing into QL dependencies to tweak stuff and then stare at it wondering what to do with that :-P
6:23:29
lukego
splittist: Yeah PRs are a whole other dimension. In the olden days of patch files you could manage your sources any way you wanted but nowadays you really need to maintain a whole github repo to participate in code sharing
6:26:23
lukego
borodust also does a quicklisp distro for the gaming stuff and that seems to work well
6:32:06
easye
What would be the mimimal-non-CL dependencies way of styling org files under Hunchentoot?
6:37:57
easye
ACTION wonders about executing elisp in semi-portable ANSI CL for the second time this week.
6:57:42
kagevf
saturn2: I know about mkdir -p, but I have a list of file names from which I want to generate the directories ... if I use mkdir -p, it will turn the entire file path into a directory ... if I try to turn that into a file bash displays an error
6:58:44
kagevf
if I do mkdir -p directory/filename.txt even filename.txt becomes a directory, and I can't do echo "abc123" > directory/filename.txt
7:00:02
kagevf
maybe I could have done something with awk, but just wrapping ensure-directories-exist into a mini-app was faster
8:02:22
loke[m]
Sorry, I didn't notice that I'm on an IRC-backed channel. This must have looked horrible in an IRC client.
8:05:18
Nilby
ACTION doesn't like unix, which makes crazytown more crazy (let ((file "~/tmp/gralt/baz/moo.txt")) (!= "mkdir" "-p" (nos:dirname file)) (! "echo foo > " file))
8:05:46
nij
Did anyone (intend to) annotate CLHS and make it more friendly, say, with more examples?
8:08:53
beach
nij: The Common Lisp HyperSpec can not be annotated as is. It has a very restrictive copyright.
8:11:22
beach
I may not be remembering this right, but I think the ANSI standards document can not be legally copied, but the dpANS can. And I think the Common Lisp HyperSpec was created from the dpANS. However, the HTML markup is also protected by copyright. I may be wrong, and ANSI may have given permission to LispWorks to create the Common Lisp HyperSpec from the standards document.
8:12:58
beach
nij: I think the right solution is to create a new document from dpANS, and I am pretty sure that is what phoe did.
8:13:33
beach
What we do need is a version of the dpANS in the form of one single LaTeX document, rather than as one TeX document per chapter.
8:13:49
TMA
it depends on the jurisdiction of the birth/citizenship/residence/death of the creator at the time of the work being first published, of the publisher if posthumously and it is generally at least 70 years after the event, even 100 in some cases
8:18:31
Nilby
If I didn't dislike both HTML and TeX so much I would try to do it. I've been fixing a a texinfo copy for years and it's still messed up.
8:30:39
beach
Again, I think the best thing to do would be to create a single LaTeX document (with multiple files obviously) from the per-chapter TeX files of the dpANS.
8:31:21
beach
Then we could use it for the Common Lisp UltraSpec, but also as a basis for a Common Lisp reference manual, and for the WSCL specification.
8:35:02
scymtym
beach: is there more information on this idea of reformatting the dpANS sources anywhere? like previous attempts, necessary steps, expected outcome, etc?
8:36:29
beach
Nilby: If it is correctly structured, it could be parsed. But that's not the case for the dpANS.
8:37:14
beach
Nilby: The dpANS is pure TeX with lots of custom macros, many of which are for aesthetic purposes only.
8:37:43
beach
Nilby: I totally agree, but that's just making the task even more complicated up front.
8:38:50
scymtym
beach: i see. i meant information that would be useful for making another attempt. that would also include how to get the sources and an explanation of the legal situation, i guess
8:39:59
beach
scymtym: I remember it was tricky to find the sources. But I have them, so in the worst case, I can make them available.
8:41:42
theothornhill
beach: But if it's mostly hindered by the hassle of manually doing things, more hands would surely help?
8:42:10
scymtym
i think making the sources available along with a little explanation of the situation would make the project more approachable if that makes sense
8:43:14
beach
I was aiming for LaTeX to avoid having to translate all the macros, and so that we could use cross references, bibliography references, etc.
8:45:19
beach
I wish gilberth were here. He is the expert in recycling stuff like this. He created the "annotatable" CLIM spec from the LaTeX source.
8:45:52
scymtym
beach: not sure. people chipping away at the problem in private and a coordinated effort don't seem to be mutually exclusive since
8:46:04
theothornhill
phoe: Is your effort available somewhere? If not, could you make it available? Otherwise I can try to set up something
8:46:32
scymtym
beach: yeah, seeing the CLIM spec "parser", i wondered how different the CLHS and CLIM are in that regard
8:46:43
Nilby
Profusion of macros seems like what you get when you have super-lisp-hackers writing in TeX.
8:47:56
Duuqnd
It would be nice if there was a free software clone of Symbolics Concordia and the document examiner. Not sure if it would be at all useful for this though.
8:51:57
Nilby
Concordia was resting on quite a highly evolved stack of things that I don't think we have free versions of yet.
8:52:32
Duuqnd
Concordia itself can't be salvaged, I was more thinking something like a clone written on CLIM or something.
8:54:18
beach
Duuqnd: I think jackdaniel is working on some kind of CLIM-based documentation system.
8:57:11
beach
I honestly think the best action would be for each person to take a section or a chapter, whipping up the PDF of the standards document, and then copy-paste from dpANS into a LaTeX document or some other kind of document.
8:59:00
loke[m]
beach: I believe any transformation of the spec should be made into some kind of machine-readable form. LaTeX is fine, as long as the content is parseable without LaTeX itself. Storing the information in sexp form would be ideal.
8:59:42
phoe
but I'll need to restart this from scratch someday because my methodology sucked at the time
9:00:08
phoe
if I ever restart CLUS, I'll want to do it in a reproducible way that starts with dpANS sources and mechanically and reproducibly converts them into whatever format is required
9:00:40
phoe
the most important is *reproducible* because the standard really needs to be copied verbatim, as all holy scriptures must be
9:00:44
beach
loke[m]: But then we have the eternal problem of choosing a format. We never seem to be able to agree upon such a thing.
9:01:17
beach
loke[m]: The reason is simple. There are so many formats to choose from, each one is going to have only a small minority of proponents.
9:01:21
loke[m]
If it's in some sexp form, transforming it to HTML, LaTeX, org-mode or whatever would be trivial.
9:02:22
loke[m]
Well, the details doesn't matter. It could be something like '("Some text " (:bold "bold text here"))
9:02:56
loke[m]
I dunno, point is that I don't think most people would complain, since it's not any specific format, and every proponent of some other format knows they can easily convert it to their favourite style.
9:03:32
beach
loke[m]: But if we need to collaborate on this effort, then we can't have each person choose a different format.
9:03:47
no-defun-allowed
Frob it, just make the format #<CLHS {12345678}> - no one will know what it is without a nice print-object method and thus no one can complain.
9:04:22
loke[m]
True. But you'll have the dictator choose the base sexp format. My example above is what I use for my transformed version of the Maxima documentation, and it works fine.
9:05:01
loke[m]
I have written a documentation browser as part of Climaxima that displays the content in a much nicer way than the official HTML docs, and has better search, so I think it's a success.
9:06:16
Nilby
The trouble is, we can see how well separation of semantics from presentaion is going for the web.
9:06:36
loke[m]
I was working on an automatic converter for the dpand documents that created precisely this.
9:07:10
loke[m]
Nilby: My apologies for making assumptions, but did you take a look at the dpans source? It already contains that information directly in the LaTeX source.
9:09:02
Nilby
loke[m]: Yes, and I know they did a pretty good job with TeX, but it's certainly not perfect, and they we're exactly focusing on the hyperspec aspects.
9:11:08
Nilby
TMA: Thanks. I think I started with one from GCL, but Xach's is probably in better shape.
9:13:28
no-defun-allowed
If you can stomach him, sure why not, but that's not my cup of tea. I dunno.
9:15:41
no-defun-allowed
For one not borderline "political" example, his two hundred (thousand?) year languages are very terse, but I write verbose code, because that is what I can read.
9:16:06
splittist
ACTION would be wary of anything funded, as funding implies official, and constitutional conventions are unpredictable see e.g. French revolution, Russian revolution etc. (:
9:20:28
beach
nij: Like I said, the Common Lisp HyperSpec was created either from the dpANS or perhaps from the standards document with special permission. I forget who did it. Maybe Kent Pitman?
9:21:59
no-defun-allowed
What I would do is start a venture commune to get common property for any CL work. This has the pleasant side effect of competing with PG.
9:24:06
beach
nij: Not at all, it was derived from the standardization documents. And those documents took dozens of people to create.
9:24:41
beach
nij: But, if you followed the discussion the dpANS is in a format that is not easy to exploit.
9:26:05
beach
theothornhill: I am not going to attempt to answer that, because, like I said, any particular format would be defended by only a small minority of us.
9:26:50
beach
theothornhill: And, as I often say, I would like for the entire thing to be encoded as standard objects, with a well defined protocol.
9:27:23
beach
That way, we can't possibly disagree on some surface syntax, because the surface syntax would not be what defines the format.
9:27:43
theothornhill
beach: yeah, but now it looks pretty gnarly, so maybe converting it to a cleaner (as in human readable) format first could be a smart first step?
9:30:18
Nilby
I also agree with phoe, that it would be good for it to be reproducible to go rom dpANS to an object encoding.
9:35:04
beach
contrapunctus: Thanks for reminding me. Then CommonDoc might be the best recommendation. Let me see how it can be used.
9:36:11
splittist
The problem is that documents (for human consumption) are not trees. At least, not at any reasonable level of abstraction.
9:37:17
beach
splittist: That's why I would like to see documentation split into (say) "chunks" where each "chunk" has a unique label and can be inserted into documents in different ways.
9:38:26
contrapunctus
splittist: reeeeaaally? o.O HTML, XML, and anything that targets them like Org, Markdown, etc, as well as XML schemas like ODF...aren't they all trees?
9:39:01
Nilby
I don't know specificlly about CommonDoc, but an object representation is really a graph, and can have circularity, etc.
9:43:12
splittist
headers, footers, footnotes, endnotes, call-outs, tables, pictures; sections of text that don't map to textual content, but to its presentation; annotations that span units of text; styles that do - or don't - compose.
9:44:45
splittist
title pages, front matter, colophons, appendices, schedules, annexes, indexes, tables of contents, tables of authorities, bibliographies, watermarks, borders for paragraphs, borders for pages, ...
9:45:14
nij
So instead of @begin(enum) @item(This is the first item) @item(And this the second) @end(enum), we can just write
9:45:47
beach
nij: Because, again, the main idea is to have the internal CLOS protocol be the main definition of the format. Not the surface syntax.
9:51:50
splittist
CommonDoc seems to be basically the markdown subset of html with nestable sections
9:56:26
TMA
nij: I have had success with running: for i in chap-{1..26}.tex chap-a.tex ; do pdftex $i ; done
9:57:43
TMA
nij: chap-0 contains table of contents, index, list of figures and also some problems that prevent it from finishing pdftex chap-0 successfully without modification
10:02:17
TMA
for the table of contents: replace ".tc" with ".toc" in chap-0.tex ; for the index: run: sort -t: -k2 chap-*.idx > index.idx
10:03:28
White_Flame
nij: CLHS added formatting & links to what might have been plain text in the tex
10:04:14
edgar-rft
nij: the code examples in the CLHS and the "issues" pages were added by Kent Pitman, they are not part of the dPANS Tex version.
10:09:25
Duuqnd
The \input stuff there reminds me a bit of how in Concordia most records were just links to other records. (screenshot for reference: https://i.imgur.com/J9ZWbrC.png)
10:10:24
Nilby
nij: TeX is hard to convert by anything that isn't TeX or TeX-based. PDF and DVI are pre-rendered formats that lose much of semantic content. And all of those formats are designed to be smushed onto dead trees, not clicky-pixels.
10:11:20
Nilby
Of course one of the cool things about Concordia is it's kind of a Zmacs mode and have live objects in it.
10:12:45
Duuqnd
I should probably stop playing around with it because it's making me dislike Unix-likes and Windows more than I already did.
10:19:06
pjb
dieggsy: have a look at: (com.informatimago.tools.manifest:distribution) https://github.com/informatimago/lisp/blob/master/tools/manifest.lisp#L144 ; of course, totally ad-hoc.
10:20:37
Duuqnd
Being able to click on an example and having it run is also pretty neat: https://i.imgur.com/h1pAQI1.png
10:25:47
pjb
nij: I guess PG doesn't fund Common Lisp, because he wasn't billionaires after selling viaweb. So instead he founded Y-combinator VC to fund startups to make him eventually a billionaire. Note that if you can pitch a good startup with y-combinator (and use Common Lisp to implement it), then PG would fund CL, indirectly.
10:27:08
pjb
nij: oh, you meant a standization process? But once your startup will have made it, you will be able to do that yourself, which would be logical, since you will have used CL to build your products!
10:27:49
pjb
PG sold viaweb to yahoo! who hurried to rewrite it in C++… So there's some lost interst in CL there.
10:32:57
Nilby
I think foundational Lisp is thing that's above the normal economy, like other technologies say, e.g. GPS, you can't just throw money to make it happen, and it doesn't produce profit directly, but it's super useful and enables whole classes of other profitable endeavors.
10:35:28
no-defun-allowed
It does not transcend reality. No other programming languages make money on their own, other than creating a net loss for everyone dumb enough to use some.
11:24:51
daphnis
to remove the end of a string, is there something more straightforward than (subseq str 0 (1- (length str))) ?
11:27:38
Nilby
That's pretty strightforward, but if you know it was specific characters you could use trim.
12:22:14
pjb
daphnis: if you took the precaution of storing your string in a vector with a fill-pointer: (decf (fill-pointer str))
12:23:56
pjb
(let ((str (make-array 32 :element-type 'character :fill-pointer t)) (src "Hello World")) (replace str src) (setf (fill-pointer str) (length src)) (print str) (decf (fill-pointer str)) str) #| "Hello World" --> "Hello Worl" |#
12:24:54
pjb
daphnis: now, if your string is a tad long, you may want to avoid copying it: (let ((str "Hello World")) (make-array (1- (length str)) :displaced-to str)) #| --> "Hello Worl" |#
12:25:45
pjb
https://github.com/informatimago/lisp/blob/master/common-lisp/cesarum/utility.lisp#L1778
12:27:01
pjb
daphnis: note, for most strings (length < 24 or 32), subseq will be more efficient, on 64-bit hardware.
12:56:13
beach
AHA! The handle of Fernando Borretti is eudoxia, who apparently was here last around 5 years ago.
13:39:46
pjb
dieggsy: note that: (or) #| --> nil |# So it serves two purposes; 1- protection in case we miss a case; 2- ease of editing the bunch of #+ in a single form.
13:40:17
pjb
dieggsy: with paredit, you can easily manipulate list sexps, so sometimes adding a PROGN, AND or OR can help editing.
13:41:06
dieggsy
i was just talking about how i gave up parens editing frameworks in favor of manual editing because they all felt like they got in my way lol
13:42:10
pjb
Oh, and in the case #+(or unix) it's entirely useless, probably a left over from copy-pasting; but also a hint that we'd like to get a future feature to or unix with for nextstep. note that OpenStep worked on unices (sunos and hp/ux), Mach-OS, and Windows-NT.
13:42:55
dieggsy
pjb: i think part of the fuss is i'm also using evil-mode and none of them quite click with that, you have to use some kind of sub-par adapter package
14:33:59
pyc
While typing code into a .lisp file, is there a way to autocomplete known symbols? For example, form<key-sequence> should autocomplete it to format. Is it available? I tried <tab> but it does not seem to autcomplete. I have SLIME running in Emacs.
14:39:42
beach
pyc: I almost never use the Meta key, so I would have to type C-[ C-i instead, and the [ and the i are on the same hand, so slower to type.
14:41:39
jfb4
ok but you can remap in a line super-meta-control the way of the Lisp machine keyboards
14:42:12
splittist
It is useful if you are using a terminal in a browser that eats lots of M-... chords
14:44:19
pyc
(sort '("foo" "bar" "baz" "qux") 'string-lessp) or (sort '("foo" "bar" "baz" "qux") #'string-lessp)? Does it matter if I use 'string-lessp or #'string-lessp? Is one better style than the other?
14:45:27
pyc
beach: Would you please elaborate the reason behind your recommendation? Trying to understand why one is better than the other.
14:45:46
beach
SORT will then be called with a function object, so no further indirection needs to be resolved, whereas if you call it with a symbol, some kind of lookup is required.
14:47:00
beach
I occasionally use a symbol for the :DISPLAY-FUNCTION pane option in CLIM, so that when the function is redefined, I don't have to re-evaluate my DEFINE-APPLICATION-FRAME form.
14:47:31
edgar-rft
pyc: 'string-lessp doesn't work with FLETs or LABELs, it will *always* use the global function even if a lexical local function exists
14:48:18
beach
pyc: The former. It is a way to take a value in the function namespace and turn it into a value in the variable namespace.
14:52:05
pyc
(sort (directory "*.txt") #'string-lessp) ; This fails with: The value #P"/Users/pyc/learning/a.txt" is not of type (OR (VECTOR CHARACTER) BASE-STRING SYMBOL CHARACTER) when binding SB-IMPL:STRING1. I understand the error. I am passing a list of pathnames to sort but using a predicate meant for string. What is the right way to solve this problem?
14:54:07
pyc
Bike: In my case, I will get the same result whether I sort by entire pathname or only by the filename because all my pathnames would start with #P"/Users/pyc/learning/" I am looking for files in a single directory only.
14:57:54
pyc
(sort (directory "*.txt") #'string-lessp :key #'namestring) ; This worked fine. Really enjoyed learning about this. The CLHS document also describes the sort arguments very nicely. Thank you all for your help.
15:46:00
pjb
pyc: (sort '("foo" "bar" "baz" "qux") 'string-lessp) cannot work, because SORT is destructive, and '("foo" "bar" "baz" "qux") is immutable.
15:46:41
pjb
pyc: try: (sort (copy-list '("foo" "bar" "baz" "qux")) 'string-lessp) #| --> ("bar" "baz" "foo" "qux") |#
15:53:34
pyc
pjb: With SBCL, (sort '("foo" "bar" "baz" "qux") 'string-lessp) returns me ("bar" "baz" "foo" "qux"). Seems to do the right thing.
15:54:06
pyc
pjb: but you are right, CLHS spec says sort is destructive. so is my code undefined behavior?
15:58:48
dieggsy
pyc: it *is* destructive though, it's modifying the actual list. if you store it in a variable, you can see the original list order is changed
16:03:29
pjb
dieggsy: (let ((list '("foo" "bar" "baz" "qux"))) (print (sort list 'string-lessp)) list) #| ("bar" "baz" "foo" "qux") --> ("foo" "qux") |# does it really work?
16:04:43
dieggsy
pjb: it warns "Destructive function SORT called on constant data: ("foo" "bar" "baz" "qux")" but it does work
16:06:31
pjb
http://catb.org/jargon/html/N/nasal-demons.html http://3.bp.blogspot.com/-4f7bw2esn8w/Ut159zC3X4I/AAAAAAAAENQ/bhy3LecsfBQ/s1600/26831_1419257239999_7976058_n.jpg
16:07:10
kiwichap
I was interested in making a website or developing computer equipment and was told that LISP is the best for that
16:07:59
pjb
kiwichap: well, at least one guy earned 8-digits selling a web program written in Common Lisp, so it's possible.
16:08:31
beach
kiwichap: Yeah, well, sort of. For one thing, we haven't written in LISP for decades, so if you use LISP, we think you are using decades-old dialects.
16:08:52
beach
kiwichap: Furthermore, this channel is dedicated to Common Lisp, which is probably fine for what you want.
16:09:25
beach
kiwichap: Then, Common Lisp is the best choice for lots of stuff, you websites would represent no exception. :)
16:11:18
beach
kiwichap: When you use a Common Lisp system, you work more inside the system itself than in the host operating system, so you won't notice much difference.
16:11:23
kiwichap
ok sounds good, I am using FreeBSD, Debian and Open Suse for my websites at the moment
16:14:22
dieggsy
BSDs are excellent for servers. for daily use, much worse hardware support than Linux IME
16:16:04
dieggsy
dunno if i'd call it practical for productive use, but if you have the time, absolutely. contribute them upstream, even
16:16:32
kagevf
loke[m]: thank you - I didn't know about dirname ... yes, that would have done what I wanted ...
16:16:32
pjb
kiwichap: a lot of lisper use macOS to write lisp code on (even if deploying on MS-Windows or Linux).
16:17:49
dieggsy
is there anything that makes macOS better fit for lisp nowadays or is it just... historical vestiges kind o f
16:18:28
jackdaniel
I can't say much about osx, but I'm sure that historical vestiges play a role in some lispers preferring macos over linux
16:19:22
jackdaniel
also osx application market is bigger than linux's (if you want to sell software)
16:20:01
dieggsy
i mean surer, but that's getting at preferring macos over linux in general as opposed to for lisp specifically
16:20:48
pjb
dieggsy: I don't know, but there are some pictures of lisp conference assistance where there's about 90% mac laptops vs 10% PC laptops which probably run 90% Linux and 10% Windows.
16:21:02
jackdaniel
dieggsy: if some person prefers macos over linux and they happen to be a lisper, what do you think they will prefer for lisp?
16:21:16
Josh_2
Is there a library that makes storing data in files easier? Basically I'm thinking something like subclass of one class would store in one directory, subclasses of that in a directory inside of that. Not sure
16:21:50
dieggsy
jackdaniel: my question was, is there a particular reason to prefer macos over linux *for lisp*
16:21:53
jackdaniel
either way this drifts toward offtopic, so as a moderator I feel obligued to moderate you :)
16:22:28
kiwichap
thank you , sorry, I am tempted for a mac for IoS development and was interesting to realize Internet of Service
16:22:46
pjb
dieggsy: the only thing you have on macOS you don't have on Linux, is Clozure CL.app with a nice Hemlock editor, if you don't want to use emacs/slime.
16:23:04
pjb
dieggsy: on Linux you can run a PortableHemlock with a X11 backend, but it's not as nice.
16:23:42
jackdaniel
kiwichap: this channel is known for strict on-topicness rules, discussing other topic unrelated to common lisp is allowed on #lispcafe
16:24:22
pjb
the keyboard is more responsive on Linux\X11 than on macOS (and on Windows it's horrible).
16:24:44
pjb
and you've got more keys and modifiers in X11 than in macOS, which is nice for lisp or emacs.
16:33:10
dieggsy
Josh_2: they kinda suck to work with, but they can be mighty fast compared to other storage methods.
16:33:31
dieggsy
kiwichap: some people here swear by it, others dislike it, i don't have enough info
16:34:44
dieggsy
Josh_2: you're not wrong, but then you get into things like disk space and compression i suppose. TBH i'm no expert on the subject