freenode/#lisp - IRC Chatlog
Search
11:22:09
makomo
the nice indentation started working only once i loaded ESRAP (i think, checking now), so i suppose there's a way to do it
11:29:09
makomo
:lambda indents nicely without loading ESRAP, but :destructure requires ESRAP to be loaded to indent nicely
11:43:10
_death
https://github.com/scymtym/esrap/blob/master/src/editor-support.lisp also see trivial-indent
11:44:12
beach
no-defun-allowed: I'll add it at some point, but there is no great point in doing that until I have something that can be experimented with.
11:44:36
makomo
_death: oh boy, if only i looked carefully at the file list -- i was looking at macros.lisp and now interface.lisp...
11:58:30
scymtym
makomo: what _death said. SB-EXT:WITH-CURRENT-SOURCE-FORM is for associating macro expansion errors with sub-forms. for example to allow SLIME to highlight a sub-form instead of the whole macro form
12:03:45
makomo
scymtym: ah, that confirms the vague idea i formed by reading the docstring a couple of times. gooling for it doesn't really give much except for messages in #sbcl and sbcl mailing lists posts, both of which are yours :-)
12:16:57
k-stz
cffi:load-foreign-library searches for library.so but cant find those with number extensions library.so.<number>, is there some setting that does that? My linux distribution saves only the newest library with number extensions and cant (no symlink "libfreetype.so -> libfreetype.so.6")
12:22:56
jmercouris
it is pretty standard practice to have a symlink pointing to the latest version of a shared library
12:40:56
scymtym
makomo: all SBCL users benefit though, as this is used in SBCL itself as well. compare left (with WITH-CURRENT-SOURCE-FORM) to right (without) in https://techfak.de/~jmoringe/macroexpansion-condition-locations.png
12:55:49
k-stz
I can symlink no problem, but I'd rather fix it at the source or it won't work on all distributions. And the bindings aren't mine, so you'd say its a bug and I should tell the maintainer?
16:36:46
phoe
you can put multiple forms inside a DEFUN - it has an "implicit PROGN", or so it's called.
16:37:12
phoe
*counter* instead of +counter+, as beach said. It's just notation - +foo+ denotes constants, *foo* variables.
16:39:04
beach
j`ey: If the (WHEN DFS-RES is supposed to be inside the LET, then the line is badly indented.
16:40:23
phoe
there's packages called slimv or vlime - they allow live interaction with Lisp images and should get you the best experience
16:40:41
phoe
I'm a spacemacs user myself, so won't be able to help you with vim setup - but perhaps someone else on the channel has that.
16:41:01
dim
j`ey: for growing a style and learning so many tricks when starting with CL I did like reading https://www.cs.umd.edu/~nau/cmsc421/norvig-lisp-style.pdf ; I should give it another read even
16:41:03
phoe
j`ey: please do. half a fun of doing Lisp is its interactivity - and you need a toolkit that leverages that interactivity, so a mere text editor won't do
16:41:30
phoe
dim: and yeah, the three basic things: reading other people's code, writing your own code, and sending it for reviews
16:41:59
j`ey
my friend has looked at my code, but he's been too busy to look at some of the recent changes
17:09:17
drmeister
The first one is from the (defgeneric foo (page &key if-exists &allow-other-keys) ) definition
17:24:28
Colleen
Clhs: section 7.6.4 http://www.lispworks.com/documentation/HyperSpec/Body/07_fd.htm
17:24:34
Colleen
Unknown command. Possible matches: 8, mop, roll, set, say, get, login, block, award, time,
18:23:14
drmeister
makomo: Thank you - I encountered those incongruent lambda lists in some code from someone that I trust and I know that it is accepted in sbcl. I couldn't believe that clasp/ecl determined correctly that the lambda lists were correct and that the author and sbcl were incorrect.
18:35:34
drmeister
s/I couldn't believe that clasp/ecl determined correctly that the lambda lists were correct and that the author and sbcl were incorrect./I couldn't believe that clasp/ecl determined correctly that the lambda lists were INCONGRUENT and that the author and sbcl were incorrect./
19:28:51
phoe
generally there's always a newline in the DEFUN form after you finish typing the arguments
19:29:18
zhlyg
I *think* you should add tuple :if-does-not-exist :create to your with-open-file form (I'm cargo culting from PCL).
19:34:11
phoe
when you're opening the file for input, you likely don't want to supersede it if it exists
19:34:15
jmercouris
are there any VIM plugins for proper indentation? I belive steve losh is also a vim usr
19:35:18
j`ey
zhlyg: wouldnt I still need to get the different bytes out of the value into a sequence?
19:35:56
jmercouris
well, ':input will just evaluate to :input, not sure why you would do one over the other
19:36:40
pjb
jmercouris: a bad compiler could generate better code for ':input than :input. But it would need to be very bad.
19:37:10
pjb
jmercouris: it can never be different (unless the implementation allow for non-conforming setting of the keyword value)
19:38:00
pjb
But of course, this is only when they'er evaluated. If not, then there's a big difference: (quote (:foo ':foo)) #| --> (:foo ':foo) |# doesn't contain two symbols!
19:41:31
zhlyg
j`ey: scratch my idea of using write-sequence, it won't work because you are building an little-endian integer.
19:42:02
pjb
j`ey: a displaced array is an array whose elements are actually stored in another array.
19:43:06
pjb
and similarly, read-sequence, once you've read the dimensions and initialized the multidimensional array.
19:43:51
j`ey
now im confused. why am I doing all this byte stuff if write-sequence and read-sequence can write out an array?
19:46:33
pjb
j`ey: ah, well, this is not an array of bytes, so you still need to convert the elements into sequences of bytes (if you want to write your file portably).
20:03:14
pjb
(loop :for i :below (reduce (function *) (array-dimensions a)) :do (write-sequence (element-to-byte-sequence (row-major-aref a i)) stream))
20:05:29
pjb
(loop :with buffer (make-array +size-of-serialized-element+ :element-type '(unsigned-byte 8)) :for i :below (reduce (function *) (array-dimensions a)) :while (= +size-of-serialized-element+ (read-sequence buffer stream)) :do (setf (row-major-aref a i) (element-from-byte-sequence buffer)))
20:12:03
aeth
pjb: Yeah, I'm just saying when everyone's reaction is to go to the documentation maybe a simpler form is better
20:17:14
pjb
j`ey: didn't tell you that you should never use a literal value directly in the code? Instead, define a constant!
20:18:03
pjb
(eval-when (:compile-toplevel :load-toplevel :execute) (defconstant +byte-size+ 8)) and then :element-type `(unsigned-byte ,+byte-size+) and (logand (1- (expt 2 +byte-size)) ...)
20:20:33
pjb
But seriously, given the cost of studies, and the final results, I can't wait to see a suit asking refund.
20:20:51
aeth
pjb: Personally, I wouldn't use a constant for something like that, I'd use a *macro*.
20:22:04
pjb
You can also start with (deftype octet () `(unsigned-byte 8)) and use that type in :element-type everywhere…
20:22:29
aeth
https://gitlab.com/zombie-raptor/zombie-raptor/blob/5135a3ca53351660aa6482c18a1044afa04d5b9e/util/types.lisp
20:26:30
pjb
Then, there remains all the little monasteries and abbey where copist had libraries of volumes.
20:33:15
j`ey
in the CLHS it shows you can (map 'string..), with characters, is there a simple way to do it but with a list of strings?
20:36:37
aeth
I think you could probably do it with a mapfoo (probably not map) but it would be functionally equivalent to the reduce, but more verbose.
20:38:49
aeth
It doesn't look like my version of SBCL has a fast route for string concatenation when the types are known. i.e. this won't speed up your reduce (it will slow it down slightly, to check the types of x and y): (defun concatenate-string (x y) (declare (string x y)) (concatenate 'string x y))
20:40:42
aeth
j`ey: That will turn it into (concatenate 'string a b c d e ...) where "a b c d e ..." are elements of the list. It might be slower or faster. It's limited to call-arguments-limit
21:40:13
pfdietz
It might be nice if SBCL images could make the standard part shareable between different images, like libraries. Or is that the case already?
21:47:36
slyrus1
pfdietz: I agree. It might already be a thing, but, without thinking about it too deeply, something like dougk's shrinkwrapped binaries linked against a common libsbcl would be awesome.
21:52:49
slyrus1
Then again I'm busy downloading a 17MB string handling R package as some chained dependency so clearly nobody cares about package size anymore...
22:04:15
pfdietz
../../include/clasp/asttooling/astVisitor.h:30:10: fatal error: 'clang/AST/RecursiveASTVisitor.h' file not found
22:04:37
Colleen
Unknown command. Possible matches: 8, roll, clhs, set, say, mop, get, login, block, time,
22:06:12
oni-on-ion
who me? Colleen was mentioned here just earlier, thats where i first heard the name. i searched CL irc bot and got the same name, these reasons are why i say hi to her.
22:15:03
oni-on-ion
julia, colleen, ruby .. lady names are easy to remember, and at least partially altruistic =)
22:26:12
vsync
women do tend to score higher in extraversion, agreeableness, and conscientiousness, sure, but I prefer to keep the focus mainly on the individual
22:41:10
oni-on-ion
vsync: i mean for man to treat a lady. software and computers like we call the cars we work on "our baby"
22:44:24
oni-on-ion
Shinmera: broken link on colleen README.md - points to http://plaster.tymoon.eu/view/5A
23:00:58
Colleen
Shinmera: drmeister said 6 hours, 23 minutes ago: You used (:local-nicknames (#:cst #:concrete-syntax-tree))
23:00:58
Colleen
Shinmera: drmeister said 6 hours, 23 minutes ago: https://github.com/quicklisp/quicklisp-client/blob/master/dists/quicklisp/software/staple-20180711-git/parser/package.lisp#L11
23:00:58
Colleen
Shinmera: drmeister said 6 hours, 22 minutes ago: That last link won't work of course: https://github.com/Shinmera/staple/blob/master/parser/package.lisp#L11
23:00:58
Colleen
Shinmera: drmeister said 5 hours, 7 minutes ago: In staple here https://github.com/Shinmera/staple/blob/master/inference.lisp#L43 you use the symbol definition:declaration - that is only defined for sbcl.lisp in the definitions system.
23:00:58
Colleen
Shinmera: drmeister said 4 hours, 33 minutes ago: There are some incongruent lambda lists in staple. https://github.com/quicklisp/quicklisp-client/blob/master/local-projects/staple/page.lisp#L30 the methods look like they need to have &allow-other-keys added to them.
23:11:46
pfdietz
Even ignoring GFs, it could make sense to do that with ordinary functions, since you can pass keyword parameters if you include a :allow-other-keys t pair of arguments.
23:14:01
Shinmera
We're specifically talking about (defgeneric f (a &key b &allow-other-keys)) (defmethod f (a &key))
23:16:54
Shinmera
drmeister: the sbcl-isms in staple should be fixed now. (except for the local nicknames)
23:18:37
drmeister
It means when you are in a particular package - that certain additional nicknames are available.