libera/commonlisp - IRC Chatlog
Search
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.
9:24:47
beach
"These techniques mostly focus on type dispatch.." -> "These techniques focus mostly on type dispatch.."
9:32:20
beach
Shinmera: The traditional grammar says that if you "replace A by B", you "substitute B for A", But not "substitute A by B".
9:35:28
loke
"Substitute A with B" make sense. People using "for" sometimes implies it backwards, which is very difficult to parse.
9:36:53
beach
Use "replace A by B" or "replace A with B" if you are worried about people not being able to parse the other one.
9:38:54
beach
Shinmera: "advantages and challenges present when working in a ..." is a dangling participle.
9:40:00
beach
Shinmera: Done. I think the paper is good, especially for the kind of audience you are targeting. Will you get to present it in person? That should be a good thing.
9:47:30
Shinmera
beach: Yes, it'll be an in-person 20 minute talk at the Game Industry Conference in Poland next week.
9:47:42
jackdaniel
it must be that he is the handsome and attractive person according to the last section :)
9:49:58
Shinmera
Unfortunately I seem to have fallen ill with something, so I'm trying to recover today
9:55:04
loke[m]
<beach> "Right, but that's no reason to..." <- I'm not annoying them at all. I'm saying that one makes sense.
9:55:19
loke[m]
It's the "for" that has the potential to be confusing. I certainly can never get it right.
10:09:28
_death
you can look at the argument order for SUBSTITUTE (new for old) and REPLACE (old with new)..
10:27:11
_death
CL operators often follow this "natural English" convention, sometimes leading to inconsistency
10:28:36
antoszka
yeah, it's also a matter of reusing some then-popular names from then-mainstream Lisps whose legacy went into the ANSI standard
10:53:39
Shinmera
so this isn't a nonsequitur, I was on a podcast that talked about indie team building. It's off-topic here, but if you want to have a listen: https://www.rengenmarketing.com/podcast/how-indie-devs-can-nail-effective-team-building-with-nicolas-hafner-indie-game-movement-ep-261-show-notes/
12:03:22
pjb
The importance of comma cannot be stressed too much: "Let's eat Grandma." vs. "Let's eat, Granma."