freenode/#lisp - IRC Chatlog
Search
4:03:13
Ober
is there some case issue with allegro not finding a function name in this fashion ? (defun star-call () (funcall (find-symbol (format nil "~a-call" *my-type*))))
4:06:32
pjb
Ober: ~A depends on *print-case* and other variables: DO NOT use it to build symbol names!
4:08:41
pjb
Ober: also, this is not conforming code (funcall (find-symbol because implementations are allowed to FBIND any symbol from CL, including CL:NIL, which can be returned by find-symbol.
5:13:47
Ober
(defun star-call () (funcall (find-symbol (string-upcase (concatenate 'string *my-type* "-CALL"))))) ;; more respectable? or string-upcase unsafe in this context? I will be testing if find-symbol returns nil or not. just trying it out in the repl. refactoring a lot of rundundant code
8:02:49
beach
Is anyone here familiar with Doug Lea's memory allocator? It is the one provided by default in many GNU/Linux distributions. I am wondering how it could be simplified if it is known that the use case is different from the typical one. The use case I have in mind would call malloc() many times, followed by free() many times.
8:02:50
beach
In case anyone wonders, this issue is related to Common Lisp, because in SICL every heap-allocated object has a 2-word header that contains (a pointer to) the contents vector (that I call a "rack"). And I am thinking of a garbage collector that uses mark-and-sweep for the headers and a standard memory allocator for the racks.
8:04:43
beach
For one thing, Doug Lea's allocator contains a "cache" so that an chunk that is freed is not immediately coalesced with its neighbors, in case the next operation is an allocation of a block of the same size. This situation won't happen with the use case I am targeting.
8:19:35
kkini
Suppose I have a path of a directory as a string, but I don't know whether it has a trailing "/". What's the best way to get the same valid pathname directory from each?
8:19:35
kkini
(pathname-directory "/foo") is '(:ABSOLUTE) while (pathname-directory "/foo/") is '(:ABSOLUTE "foo"); I want the latter from both
8:20:08
kkini
The obvious way seems to be to just append "/" to the string before calling pathname-directory, since (pathname-directory "/foo//") is also '(:ABSOLUTE "foo") (at least on my machine), but I wonder if there's a more portable way, or something
8:22:36
kkini
shka: vimperator still more or less works on Waterfox ( https://www.waterfoxproject.org ) if you want to try that
8:22:36
kkini
there is also this effort to reimplement something like vimperator that's new-firefox-compatible, though I don't know how alpha-quality it is at the moment: https://github.com/cmcaine/tridactyl
8:25:20
kkini
ah, great. Thanks! (I was scrolling up to see what you meant by "above" until you pinged me a second time :P)
8:29:00
kkini
shka: hmm, actually your solution doesn't seem to work; I get '(:ABSOLUTE "/foo") rather than '(:ABSOLUTE "foo")
8:29:28
kkini
and also when I have nested directories, I get "/foo/bar/baz" -> '(:ABSOLUTE "/foo/bar/baz") instead of '(:ABSOLUTE "foo" "bar" "baz")
8:36:24
kkini
Hmm, I guess I can use (sb-ext::parse-native-namestring "/foo" nil *default-pathname-defaults* :as-directory t) on SBCL
9:08:01
Ober
how hard would it to do clos objects on the leveldb bindings? manardb is really nice, but a bit unportable to other languages.
9:18:19
kkini
Dumb question, but how can I find out whether a (require 'foo) would succeed without actually running it?
9:23:34
jackdaniel
kini: you can't. implementation may provide module-load-hooks, so user may put his own function there
9:24:07
jackdaniel
that potential function during require may try to load it with quicklisp (for instance), or utilise some other means to acquire software
11:12:56
jackdaniel
I'm thankful that I'm not living in US (however I'm not thankful that I'm living in PL) he he
11:13:38
easye
Question of style: when defining a function that destructively modifies an argument, should the function always return the reference to the argument as a primary value? I'm reviewing code that doesn't always follow this convention, and wondering if I should demand a rewrite.
11:14:32
flip214
easye: https://common-lisp.net/~frideau/lil-ilc2012/lil-ilc2012.html#(part._sec-.Transformers) argues that _modifying_ functions shouldn't return
11:15:44
jackdaniel
nreverse may return a new cons (which is composed from conses of input argument) – arg reference usually points at last cons
11:16:36
easye
Well, I am reviewing my own code with a jaundiced eye <https://github.com/cloudfleet/blimp-parachute/blob/master/chute/crypt.lisp#L101>.
11:20:06
flip214
I guess I'll have to re-read "let over lambda", perhaps then I'll find out what I'm doing wrong
12:36:32
beach
I guess I'll have to figure out the simplification of Doug Lea's allocator myself. When I do, I could write a paper about it.
12:40:08
beach
mrottenkolber: It won't be a general simplification. Only one that is valid for the use case where lots of calls to malloc() are followed by lots of calls to free().
12:41:39
beach
Speaking of which, it would be good to have allocation traces of typical Common Lisp programs, so that the quality of garbage collector algorithms could be tested in controlled conditions.