freenode/#lisp - IRC Chatlog
Search
6:26:52
krwq
soes anyone know how to write strings to in-memry-stream with flexi-streams? I've tried with-output-to-sequence + setf flexi-stream-external-format and also wrapping that stream with another flexi stream with :external-format set
6:28:41
fouric
(...would you happen to have any suggested resources for reading up on garbage collection and memory management?)
6:29:51
krwq
actually bummer - it worked correctly but I misread the error (it was on file-length call)
6:30:14
rme
https://ccl.clozure.com/docs/ccl.html#understanding-and-configuring-the-garbage-collector might be worth a look, too.
6:32:15
aeth
Looks like I just learned that the magic words that a game would need are "real-time concurrent garbage collection"
6:34:36
rme
sometimes use the phrase "stop the world" to describe collectors which are sort of the opposite (and which are more tractable to implement and thus more common)
6:40:12
fouric
ACTION is not very good at search-engine bingo, which is why he asks for recommendations from humans whenever possible
7:52:11
jmercouris
what's the best way to create a config file that can be loaded by a standalone lisp program?
7:52:33
jmercouris
I've forked "site-generator" and I want to be able to pass it a series of commands to execute in the form of a config file
7:53:00
jmercouris
e.g. if I launch "site-generator" in a dir with a config file, it should pick up that config file
7:53:26
jmercouris
I guess the real question I am asking is, how can my program know from where it was launched in order to load the appropriate lisp file?
7:58:41
Shinmera
If it's a source file, the usual trick is #.(make-pathname :name NIL :type NIL :defaults (or *compile-file-pathname* *load-pathname* (error "Welp"))
8:31:09
jackdaniel
what's more, *default-pathname-defaults* and current working directory may be inconsistent (because one or another may be adjusted at runtime independently)
8:46:48
p_l
at least it's rare these days to write lisp for OS that doesn't have the concept of CWD ;)
10:20:04
hjudt
is there an easy way to read a whole text file into a string instead of reading it line by line and concatenating?
11:33:59
jackdaniel
you may want to read about the differences between ~s and ~a (readably vs unreadably)
12:20:42
genos
(sudo rsync --verbose -r --ignore-existing ~/Downloads/books/* /media/${whoami}/247B-947E/books)
12:20:42
genos
(sudo rsync --verbose -r --ignore-existing /media/${whoami}/247B-947E/books/* ~/Downloads/books))
12:21:10
Shinmera
This is not the channel for elisp or emacs. And it's even less the channel to just paste code into.
13:07:07
Xach
scymtym: xml.location references lisplab in one of its systems, but lisplab isn't in quicklisp - should i add lisplab? or ignore the xml.location system?
13:19:41
scymtym
Xach: it used to be an optional dependency but is no longer relevant. i can just remove the integration
13:20:30
scymtym
Xach: i have been meaning to do that for quite some time but forgot about it. thanks for bringing it up
13:22:12
Shinmera
That depends on your file system, but generally no. You can write out a new file and delete the old one though.
13:30:50
billitch
the url scheme is subject of much more design than disk layout which is left to the OS
13:34:53
billitch
well i think the most common data structure is a variable length string which is the filename
14:18:16
pjb
(setf (ldb byte place) val) = (setf place (dpb val byte place)) ; but without the place duplication.
14:20:49
jmercouris
there doesn't appear to be a straightforward way to copy a dir in CL, is there one I'm not seeing?
14:21:42
jmercouris
I see uiop:copy-file and I guess I could copy the folder file, but I'm not sure how that would work
14:21:46
_death
jmercouris: copying a directory (or even a file) is not a straightforward operation.. it depends on what you want to use it for
14:22:21
jmercouris
_death: I'm trying to copy a directory of static assets for exporting a site-generator page
14:22:30
Shinmera
jmercouris: Use DIRECTORY, a wild-inferiors pathname, and COPY-FILE, and ENSURE-DIRECTORIES-EXIST.
14:23:14
_death
jmercouris: here's an old snippet https://gist.github.com/death/2b7b1cfe6a38fc4b368ba91419c75e2e
14:26:07
_death
jmercouris: depending on your situation, it may even make sense to invoke cp -R or somesuch
14:26:08
jmercouris
Shinmera: What do yo umean by "wild-inferiors" pathname? a pathname that includes a wildcard matching all child files of the dir I wish to copy?
14:27:15
Shinmera
jmercouris: For instance: (make-pathname :directory '(:absolute :home :wild-inferiors))
14:28:39
jmercouris
Shinmera: So i'd match all the dirs, and which I would then have to walk, and then match all the files and then copy them?
14:29:40
Shinmera
(directory (make-pathname :name :wild :type :wild :directory '(:absolute :home :wild-inferiors))) will list all files reachable from your home directory.
14:30:46
jmercouris
Right, so I would still need somehow to know the tree structure of the dir I'm copying over
14:31:35
Shinmera
You truncate off the common path to make it relative, then make it absolute to the destination directory again. Then use ensure-directories-exist to make sure the folders are there, then copy.
14:31:42
jmercouris
That's true, but unless there's a copy-file flag that will construct all the necessary folders to get to a path, I'd still need to somehow do some processing no?
14:33:51
Xach
For example, getting a list of relative pathnames via DIRECTORY on a given base directory has a pitfall to carefully avoid.
14:34:18
Shinmera
Yeah, might do symlink resolution or truenaming, so your paths might not all have the same root.
14:34:22
Xach
if the base pathname isn't a truename, the results from DIRECTORY won't be amenable to enough-namestring.
14:34:49
_death
ACTION wonders why that snippet didn't give him a warning as it's missing a symbol in import-from
14:35:36
jmercouris
would be a nice utility for someone to write though, or nice to have in uiop like uiop:copy-dir
14:37:08
Xach
It sure would be nice to have a utility like that. I can understand why it's hard to get right, though.
15:42:59
rumbler31
not bad on the east coast of the US, waiting for it to make up its mind about the cold
15:46:04
JuanDaugherty
ACTION is only wanting to destroy all humongs by merciful means, does that count as a good day?
16:06:46
Xach
http://report.quicklisp.org/2018-01-26/failure-report/claw.html <-- argument count mismatch
16:38:02
pjb
beach: I have a suggestion for sicl (and really, for all CL implementations): annotate the function with the special variables used, and issue warnings or print notices about them (systematically and automatically). Notably, for implementation operators. Again this week somebody in #ccl had a problem that a ccl function to open a network stream failed, when *print-base* or *print-radix* were different from the default value; thi
16:38:02
pjb
function used princ to convert a port number to a string… This can be considered a bug, but in any case, it should be documented!
16:56:01
pjb
beach: by annotate here I mean in the compiler data structures. So that it may issue the warnings or write notices on its output.
16:57:27
rumbler31
paule32: in half adder you also setf a and b, but take in i1 and i2. I don't think these would explain your errors though, since a,b,c are globals, but maybe the fact that they are special is messing things up
16:58:44
makomo
pjb: hmm, why would you need to document it if it's only used internally by the function?
16:59:12
makomo
if we suppose that the function correctly binds *print-radix* and w/e it needs before PRINC-ing
17:02:07
megachombass
if i manage to compile fibo (means be able to compile constants, a defun and a IF) ill be good
17:04:47
pjb
beach: additionnal similar annotations could be about side effects: mutation of bindings, mutation of lisp objects, and mutation of external state (file system).
17:05:02
shrdlu68
megachombass: You'd be better of using "CL" instead. clisp means something different to most people here.
17:05:55
pjb
beach: the problem being that programmers have a mental image of what state is used or mutated by functions, but it is not always exact (eg. a lot of *print-…* variables are ignored for non-I/O functions…), and it's in general unknown for implementation specific functions.
17:07:11
pjb
makomo: yes, indeed if there is a local dynamic binding of a dynamic variables used by a function, then it can be removed from the list of dynamic variables usedby the caller.
17:10:05
makomo
megachombass: clisp happens to be the name of a particular cl implementation. that's why you should use "cl" instead when referring to common lisp as a language
17:11:57
pjb
megachombass: it's easy, Common Lisp comes from a package named "COMMON-LISP" and with a nickname "CL". So call it common-lisp or cl.
17:12:19
pjb
"LISP" was an old, pre-standard nickname. This is why #lisp is #lisp and not #cl or #common-lisp :-)
17:13:35
pjb
beach: (dynamic-variable-used-by-function 'concatenate) -> (*debugger-hook* …) assuming it signals type errors, and signal calls invoke-debugger which uses *debugger-hook* ;-) See the range of the problem…
17:14:30
pjb
perhaps the result will be that all functions always use indirectly all the standard dynamic variables. :-(