freenode/#lisp - IRC Chatlog
Search
8:15:38
phoe
I am asking because I asked a question which style guide should be on top at https://www.reddit.com/r/lisp/comments/6nf3g4/ and currently the most upvoted comment is "none", which is troublesome.
8:20:46
beach
jack_rabbit: On the contrary, it is probably one of the languages with the most agreed-upon conventions.
8:22:02
phoe
Yes, that's exactly why the question about a style guide does not have a good answer up there.
8:22:44
phoe
I think so, yes, though there is an argument against it being on top in the link that I put up there.
8:22:56
jackdaniel
but it is true that people have their preferences and find constructs more convenient than others. For instance style guides like: "never use DO, use LOOP", "use structures over classes" (or vice versa), "don't use aux" etc. doesn't make good style guide, but I've found some remarks like that in some guides afair
8:23:37
beach
jack_rabbit: It does. The number of times that I have recited a large part of it to people who post code for us to read here is more than I would have preferred.
8:23:41
jackdaniel
on the other hand, some conventions about indent, variable naming *earmuffs*, +constants+ make a lot of sense and many people agree on them
8:25:34
jackdaniel
the most important style advice I've had (not CL-specific) is to follow conventions used in the project you contribute to
8:25:41
phoe
on the yet another hand there is a notion of <classes> that is not common, I have only seen it used in clack for example.
8:25:48
beach
jackdaniel: That's why in the SICL documentation, I split it into two parts, general guidelines and SICL-specific ones.
8:26:58
jackdaniel
phoe: this convention was stated in EuLisp standard draft. It is important for lisp-1, where functions, variables and classes share the same namespace
8:27:17
beach
phoe: I think it was invented by fukamachi, or rather, copied from Dylan, and then a few other Lispers adopted it, like eudoxia.
8:31:44
loke
I kinda like the <foo> convention, but I don't ahdere to it since no one else does. :-)
8:31:44
beach
EuLisp: Language definition process first began in a meeting in 1985 in Paris and took a long time. The complete specification and a first implementation (interpreted-only) was available in 1990.
8:32:28
loke
beach: I'm not entirely sure if you'r ebeing sarcastic, and if you are, which part you're being sarcastic about :-)
8:32:40
beach
I recommend the book and talks by Steven Pinker. He is not talking about programming languages, but the idea is the same.
8:33:36
beach
Pinker says that acceptable style is a matter of "tacit conventions" susceptible to slow evolution over time.
8:33:59
jackdaniel
For instance if nobody used *earmuffs* in '80s, and nobody would use them, because nobody uses them, we wouldn't have this visual aid for special variables
8:34:49
loke
I have a personal style which it comes to naming accessor methods though, which I stick to, but I'm not actually convinced is good. I don' thave a better one though... I name my accessors using the form CLASS/NAME, So bar slot in foo is named foo/bar.
8:34:54
beach
jackdaniel: It evolves SLOWLY as a result of SOME individuals OCCASIONALLY invent a new convention that MOST others find useful.
8:36:16
beach
loke: It has the problem that when you do that with the baz subclass of foo, you get (foo/bar baz) which looks very strange. Check for instance (clim:sheet-parent gadget).
8:36:28
jackdaniel
beach: given that there is no communication between every pair of programmers, and say fukamachi uses <class> - most of them find it useful yet nobody uses it, because nobody uses it. My point is - it's hard to determine synchronically that MOST others find it useful. So either it is adopted gradually (one-by-one), or not at all
8:38:28
loke
beach: Yes. I changed to a slash after I had too many annoying names where both the class name and slot names had minus signs in them, like user-manager-status-signature-type (just an invented name)
8:38:28
beach
jackdaniel: Yes, natural languages evolve despite the existence of a centralized mechanism.
8:39:44
loke
beach: Yes. I'm starting to agree with that. It's just that I haven't reached the point where I change yet.
8:41:17
beach
Structs probably typically didn't have as deep an inheritance graph as standard classes do, which is why it was less problematic for structs.
8:43:55
loke
Is there any rational reason to even have structs in CL (other than backwards compatibility?)
8:45:33
jackdaniel
I believe (that would require proper research to claim it though), that new words start with an individual who comes up with new word / construct, then with his closest circle of friends (internet speeds it up) - sometimes despised by others (i.e adults) as not clean language, and then it spreads further - gradually
8:45:36
beach
shka: You (and everyone else) can of course do whatever you want in your own code. The problems arise when unconventional code is submitted to others.
8:46:19
beach
jackdaniel: Pinker did the research. again, I recommend his writing and hist talks related to his book about style.
8:46:24
jackdaniel
sometimes it is that only the next generation uses the new word / construct, but with time it becomes part of the "official" and "agreed" language
8:47:55
jackdaniel
so it is withtout the centralized mechanism, yet it is not: most people find it useful, so they start to use it. It's just more and more people use it until it is acceptable
8:48:40
jackdaniel
if the circle of the individual friend wouldn't spread the new word, it wouldn't exist outside his own dictionary, hence language evolution would be stopped
8:50:11
shka
but at the very least it would be nice to point out one and say "this one does not totally suck"
9:38:33
axion
Well unless you are using use-package or the equivalent, all symbols will be prefixed by the package they are defined in, if it isn't current, and isn't a keyword, as far as I know.
9:41:55
axion
No, but you should most definitely be using it anyway. You could M-. to jump to the definition if you were, but I was giving a general approach
9:42:29
akr[m]
yeah, I tried jump to the definition, but emacs says that no handler could find it or something
9:43:41
axion
Then slime/sly are not installed properly. I would go back to the beginning and start there. Without it, you will be lost. Even seasoned Common Lisp developers rely on it greatly...it is a staple.
9:45:38
akr[m]
when I try to disassemble symbol on it, I get 'The function COMMON-LISP-USER::WITH-ASSOC-VALUES2 is undefined'
9:47:51
axion
That's because I already mentioned it is not a function, and why would you want to view the disassembly of it anyway?
9:48:26
akr[m]
not sure how slime is supposed to handle dependencies, this project doesn't use quicklisp, it just passes the path to dependencies as --asdf-tree to buildapp
9:51:02
axion
If you are new to Common Lisp as you say you are, your first step should be installing and configuring SLIME and Quicklisp. Second step is to read Practical Common Lisp. The only other way leads to the path of frustration
9:51:33
akr[m]
well, I've written a bit in some other lisps, I just find the package ecosystem confusing
9:53:52
akr[m]
I guess I wanna read http://www.gigamonkeys.com/book/programming-in-the-large-packages-and-symbols.html
9:54:46
axion
That book is very linear in nature. You should read it front to back and do all the practicals.
10:00:21
axion
I think you can decide whether or not you know how to manipulate cons cells well enough to skip one of the most important chapters and practical hands on experience.
10:05:05
axion
Then read that for now, but if you want to learn a language, set some time aside for it :)
12:33:12
clintm
Xach: if you have a free second at some point, I have a question re. amazon and request signing that, from looking at the irc logs, it looks like you have run in to as well.
12:36:18
clintm
Oh, no, your code is fine. It's my code that's throwing errors. I have a signed request url *that works in the scratchpad* but doesn't when I try to fetch it with drakma. I have sys locale set to utf8, content is charset=utf8, but I still get signaturedoesnotmatch errors.
12:37:55
Xach
Hmm, when that happens, I usually have to stare carefully at the "you signed"/"we signed" output
12:38:41
clintm
Ok, so there's not tribal knowledge with drakma and amazon requests that I'm missing then... as usual, the problem is me. hehe.
12:39:36
Xach
87% of the time it ends up being something silly for me, like missing a field or something.
12:41:31
clintm
That's what I thought, until I tested the signed url that I generated in their tool. I'll go get coffee, come back and stare at it, think really hard, and it'll probably come to me. Actually, it'll probably come to me when I stop thinking about it. That's how it usually works.
14:42:38
phoe
Suddenly, I don't write programs in Notepad and compile them with gcc. I can play with C interactively, from the REPL, instantiate structures, poke and peek memory locations.
15:04:20
pjb
dispersed: normal people cannot run C in their minds. They can only imagine they can run it, and they're wrong, wrong and wrong.
15:59:11
nosefouratyou_
phoe: the only way I've read about doing c interactively is http://nullprogram.com/blog/2014/12/23/ and cling
16:30:46
jurov
ACTION had eureka moment: what if running C in one's mind is the cause of its undefined behaviour?
18:01:29
nosefouratyou_
I have the following code https://gist.github.com/nosefouratyou/b7cb0cecab882478cc3c63c6a4374e4c and I have a bug
18:01:58
nosefouratyou_
(format t ":before completed for agent ~a and event ~a~%" a e) runs at the end of update :before, but I get an error before update is called
18:03:04
nosefouratyou_
the error is here https://gist.github.com/nosefouratyou/0327648eb08efb0d3817b050cad41564
18:08:15
beach
nosefouratyou_: Something else seems to be executing between the two. Something that allocates an instance of TRANSITION, passing the wrong initarg.
18:09:00
nosefouratyou_
beach: but how could something run between :before and the main method? I was under the impression it went :update method -> normal method -> :after method
18:10:10
beach
nosefouratyou_: If there are several :BEFORE methods, they all run before the primary method.
18:11:23
nosefouratyou_
beach: I know you are trying to help, and I appreciate that, but I am pretty dumb at cl at the moment. How would I inspect the value of #'update?
18:12:02
beach
You type #'UPDATE in the SLIME REPL and then you click with your right mouse button on the presentation that resulted.
18:18:46
beach
You should see a red presentation that says something like <standard-generic-function UPDATE>
18:19:44
nosefouratyou_
it's in a package, so I am doing (pat::update) and I get an error saying Too few arguments to call <STANDARD-GENERIC-FUNCTION PAT::UDPATE ...>
18:20:58
nosefouratyou_
this is the output https://gist.github.com/nosefouratyou/6a4b670982f3d61e254f4be4359a94ab
18:22:07
nosefouratyou_
this is what I see: https://gist.github.com/nosefouratyou/388d36b84970a56d049938198a8244d1
18:24:09
beach
Well, in your backtrace, a method is called, and it is this one: (#<STANDARD-METHOD PAT::UPDATE (PAT::FSMAGENT PAT::MARKETUPDATE)> #<PAT::TICKBARGENERATOR #x302001617F6D> #<PAT::PRC #x302001643CDD>)
18:24:47
beach
That method is calling SETFSM which calls make-instance, and that's where it goes wrong.
18:28:30
beach
I need to go spend time with my (admittedly small) family. Hope you find it with these additional hints.
18:40:21
beach
And one of the initialization arguments that it passes is invalid. It seems to be passing an object of type TRANSITION to make-instance.