freenode/#lisp - IRC Chatlog
Search
4:13:46
minion
shka_, memo from jasom: an interesting data-structure (though not necessarily of practical use over 2,4 or red-black trees) is discussed here: http://user.it.uu.se/~arnea/abs/gb.html
4:58:46
beach
jmercouris: There are tons of small problems with the code. Do you want remarks about those as well? I find it extremely hard to understand the meaning of some code when I am distracted by the superficial problems.
4:59:20
beach
jmercouris: Also, perhaps you should expose your code here so that other people have a chance to give you feedback as well.
5:02:36
beach
jmercouris: And, do you have any specification for what you are doing? You haven't even told me what the software is supposed to do.
5:13:56
jmercouris
beach: The specification is kind of outlined here: https://github.com/nEXT-Browser/nEXT/tree/master/next#release-timeline
5:14:27
jmercouris
Also, it's less of a specification, and more just like a list of features, the quick jist is an "emacs" browser
5:15:08
jmercouris
beach: Yeah, I'm sure I saw it, but I didn't quite apply it so well, is there an automatic way of linting or do I just have to know them all?
5:16:22
jmercouris
also, are you referring to the following style guide?: https://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf
5:16:53
jmercouris
beach: Sorry for my omission, I had just assumed you already knew for some reason :\
5:19:14
jmercouris
Right, I kind of see the order of specificity here, I know I violate the if one frequently
5:21:51
beach
The compiler accepts any grammatical expression. The reader of your code only wants idiomatic expressions, and those are a small subset of the grammatical ones.
5:22:21
beach
I write (unless (null children) ...) because then (null children) checks whether the list is the empty list, and unless is given a Boolean value.
5:23:26
Zhivago
Of course, it might be better add empty-list-p to make sure that it's clear that you expect a list rather than a symbol. :)
5:24:33
jmercouris
beach: Do you think I should copy the email body to a pastebin as well so that others may read it?
5:24:57
jmercouris
Zhivago: would you also be interested in reading the email/critiquing the codebase?
5:26:45
beach
jmercouris: Many of us #lisp participants dislike the naming convention that consists of prefixing the slot accessor with the name of the class. It looks very strange when there are deeply nested subclasses, like in McCLIM (SHEET-CHILDREN MY-PANE).
5:28:01
jmercouris
beach: I just kind of copied it from the struct functionality that was already there when I converted to CLOS, how would you suggest I name things instead?
5:28:37
jmercouris
beach: ok, will do, and there should be no collisions right because these are methods, yeah?
5:28:55
Zhivago
There may be collisions, since methods are part of generic-functions which should have coherent semantics.
5:29:46
jmercouris
Zhivago: are you saying if I have two slots accessors with the same name in two different classes there will be a collision unless they are part of a different package?
5:29:53
Zhivago
That is, you're not calling or naming method -- you're calling and naming generic-functions.
5:30:07
beach
jmercouris: Your LOOPs are badly indented and formatted. Use SLIME-INDENTATION and put the LOOP keywords first on a line.
5:30:49
Zhivago
I'd rephrase that as, "If I have one generic function that implements slot accessors for two different classes".
5:32:48
beach
jmercouris: You certainly don't want a return-from as the last form of a function. The last form is returned by default.
5:33:15
Zhivago
Personally I suggest that slot accessors should generally not be exposed in any case.
5:34:07
Zhivago
Well, you need something to access the slots, but the slots are really an implementation detail -- having things outside the class use them is usually not a great idea.
5:34:37
jmercouris
beach: that makes sense, I'll try to remove the return-froms where possible, I know there are a couple of exceptions to this where I must keep it for behavior due to QT
5:34:47
Zhivago
If you expose the slots then the slot semantics become part of your object semantics.
5:34:53
beach
jmercouris: The widely agreed-upon convention for special variables is to give them *earmuffs*.
5:36:44
Zhivago
jmercouris: You might find that (with-active-buffer ...) has nicer semantics than (set-active-buffer ...)
5:37:26
jmercouris
beach: ah, this is true, yes, but I wanted to make it like emacs, maybe I'll make it special, not sure
5:37:55
jmercouris
Zhivago: are you suggesting just renaming the function, or making like a wrapper function?
5:38:27
Zhivago
I was suggesting that you expose a (with- ...) which sets and restores, rather than exposing (set- ...) but it's just a suggestion.
5:38:49
jmercouris
Zhivago: that's a really good idea, I gotcha, I will definitely do that, it's like a python context manager
5:40:15
jmercouris
Zhivago: are you referring to: "If a defvar or defparameter form appears as a top level form, the compiler must recognize that the name has been proclaimed special."?
6:00:15
jmercouris
Well, anyways, thank you both for the valuable feedback, I'll try to make some of these syntactical/idiomatic changes and hopefully write cleaner code
6:00:38
jmercouris
The one question I still have though is, is my approach with the *active-buffer* and the regular functions bad? should I use methods instead?
6:06:47
Zhivago
I think that the idea of having an active buffer in the dynamic context is quite lispy.
6:07:30
beach
jmercouris: I will let you know when the code is in a good-enough shape that I can read it for what it means and not be distracted by superficial stuff.
6:10:23
beach
jmercouris: In stead of doing (if bla (funcall fun <stuff1>) (funcall fun <stuff2>)) it is more Lispy to do (funcall fun (if bla <stuff1> <stuff2>))
6:11:39
beach
jmercouris: I would definitely create a MINIBUFFER abstraction instead of having all those special variables.
6:17:15
jmercouris
beach: how would I make it sort of globally accessible? what's a good singleton pattern?
6:18:39
beach
You store an instance in a single special variable rather than having a special variable for each feature.
6:25:57
pjb
Well, if you want to test for empty lists, in general you should rather use endp instead of null.
6:26:51
pjb
Zhivago: NULL tests for the NIL value, not the NIL type. There is no object in the NIL type! (constantly nil) would be the test for the NIL type!
6:55:00
lexicall
Hi, a package system related problem here. I defined macro AIF in package A and used that macro in package B (:shadowing-import-from #:A #:AIF). i wrote code (aif true it false), but it expands to (LET ((A::IT 1)) (IF A::IT IT IT)), so the compiler explains "Error: The variable IT is unbound." the latter IT does not refer to the former one, which is in package A.
7:03:25
|3b|
or arrange for the AIF to do ugly tricks with symbol generation and hope they don't bite you later
7:07:31
beach
lexicall: What |3b| says. The package of a symbol is determined when the symbol is read, so the symbols IT in the AIF macro is interned in the package named A.
7:13:59
beach
Am I the only one who gets irritated when the person who is given help does not give any sign of life for a long period of time after the help is given?
7:14:45
beach
Or "I don't understand what you are saying. Is there anything I can read in order to learn more?"
7:16:48
jdz
That's probably because the answer was not given 10 seconds after the question, so the person must have wandered away.
7:17:05
flip214
beach: well, if I get called away by an emergency, I won't start to explain that anywhere... I'll just be gone, and says "thanks" some time later on
7:21:12
JuanDaugherty
but being unregulated ... . From my perspective it's working pretty well, this channel in particular has less trolling and such than in the past
7:22:30
JuanDaugherty
i was helping a user in another channel yesterday when they threatened to stop listening to me because they thought I wasn't paying sufficient attention to what they said
7:48:00
lexicall
Oops sorry for not replying becasue I was out before |3b| gave me the advice. Next time I'll be more responsible for my question here. I'll follow what |3b| said, and thanks beach for explaining the reason for me.
10:05:17
akr
Hi, anyone here who's using cl-smtp? I'm having trouble having it send a mail. Here's debug output, does it seem okay to you? http://paste.lisp.org/display/356519
10:07:29
akr
the code is a bit strange, it seems to be using an undocumented function exported by cl-smtp (I didn't write it)
10:26:29
akr
here's how the debug output looks when it actually works: http://paste.lisp.org/display/356522
10:33:55
antoszka
akr: I think ~%~% is the problem, you need *two* empty CRLFs to separate headers from body, ~% will emit a fresh line, *only* when the output isn't on a fresh line already.
10:35:24
akr
so this cl-smtp thing is supposed to connect to a locally running SMTP server, like Postfix, right?
10:39:41
basket
Or well, on Unix anyway; ~% would do CRLF on Windows I think, but I don't use Windows
10:59:50
flip214
you could also run strace against the python proxy, perhaps that'll show why it wouldn't relay.
11:00:39
flip214
if you paste the strace (or send privately, eg. via mail), I'll happily help interpret.
11:02:54
akr
I've asked a sysadmin guy to set up a proper SMTP server, so I think I'm off the hook for now :P
11:06:22
flip214
well, you've got somebody else looking now, so I'll just offer the mantra "read the logs" ;)