freenode/#lisp - IRC Chatlog
Search
8:39:58
shrdlu68
flip214: How did you solve the multithreading thing where different threads were writing to a stream?
8:41:19
flip214
I was stumbling about having :if-already-exists :append and did look at old data in that file.
8:57:53
jeosol
flip214: had similar problems with my parallel code, and used with (bt:with-lock-held ...)
9:17:54
MrMc
I am trying to use parenscript with the Chartist javascript library how do I get parenscript to emmit new Chartist.Line('.ct-chart', data);
9:20:17
MrMc
The challenge is that this is wrapped as a function returning new Chartist.Line('.ct-chart', data)
11:01:22
phoe
antoszka: I have no idea how postmodern works on the inside. Even if I use multiple threads in my code, they may block on a single connection for example.
11:02:10
antoszka
Well I'm sure you could easily find that out if you try (by even watching connections).
11:20:28
flip214
also, see https://www.quicklisp.org/beta/UNOFFICIAL/docs/postmodern/doc/postmodern.html#*max-pool-size*
11:41:52
flip214
I guess you should be using (with-connection (... :pooled-p T) body) and not ever set *DATABASE* at all.
11:43:35
flip214
phoe: and also be aware of potential problems if you (need to) give the database connection up, eg. because of multiple independent requests via hunchentoot
11:44:15
flip214
a SELECT FOR UPDATE will not work, because a) the old transaction might/will be aborted, and b) you might get assigned some other connection
13:44:21
schweers
is LAUNCH-PROGRAM a fairly recent addition to UIOP? I don’t have it on my machine.
13:44:42
schweers
As I’m running debian (read: ancient software) I suspect that I might need a newer version
13:47:52
schweers
so I don’t necessarily have to install a new version for the whole system, but can drop it somewhere where the installed asdf can find it?
13:48:27
svillemot
schweers: /usr/local/share/common-lisp/source should be the right system-wide path
13:49:53
shrdlu68
schweers: This may help: https://common-lisp.net/project/asdf/asdf/Replacing-your-implementation_0027s-ASDF.html#Replacing-your-implementation_0027s-ASDF
13:52:14
svillemot
my understanding is that schweers uses the ASDF from the Debian package, not from its implem, which is 3.1.7 in Debian "Stretch" 9
13:52:56
schweers
I’m not entirely sure whether asdf comes from the implementation (sbcl) or from debian. Is there a way to check which version is currently loaded?
13:53:22
schweers
It seems that the cl-asdf package from debian testing is new enough, maybe I’ll use that or build a newer sbcl from source
13:56:21
schweers
huh. I’ve installed the new version and I still get the old one in a new lisp image
14:34:24
schweers
It seems to me that the process dies in my program (where I do not care about the return value, other than the stream it contains)
14:39:02
schweers
I want to compress my output with bzip2. So instead of just opening the file (as I did until now), I create a bzip2 process. I give it as output the filename I previously opened directly and return the input stream, promptly forgetting the process-info value itself
14:39:36
schweers
flip214: my experiments on the REPL showed me that CLOSE on the input stream is sufficient, how is that wrong?
14:41:00
schweers
I get your point, but still: why do the processes seem to simply die? is it because the return value of launch-program is garbage collected?
14:42:26
flip214
schweers: do you call a shell with redirection, or pass the output filename to bzip2 as :output?
14:42:39
phoe
schweers: check all the output streams of bzip2, including stderr, for any data that might appear there.
14:45:32
schweers
seemed very dead to me. and simply using the bzip2 binary seemed to be the easier way
14:46:49
schweers
the thing is that I’m just working this into a somewhat complex program. so pasting the relevant bits isn’t really a straightforward process :/
14:52:27
schweers
is it possible that I’m not allowed to call LAUNCH-PROGRAM from a thread other than the main thread?
15:17:29
schweers
turns out that I am giving some wrong parameters in. I gave a broken pathname, gave :rename-and-delete (which is illegal), and :error-output t is also apparently illegal
15:19:50
flip214
ACTION waits for phoe to give a downward arrow, so that I can write something useful there
15:29:11
schweers
is there actually a good reason why sbcl does not properly work with pathname types like "tar.bz2"?
15:29:58
phoe
schweers: yes, there was one - when you have "foo.bar.baz" it has no idea whether the file "extension" is "bar.baz" or "baz"
15:31:32
rpg
schweers: this isn't really SBCL's fault -- the ANSI spec really isn't clear about how file types should be parsed, because it was written in a time of greater filesystem diversity than today.
15:31:42
phoe
(uiop:native-namestring (make-pathname :name "foo" :type "bar.baz")) ;=> "foo.bar.baz"
15:32:05
rpg
I am honestly a little surprised, though, that when you push a type in with MAKE-PATHNAME it doesn't do the right thing.
15:32:11
Xach
schweers: I suspect it is inherited from CMUCL, and the answer may be lost in the mists of time. or not!
15:32:59
phoe
rpg: the type is correctly set to be "tar.bz2" but NAMESTRING refuses to work with it.
15:34:11
flip214
The pathname #<PATHNAME ...> does not have a namestring because the :TYPE component contains a #\.
15:34:22
schweers
rpg: regarding your point that the standard doesn’t specify how to do this: I know that, but it seems like a language lawer move. It seems to me to be an insane way of handling this, but I might be wrong. Hence my question about the rationale for this way of doing things.
15:34:58
Xach
schweers: I think it is reasonable to say that the type is everything after the final "." and the name is everything before.
15:35:34
rpg
Xach: but surely if you actually push a value into type as in this case, NAMESTRING ought to report it back.
15:35:40
schweers
Does the standard require namestring parsing and printing to be a bijective relation?
15:36:20
Xach
rpg: if you parse-namestring you get a different object, and that's not what namestrings are for.
15:36:22
rpg
Xach: In that case, I think SBCL should raise an error in response to setting type in that way.
15:45:49
flip214
how about (CONCATENATE 'string filename ".tar.bz2") and avoid pathnames altogether?
15:46:37
Xach
If it were me, I would make a function that makes a new suffix like .bz2 by combining the existing name and type into the name and making the new suffix the type. There are many other options.