freenode/#lisp - IRC Chatlog
Search
17:22:25
pjb
(com.informatimago.common-lisp.cesarum.list:list-lengths '(a b c . #1=(1 2 3 4 5 . #1#))) #| --> 3 ; 5 |#
17:57:07
sebboh
I think a GC that can be disabled doesn't count unless there is a compelling argument that cycles and storage are simply not used in the first place when it is disabled.
18:01:48
didi
If I recall correctly, PAIP talks about not using the GC in some old implementations because they were inefficient, but I think they still had them.
18:33:59
sebboh
(Surely there are toy lisps that don't have GC. And to answer 'why?', I dunno, microcontroller?)
18:34:54
pjb
Try to write some lisp function without a GC (ie. by calling free for each cons, make-array, make-string, format, etc).
18:41:39
jackdaniel
pjb: that could be somehow made easier with enforcing object scope (i.e no function like #'cons but rather macro (with-cons …), or (with-objects ((a cons) …) …) not that I would be thrilled to use such system
19:02:24
p_l
what do you mean "read an unknown number of bytes"? With compile-time GC? You either ultimately use constant-size memory for this, or just ensure that you cons objects that can't have references and your compile time GC only tracks references (Rust model)
19:04:41
p_l
didi: your buffers can be compile-time known to have specific amount of references, you're tracking those references not memory
19:08:20
p_l
it simply had, iirc, two (maybe few more) areas that were fixed size at compile time, and used simple bump allocator inside of them (i.e. the "raise top of heap" pointer kind), with collection that worked by dropping a whole region
19:33:57
oni-on-ion
but since parens() survive by needing both an open *and* close, surely malloc/free under the same assumption could be just fine.
22:11:28
ckonstanski
Having an issue running a lisp process inside a docker container. Using SBCL. As soon as the lisp image is done loading and comes to rest at the REPL, the container dies. If I run the container interactively I cannot reproduce the behavior. Is there a trick to running a lisp image in docker?
22:18:26
rdh
is there good documentation and examples for OO? i'm reading Practical Common Lisp, and i'm not really grasping generic functions and how methods are "connected" to classes.
22:21:59
Xach
rdh: it can help not to think of generic functions as the primary thing, and classes as a convenient way to implement some concrete behavior.
22:22:23
edgar-rft
Fundamentals of CLOS -> http://cl-cookbook.sourceforge.net/clos-tutorial/index.html
22:22:30
no-defun-allowed
GFs are not connected to classes (except that they have a class, standard-generic-function) but they dispatch on classes (and eql values)
22:22:39
rdh
ohhhhhhhhhhhhh, methods are not really part of class objects... so i'm defining a generic way to use my object using methods
22:23:33
Xach
rdh: methods are not part of classes, classes are a way for a generic function to select what methods apply to a given set of arguments.
22:26:17
Xach
rdh: a generic function is like a thingy to which you attach methods. when you call a generic function, some (or none!) of the methods are selected to run if they match the arguments in some way.
22:29:22
Xach
if you define a method and it is selected, your object will be one of the arguments processed in some way by the code in the method. there can be many objects involved too - it's not helpful to think of an object as the "owner" of a method, it's just a participant in the selection of a method.
22:32:57
Xach
well, there are some good resources out there. try to avoid something that puts objects/classes first. it inhibits real understanding.
22:50:17
moldybits
i don't know if this is better, but at least it's more natural in clos to distinguish actions by how you name the function as opposed to letting the objects provide the context. (concatenate "a" "b") => "ab" (+ "19" "23") => "42"
2:45:40
aeth
Missing commas are pretty annoying. You wind up trying to access a variable that doesn't exist because the macro author only tested the macro with outer variables having the same name as the macro variable.
2:54:01
Bike
so like if a standard function "should signal an error" in some circumstance, if a call to it is safe an error will be signaled
3:12:36
Xach
Hmm, I thought change-class involved :default-initargs, but it doesn't seem to from my reading of the spec and experiments.
4:36:48
beach
asarch: If you find yourself using RETURN-FROM a lot, it might be that your programming style is not that great.
4:38:17
beach
Occasionally, in a loop, when the final value becomes known, it can be a good solution.
4:39:58
asarch
If a function need something like (foo ... (lambda (x y) ...)), how could I put (lambda ...) in a function and the pass that function to (foo ...)?