libera/#commonlisp - IRC Chatlog
Search
11:20:30
prokhor_
is there a library to run edinburgh syntax prolog in a lisp program besides knowledgeworks?
11:29:03
contrapunctus
prokhor_: does cl-prolog2 do that? https://github.com/cl-model-languages/cl-prolog2
11:42:07
contrapunctus
Hm...docstrings in a `defmethod` with a `declare` expression, regardless of whether I place them before or after the `declare`, are being syntax highlighted by `lisp-mode` as regular strings. 🤔️
11:49:33
Nilby
contrapunctus: your lisp-mode probably isn't working then, since mine does it, but only when the docstring is before the declare.
11:52:52
contrapunctus
Nilby: hm, I just noticed the same thing. I think it's happening only for methods with a qualifier.
11:53:31
mfiano
That is correct. It's a limitation of how lisp-mode parses the arguments to defmethod.
11:54:41
mfiano
I would recommend attaching documentation strings away from the implementation. Documentation is for client code anyway, not developers.
11:59:38
mfiano
Well then, do as you please. I and some others feel that it is too noisy to be inlined into the implementation. It could, and usually should consist of several paragraphs, and vertical space is a resource related to reading code efficiently.
11:59:59
contrapunctus
mfiano: I don't usually put docstrings in methods, but in this case I was kind of losing track of which one was for what. Could be a sign of bad design ^^'
12:00:36
flip214
mfiano: well, my old-fashioned vim has something called folds... I can visually reduce several lines to a single one, I'd be very surprised if emacs didn't do that as well
12:05:19
lisp123
mfiano: That's sort of the point. I don't have a particular desire to jump across multiple files to understand a function
12:06:04
jackdaniel
contrapunctus: without taking sides - you can always put a comment before the method definition if you decide to avoid the docstring
12:07:16
mfiano
lisp123: Nobody said anything about files, and still, a keybinding to show the documentation string inline is quite easy with Emacs' virtual text facilities.
12:07:30
Nilby
When your repl or editor can display docstrings with a keystroke, as well as appropriate completions, it makes code very explorable.
12:09:08
lisp123
(although to play devil's advocate, placing docstrings elsewhere will not be precluded from this)
12:10:47
lisp123
If the text is in the same file, I have no problems. But otherwise, as many people do browse CL in plain text mode (e.g. on GitHub), it would be annoying to have to jump across multiple files to read a docstring
12:10:53
_death
in my opinion docstrings should be inline, short and sweet.. if you need more, well, often programmers tell others to "rtfm", but sometimes "wtfm" is appropriate
12:17:19
_death
it's also true that as jackdaniel hinted, method docstrings are (should be) rare.. it's conceivable that some newbies write docstrings for methods where they should be moving it to the generic function
12:18:12
lisp123
that's a mistake I used to make...although the format for defgeneric docstrings is a bit clunky
12:21:05
mfiano
Docstrings for methods are useful, for instance if you're writing a linear algebra library where all arithmetic generic functions have the same interface, but differ greatly in semantics (scalar multiplication is commutative for example)
12:23:53
_death
I think it's better to have different names for operators that are commutative and non-commutative
12:25:59
_death
math notation is actually a hodgepodge of notations full of hysterical raisins, basically terrible
12:28:22
_death
a generic function should specify semantics, and these should be adhered to by all methods.. if your multiplication GF does not mandate commutativity, that's fine.. but may lead to user errors
12:37:57
specbot
Examples of Associativity and Commutativity in Numeric Operations: http://www.lispworks.com/reference/HyperSpec/Body/12_aaaa.htm
12:57:02
utis
portaudio tells me ``warning: array is copied and/or coerced, lisp type is T, requested cffi type is float.'' does this sound like it could be fixed by the passing of a certain :element-type to #'make-array? i tried 'double-float without success
13:03:54
jackdaniel
perhaps try single-float, afaik double-float corresponds to cffi type double-float
13:14:07
utis
jackdaniel: maybe, i got the impression that portaudio wanted double, but i may have been confused; anyway, using single-float gives the same warning
13:14:47
Guest74
I write my documentation in separate files, but I believe they should be viewable when reading the code. I consider this more a convention to deal with a bad editor/or inability to use the editor properly.
13:33:18
_death
I was a bit flippant earlier.. math notations, like natural languages or programming languages, are terrible but also useful.. we're all being pragmatic.. the "because math does it" argument is a pet peeve, because these notations are often optimized for constraints (e.g., writing on paper, sometimes ad hoc use, communication with nonmachines, external requirements like established cultural/organizational pressure, etc.).. it's not a
13:33:19
_death
holy grail.. also, I like CL's generic operators, but then I've not written code that needs to be especially numerically accurate
13:45:33
_death
and then there's the fact that I may read 10 different papers on the same subject and have to figure out 11 different notations..
13:48:32
_death
in a particular subject I've noticed that papers from around 2000 onwards have noticeably different notations (that are more difficult to follow, currently) ... this may be an artifact of specialization, or explosion of students, or different software used to produce them, I don't know
13:50:58
_death
excellent.. combined with the attitude that if it's in parentheses it can be ignored :)
14:07:31
Guest74
I've often wondered how the layouting of math formulas should be implemented in lisp.
14:16:18
Guest74
but I mean layout of math for printing purposes, whether page or display, as math, not sexp.
14:43:32
dim
so, I have FATAL error: The value #(#S(SB-IMPL::EXTERNAL-FORMAT is not of type HASH-TABLE
14:43:49
dim
(more details at https://github.com/dimitri/pgloader/runs/7025602569?check_suite_focus=true#step:7:1281)
14:47:34
_death
dim: representation of sb-impl::*external-formats* changed about a year ago.. maybe something expects the old one
14:47:58
dim
yeah, what would be a lib that you can think of that needs an update and didn't see it in debian? ;-)
14:48:21
dim
I'm running through my list of build deps for pgloader, but I'm not finding it yet, and I don't have a principled way in mind to find it
14:48:44
dim
the short of debian CL libs is that they're not updated, only when pgloader build breaks...
14:49:12
dim
so let's forget about debian, what's a lib that you can think of that required an update after the SBCL change of external-formats internal structure?
14:51:21
dim
https://github.com/dimitri/pgloader/blob/3853c8996f4cc606f63f892868dfd0adeffb2a44/src/utils/charsets.lisp#L237
14:52:10
dim
any idea what's the proper way to loop through the sb-impl::*external-formats* nowadays? looked like just a list right?
14:55:18
_death
not sure there's a proper way in sbcl (other the list in the manual? heh); interestingly there may have been a list-all-external-formats in cmucl that got removed
14:59:34
dim
(loop for encoding across sb-impl::*external-formats* collect (slot-value encoding 'sb-impl::names))
15:01:44
_death
you could do something like that and risk breaking in the future.. or you could ask sbcl devs to properly expose it/hardcode a list
15:02:13
pjb
(map 'list (lambda (encoding) (slot-value encoding 'sb-impl::names)) sb-impl::*external-formats*)
15:04:28
Nilby
strangely the names of utf8 seems to be another external-format, and some names are null
15:09:50
dim
(loop for encoding across sb-impl::*external-formats* when encoding collect (typecase encoding (sb-impl::external-format (slot-value encoding 'sb-impl::names)) (list (slot-value (first encoding) 'sb-impl::names))))
15:26:05
mfiano
dim: You're using slot-value on a struct which is UB, though I guess you're also writing implementation-specific code with unexported symbols. I think you should raise this in #sbcl and maybe get some stable interface so you won't be surprised in the future.
15:26:45
dim
I had to edit that code once in about 10 years I believe, I can live with that honnestly
18:48:27
pjb
Josh_2: too bad he doesn't have a persistent nick, we will have to re-explain everything!
19:03:50
Guest74
pjb: all the guest nicks are persistent. Now if you explained anything to any guest accounts recently then maybe whatever is logging the channel is getting kicked as often as I am.
19:09:12
pjb
Perhaps with a real nick you wouldn't get kicked so often? Or at least, you could still be you.
19:10:09
Bike
you're not getting kicked. your client apparently sucks and is not responding to pings, so libera drops you.
19:19:29
Bike
the channel is being logged fine. pjb is merely referring to the inconvenience of your weird refusal to get an actual name.
19:22:08
Guest74
just cant be bothered when this thing remembers me perfectly. What's weird is how much it bothers some people.
19:23:01
Bike
i don't think it bothers anybody very much. it bothers many people a bit, in the same way that going through the effort to take thirty seconds to configure your client is too bothersome for you.
19:24:50
Bike
it's not a big deal or anything. just one of those weird little personal quirks that make talking to people online just a little more annoying for everyone.
19:25:56
Guest74
hey, i find it annoying that people don't use their real names as their nicks, but I don't go around complaining to everybody.
19:27:17
Guest74
sure, I'm named with a consistent identifier as well as peoples whose nicks have nothing to do with their names..
19:27:28
mfiano
I think they are just looking for attention. When we set +R during a flood they might reconsider.
19:28:32
yitzi
Guest74: When a plurality of the residents of this channel tell you that they find it irritating that you won't pick a nickname and you respond that you "just cant be bothered" that is a direct statement of how much you value their opinions/irritation.
19:29:37
Bike
because it would be so little effort on your part. easier than arguing about it, even. so your stated reason for refusal is just that you don't mind us being annoyed.
19:29:54
rotateq
and I see a nickname as a nice opportunity to express something about what drives one inside :)
19:30:04
Guest74
They want me to research and install a client, configure it, register a nick somewhere somehow, all so that they wont be bother by seeing the exact same consistent nick over and over again.
19:30:23
Bike
no, i want you to use your web client to pick a name. they pretty much all do that. web.libera.chat does.
19:31:04
Bike
because you entered it once and it stuck with that. if you entered something else it would stick with something else.
19:31:34
mfiano
It won't stick with that if you leave and the nick generator assigns that name to someone else.
19:31:39
Bike
it even lets you hook in your nickserv registration and you won't need to remember your password or anything.
19:31:39
Guest74
ffs, I'm really tired of the whole, oh you're so inconsiderate because you don't do things the way we do things and we'll judge you from that standpoint without even giving a thought to your point of view.
19:32:06
Bike
your point of view is that you don't care about our annoyance because you don't want to take thirty seconds to configure your client. i have considered your viewpoint and do not consider it worthwhile.
19:33:41
Bike
my least favorite part of being a moderator is when someone is a little bit of an asshole, but not enough that i feel justified in kicking them immediately.
19:35:36
mfiano
yitzi: The IRC server chooses a random guest name if one is not selected that is not already assigned.
19:38:30
yitzi
mfiano: Thanks. Seems a bit odd that the system permits reuse of the same handles. Probably b.c. the idea that someone would want to keep the same guest handle is bizarre.
19:38:31
Bike
oh, if you're asking whether i feel justified kicking guest74, still not really. they just ragequit, i guess.