libera/#commonlisp - IRC Chatlog
Search
21:53:57
danirukun[m]
I setup SLIME in Emacs, but for the life of me can't remember how to get autocomplete to work in Lisp buffers, which seems like something SLIME would just do out of the box.
21:59:53
danirukun[m]
JeromeLon: I see, but is it possible to also get it as an interactive dropdown with candidates at point, like it is in this one completion box package (can't remember the name)
22:17:36
random-nick
skeemer__: there are a bunch of different options parsing libraries https://cliki.net/command-line%20options%20parser
6:55:20
pjb
Common Lisp to JavaScript Compiler https://github.com/jscl-project/jscl https://cliki.net/JSCL
7:15:54
kagevf
hi, lisp123 ... I wrote a macro to define a simple class and another one to populate it: https://gist.github.com/johnhilts/3a48e03872b7946d5773335c4fe490ce
7:20:21
hayley
Could you do without the READ-FROM-STRING? It makes the list structure being generated harder to guess.
7:21:48
hayley
And what's the point of the extra list nesting in (car `((setf ,(car expression) ,(cadr expression))))?
7:23:16
hayley
`(setf (,(alexandria:format-symbol t "~A-~A" name slot) ,name) ,slot) seems to do the same thing.
7:25:24
kagevf
hayley: READ-FROM-STRING ... yeah, I guess I'm over-relying on strings ... I'll try to figure out how to refine it
7:26:10
kagevf
hayley: the extra listing ... I think I was having trouble templating the expression I wanted, so that's what I ended up with
7:38:52
beach
I mean, you wouldn't write (defun f (character) (car character)) or (defun g (list) (sin (cos list)))
7:41:11
kagevf
beach: do you think it would have been better if I had wrote (labels ((make-slot (name value) ... ?
7:47:55
hayley
Yes, I would suggest calling the symbols "slot names". Though, having seen DEFCLASS on SBCL take a DIRECT-SLOTS argument, I'm somehow desensitized to CLASS-SLOTS.
7:54:22
beach
"The :DIRECT-SLOTS argument is a list of canonicalized slot specifications". Not so great in my opinion.
7:59:57
scymtym
beach: variable (and parameter) names must balance multiple constraints: 1) uniqueness 2) reasonable conciseness 3) a description of the role of the variable in its context 4) a description of the value and probably more. i think you might be overemphasizing 4) over 3)
8:02:54
beach
Well, let me put it this way then. When I saw the parameter name SLOT, I immediately assumed it was a slot metaobject. Then when I saw (STRING SLOT) my mental model fell apart. And it is usually the case that I am not unique in any way, so it seems likely that other people will have the same reaction. So it is not doing the person reading the code a favor to write SLOT when the name of a slot is meant.
8:08:33
scymtym
beach: i agree in that case, but for :DIRECT-SLOTS, emphasizing the direct part, that is the role in the given context, instead of :SLOT-SPECIFIERS seems fair to me. going for both with something like :SLOT-SPECIFIERS-FOR-DIRECT-SLOTS or :SPECIFIERS-FOR-DIRECT-SLOTS is probably getting too long
8:09:40
beach
I would much prefer :SLOT-SPECIFIERS. Since you don't have specifiers for effective slots, it has to be for direct slots.
8:13:56
beach
In fact, they must have changed it for the standard, because the AMOP claims that the parameter for DEFCLASS is called DIRECT-SLOTS.
8:49:58
beach
Shinmera: I am continuing my reading of your article, if it is still useful: "This means that unlike" and "This leaves theprogram" are more examples where it is preferable (and I say "preferable" to avoid having some people interpret what I say as a rule) to have a demonstrative pronoun be followed by a noun phrase.
8:50:53
beach
"error, you can immediately" -> "error; you can immediately" or "error. You can immediately" .
8:53:56
lisp123
:) My english grammar is pretty bad, but I looking into the other day (unrelated to this topic). In relation to lisp, I chose to write (if (atom a) (list a) a) vs. (if (listp a) a (atom a)) for an expression that coerces an atom to a list
8:56:36
beach
The thing with demonstrative pronouns without noun phrases is that often the author has not thought about what it is referring to, and as a result, it often does not refer to anything at all.
8:56:37
lisp123
Hmm, I guess I need (if (listp a) a (list a)) --> Although (if (and (atom a) (not (null a))) (list a) a) IMO reads better
9:00:07
beach
Shinmera: My (admittedly small) family says that an adverb followed by a verb should not be connected with a hyphen, so "well designed" rather than "well-designed".
9:00:45
lisp123
Reason I was partial to (if (atom a..)) (before the case of NIL made it convoluted) was that it focused more on the operation --> IF ATOM, make it a list, otherwise keep it as-is" vs. When it is not a list, make it a list
9:01:38
lisp123
One could alternatively say "If a list, keep it as is, otherwise make it a list", but I felt the focal point of the expression was on the coercion from atom to list. This is all purely subjective thinking however
9:03:19
lisp123
One could argue (if (and (atom a) (not (null a))) (list a) a) is a clearer version, although its too long
9:05:16
beach
Shinmera: "only invoke the restart under special conditions" -> "invoke the restart only under special conditions". In writing, the first phrase reads "only INVOKE the restart [and not, say, REMOVE the restart] under special conditions" which is likely not what you want.
9:05:42
beach
In the spoken language, the distinction can be made with intonation. Not so easy in writing.
9:07:09
lisp123
beach: Do you have any good resources on technical writing? Your style is very good (similar to GLS in quality)
9:07:37
lisp123
I guess standard english grammar & style considerations apply, but wonder how you learnt it all
9:08:44
beach
lisp123: Not really. I learned it the hard way by having my texts scrutinized by my (admittedly small) family. She has a PhD in English and she was the only person to be promoted to "distinguished technical writer" at ILOG. That said, Pinker's book "The sense of style" is a good start.
9:10:51
lisp123
Thanks, well it definitely shows (esp. in your age old article on formatting rules for Lisp, which I read a year ago at the start of learning Lisp). I will check out that book
9:11:56
beach
lisp123: It is really a matter of common sense in combination with re-reading your own texts carefully. You want to make the text as unambiguous as possible, and you want to get the message across fast. In technical writing, I mean. Literature is different of course.
9:14:03
beach
Shinmera: "Using this extra information the programmer" -> "Using this extra information, the programmer". The first sentence looks like it would continue "Using this extra information the programmer provided..." which is not what you want.
9:15:02
beach
"which when set to ti its minimum will tell" -> "which, when set to ti its minimum, will tell"
9:15:04
john-a-carroll
Regarding "well-designed", as a native English speaker I think the phrase "well-designed recovery points" is fine. "well-designed" is being used as an adjective, modifying "points" which is a noun
9:16:03
lisp123
(This article was the one I was referring to, its a classic: https://dept-info.labri.fr/~strandh/Teaching/PFS/Common/Strandh-Tutorial/indentation.html)
9:17:04
beach
john-a-carroll: The point of the exercise here is to avoid annoying referees. I know this paper doesn't have that aspect to worry about, but I am giving general advice. And if there are groups of people that get annoyed by a hyphen between an adverb and the verb, then it is best to avoid it.
9:18:32
beach
john-a-carroll: If you want to run the risk of annoying your referees by keeping the hyphen that you prefer, that decision is of course up to you.
9:19:14
beach
john-a-carroll: I know when I am a referee, and the grammar is really bad, I can't concentrate on the contents, and that makes me really annoyed.
9:20:05
beach
And the reason I am giving the advice here, as opposed to by email, is that I think many #commonlisp participants could benefit from it.
9:20:59
john-a-carroll
I absolutely agree that idiomatic and precise writing is important - not just for the referee, but so that the eventual reader does not get confused. I'm an academic, and I've been saying this to my students all my professional life
9:23:22
beach
Shinmera: "When focusing on the SBCL implementation, there are" is a dangling participle.