freenode/#lisp - IRC Chatlog
Search
22:16:55
jasom
ACTION refactored out some code into a different package, but neglected to export one symbol
22:18:33
phoe_
So a function doesn't make it for me since the symbol will get evaluated and I lose the name.
22:19:12
jasom
easist way to ensure a list is no more than N elements? (e.g. (first-n 3 '(a b)) => (a b) (first-n 3 '(a b c d)) => (a b c))
22:19:19
phoe_
minion: memo for Xach: http://paste.lisp.org/display/356788 <- What do you think of this? It's surprisingly small.
22:19:55
phoe_
https://github.com/death/gnusdumps/blob/5ad0fda58cc830709179b50347144a1da854d02a/driver/main.lisp#L92
22:22:39
Bike
no other function does anything like that, you should be able to work it out from a backtrace
22:29:15
stylewarning
My argument is that if you’re printing the code outside of its native home the loops are full of prefixed symbol garbage
22:30:28
stylewarning
MY-PACKAGE::FOR MY-PACKAGE::I MY-PACKAGE:FROM (one colon because FROM is a function I’ve exported) 1 MY-PACKAGE::TO 10
22:48:19
PuercoPop
I do to, as well when package designators are not un-interned symbols. But it I tell myself it is my OCD kicking in
22:56:34
aeth
PuercoPop: All CL has is the Google Style Guide (formerly from ITA Software) and a bunch of slides from (iirc) Norvig and the general guide to "just use the default formatting Emacs gives you" (even the Google Style Guide says something like this)
23:17:29
jmercouris
I need to do some logic before I can populate the slots of my class, how can I make a "constructor"?
23:22:42
PuercoPop
aeth: Speaking of Norvig's style guide, another pet peeve is when people don't use upper case for format directives
23:24:45
aeth
jmercouris: Two ways, iirc. initialize-instance and defining your own make-foo that returns the result of a (make-instance 'foo) with everything setup
23:27:23
PuercoPop
onecould also defer initialization until first use with an around method on the accessor
23:29:30
aeth
jmercouris: I prefer make-foo because it abstracts more (e.g. it doesn't have to be a CLOS object, it could be an array or something), but I think defining an initialize-instance is more common. You could probably provide both, too.
23:30:08
aeth
PCL uses the latter. http://www.gigamonkeys.com/book/object-reorientation-classes.html
23:32:36
aeth
If you do both, make-foo would just return (make-instance 'foo) with the optional keyword arguments passed to the constructor and could probably be inlined with no issues.
23:33:13
jmercouris
basically I am making constructors for major mode objects, so I don't want to make it too hard for emacs users to figure out
23:36:26
Fare
I'm starting a section of my thesis on robustness, and I realize I'm totally lacking in bibliography on how to properly think about robustness.
23:36:48
Fare
I believe I have the essential concepts, but this is not the place to write a treatise on it.
23:41:30
Fare
jmercouris, did you read my article on interface-passing style? It offers some insight on constructors.
23:47:24
phoe_
How can I readably print a hash table while preserving object identity with #1= #1# notation?
23:48:22
phoe_
I have a hash table where keys are list in form (symbol string) and values are vectors of uint8s. Multiple keys can point to one value, as in, for two different keys, the values can be EQ.
23:52:29
Bike
jmercouris: if they're all named by interned symbols you could, but it's a weird thing to do.
23:52:42
jmercouris
Bike: I'm trying to make it so that users can inspect all variables like in emacs
23:52:56
jmercouris
Bike: this is obviously for the browser, I want it to have that same discoverability of what all confiigurable parameters are
23:53:51
Bike
it's pretty unnatural to have a defvar named by an uninterned symbol, i just tend to name caveats
23:55:31
Bike
that doesn't actually tell you whether the variable is special, as in declared by defvar, but the difference should be mainly academic.
23:56:28
jmercouris
Bike: I'm not strictly interested if by defvar, I just want to be able to have a user query vars and show their resultant docstrings
23:56:49
jmercouris
Bike: speaking of which, could you please tell me what the correct way to docstring a function is?
23:57:03
jmercouris
I've looked at so many different ways to do it, and documentation generators, and I'm really not sure what's right
0:02:18
Bicyclidine
i usually just write an explanation of what i think is relevant. i don't use doxygen type tools.
0:06:59
didi
In LOOP, can I bind (values ...) values as I can destructure lists? Something like (loop for (values a b) = (truncate 42 7) ...)
0:10:25
Bicyclidine
You can do (a b) = (multiple-value-list (truncate ...)) if you don't mind the performance hit.
1:05:58
phoe_
Yes, except in macroexpanders' case, I can think of how one can use these side effects to achieve something.
1:06:44
phoe_
For macros, it's compilation-time / macroexpansion-time computation. For types... hum.
1:08:36
Bicyclidine
the obvious expansion of (defmacro name ll ...body) is (setf (macro-function 'name) (lambda (form env) (destructure ll form env ...body)))
1:08:39
phoe_
I just find it fun that the moment I start typing "(foo" into the REPL, boom, they're printed.
1:32:25
z3t0
I am half way through practical common lisp and am looking for some supplementary material as well
1:35:45
z3t0
I don't really have a lot of free time as a first year engineering student so it's slow going through PCL
1:39:49
PuercoPop
I'm trying to figure out the correct way to message the values returned from alexandria:parse-ordinary-lambda-list to match a call to apply. I know it is bad style, but what would be the correct way to handle optional and keyword arguments being mixed?
1:45:20
beach
PuercoPop: What does it mean to "message" something? And what does it mean to "match a call" to a function?
1:46:11
PuercoPop
Basically I fiasco, a test framework, has this code (apply (name-of (test-of (context-of failure))) (actual-test-arguments-of (context-of failure)))
1:46:41
PuercoPop
with its own parse-lambda-list, which uses a visitor pattern, to get the text arguments of