freenode/lisp - IRC Chatlog
Search
16:12:55
pjb
You cannot define methods on system objects or build-in objects. Basically, you may define methods only on your own objects.
16:14:25
pjb
(defgeneric my-print (object stream) (:method (object stream) (print object stream))) and then add methods at will.
16:22:10
selwyn
in particular, not following the prescriptions regarding *print-circle* could lead to an otherwise unexpected unbounded amount of output to the printer which could, for example, break a REPL session
16:30:10
selwyn
no problem. well, actually i am not so sure about my most recent argument. but avoiding undefined behaviour is certainly reason enough to follow the rules.
22:09:42
matzy_
i have a noobish question. i'm trying to get a package that the author claims is on quicklisp, but i can't find there. if i just clone the repo from is github, can i easily install it with quicklisp, like if i was installng a remote package? or is that what asdf is supposed to handle
22:11:02
White_Flame
inside ~/quicklisp/local-projects/, you can symlink to the downloaded git directory
22:11:48
pjb
You may add the https://ultralisp.org distribution to quicklisp, to have access to more systems.
22:11:53
White_Flame
btw, ASDF understands .asd system definition files. QL downloads ASDF systems from teh intarwebz
22:13:32
aeth
https://gitlab.com/mbabich/trivial-left-pad/commit/450c8c70451d1cd3f38eda809cde7fb6614daf4f
22:13:50
aeth
I probably should add version numbers to its ASDF file now that it's on Quicklisp and getting issues
22:13:56
White_Flame
does it support bidirectional text, leaving the padding on the left side regardless?
22:14:51
aeth
Oladon_work: The joke in the joke was that every part of it was larger than the code itself (tests, documentation, source comments, etc.)
22:16:27
aeth
16 additional commits later and some things might not be larger than the code itself anymore, though
22:17:15
aeth
Oladon_work: I have a new joke repo. https://gitlab.com/mbabich/lisp-hello-world/blob/c45deaab9918285d3de43c52340100fef6591d15/main.lisp
22:17:46
aeth
and, yes, it does do an elaborate infix reader macro from scratch just to deliver that punchline
22:19:29
aeth
Well, I mean, it's like mathematics. It can be very dense. This might only be 39 lines, but it takes a while to read what's going on: https://gitlab.com/mbabich/lisp-hello-world/blob/c45deaab9918285d3de43c52340100fef6591d15/infix.lisp
22:20:34
aeth
Basically, it makes no attempt to establish precedence, or support unary. It's just binary infix of matching operators. So (1 + 1) or (1 + 2 + 3) or even (1 + (2 * 3)) but not (1 + 2 * 3)
22:45:00
Xach
I have a macro that does something like (:initialization 42 (foo) (bar) (baz)) and everything after 42 should indent as &body.
22:46:29
matzy_
White_Flame: sorry for the late reply, got caught up in something for work. the library is called tecgraf-libs, and i copied and pasted the author's ql:quickload command from his readme, so i hope it works :)
22:48:11
matzy_
which it was only released 8 months ago, and has updates as recently as 4 months ago, so i was suprised i couldn't find it on there, ditto because the author mentions it being on there in that readme and the readme of a related repo. but i even searched for "tecgraf
22:49:15
alexanderbarbosa
Xach: is this you are looking? https://stackoverflow.com/questions/69934/set-4-space-indent-in-emacs-in-text-mode
22:51:15
alexanderbarbosa
(setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80))
22:56:32
White_Flame
matzy_: hmm, I can't find it either. I wonder if he just has it in his local-projects and loads it that way?
22:56:56
White_Flame
again, if it's symlinked there than the standard ql:quickload will find it by its asd name
22:57:30
matzy_
White_Flame: ok cool, well at least i know how to get it on my machine now. glad i'm not crazy. thanks!
22:57:47
White_Flame
yeah, the readme does make it look like it's downloadable via quicklisp, which is odd
23:03:43
alexanderbarbosa
disturbing moments at python lands: Modifying an Attribute’s Value Directly. NOOOOOOOOOOOOOOOOOOOOO
23:17:58
aeth
I wonder if "cl-docs" would be a good name for the md->html library, since it'd be covering document formats
0:12:00
aeth
make-array with an :initial-element and if that's too verbose (it often is) you can just define a trivial inline function to do it
0:13:39
aeth
They could be more space-efficient and provide the compiler's type inference more information if you give them an :element-type, e.g. (make-array 3 :element-type 'single-float :initial-element 0f0)
0:14:30
aeth
element-type is only going to work for certain kinds of numbers and characters, like e.g. (unsigned-byte 8). Besides characters and bits, it's implementation specific, but almost all of them will have single-float, double-float, and various byte sizes (especially 8, 16, 32, and 64) that are signed and unsigned
0:16:08
aeth
by default, and if you give it an invalid type, it'll just be a T array, i.e. holds anything
0:16:45
aeth
initial-contents is another useful feature, e.g. (make-array 3 :element-type 'single-float :initial-contents '(1f0 2f0 3f0)) => #(1.0 2.0 3.0)
2:14:53
manualcrank
how do you quell the "the default initial element 0 is not .." for uninitialized specialized arrays?
2:18:31
manualcrank
if you give an initial-element here it'll just be 10 references to the same element
2:21:59
aeth
manualcrank: (upgraded-array-element-type '(array fixnum (*))) is probably going to be T... what implementation are you using to get that error/warning/note, though?
2:26:55
aeth
I guess it's one of those things that only exists within function scope because that information is going to be lost outside of that function because it's just a simple-vector, i.e. a vector containing T
2:27:18
aeth
You could try (make-array 10 :element-type '(array fixnum (*)) :initial-element (make-array 0 :element-type 'fixnum)) or you could also try using :initial-contents
2:27:33
Bike
the warning only shows up in a file because if you just put a make-array call in the repl it won't compile anything.
2:31:16
Bike
i think sbcl should just take out the warning, really... reading an element without writing it first is UB anyway
2:38:01
manualcrank
i assumed if the compiler knew i was processing an an array of fixnum arrays it would generate more efficient code?
2:39:04
Bike
you can declare the type of elements in an array with type declarations, rather than specifying :element-type, which is more fundamentally about the runtime
2:45:34
aeth
manualcrank: If you wanted more efficient SBCL code here, you could consider a struct with typed slots or a 2D array.
2:49:43
manualcrank
adjacency list representation -- each element of the array is an adjustable array
2:52:11
manualcrank
i use vector-push-extend to add vertices. A 2d array would be very wasteful in that case, graph is large but not usually dense
3:01:22
manualcrank
i do declare array type when it's a parameter, but not being a fan of DECLARE (aesthetics) i had been using element-type at the point of creation (thinking the effect would be the same)