freenode/#lisp - IRC Chatlog
Search
5:42:50
russellw
jackdaniel, not necessary, thank you, I already have the log running fine. The issue is how to make all the system code output to my log
5:43:58
russellw
Inline, to my pleasant surprise, assigning an output stream to query-io and debug-io, works – it does not crash the program or anything. But unfortunately it does not capture the GC error output
5:49:57
jasom
russellw: the GC error output is almost certainly not written in lisp and probably uses file streams
5:50:45
Inline
(defun gc-logfile () "Return the pathname used to log garbage collections. Can be SETF.
5:50:45
Inline
designated file is opened before and after each collection, and generation statistics are appended to it."....
5:53:30
Inline
(!defvar *after-gc-hooks* nil "Called after each garbage collection, except for garbage collections
5:53:30
Inline
triggered during thread exits. In a multithreaded environment these hooks may run in any thread.")
6:10:47
another-user
i tried to use this reader macro https://gist.github.com/rmoritz/1044553/b2d2d8e4b933cb0f6c3fb5ff3f9bcfae6be7ce47 and it works in sbcl repl
7:00:23
LdBeth
And these reader macros are not idiomatic, bacause (quote [1 2 3]) is supposed to return #(1 2 3)
7:53:30
another-user
shka_: do you mean instead of {} macro i should create #{} kind of macro? but how?
7:56:42
another-user
shka_: i need this https://gist.github.com/rmoritz/1044553/b2d2d8e4b933cb0f6c3fb5ff3f9bcfae6be7ce47 to work in slime repl
7:58:36
kristof
this is so minor but those lambdas don't have to be indented so far; only two spaces after set-macro-character
8:00:05
kristof
Also, and this is my limited experience, but I've never really wanted hash literals. Hash tables have advantages for multitudinous collections
8:00:27
jdz
Also, pretty sure READ-DELIMITED-LIST can be used instead of creating new readtables on every invocation.
8:00:29
kristof
But for small collections, which is what I'd what literals for, plists outperform the hashing overhead, usually
8:02:14
jdz
another-user: if the calls to SET-MACRO-CHARACTER are done in the REPL then they should be working.
8:11:51
jdz
another-user: I re-wrote the square bracket reader: https://gist.github.com/jdz/89b93653da3c3fe965a904b67cec5e43
9:35:10
svillemot
Myon: I've investigated your pgloader issue, and the problem comes from cl-ironclad which is out-of-date in Debian
9:37:28
dim
svillemot: I've been told (here) that the compile time difficulties are also solved with the most recent version of SBCL
9:39:29
svillemot
actually it's *because* SBCL is recent that we have problems with nibbles and now ironclad, because those project use SBCL internals, and needs updating
9:40:42
dim
while you're around, would it be a good idea that I spend time trying alternatives to cl+ssl/openssl for pgloader, maybe using bearssl or wolfssl or some other lib that would make our life easier?
9:42:30
svillemot
the cl+ssl situation is now ok on the Debian side, but only because I patched it for OpenSSL 1.1
9:43:05
svillemot
diverging from upstream is not ideal, so if there are other projects which have native support for OpenSSL 1.1, that could be interesting
9:43:24
dim
my limited understanding of the problems is that openssl itself plays tricks with the way it exports symbols, other ssl libs might be clean on that aspect
9:45:14
svillemot
wolfssl seems promising and is packaged; that does not seem to be the case for bearssl
9:46:30
dim
otherwise there's always https://github.com/shrdlu68/cl-tls/ but well I'm worried about using non well tested implementations of should-be-secure stuff
10:00:06
dim
I can find https://github.com/mak08/PolarCL which depends on cl-mbedtls... but for now I can't that that system
11:11:26
Xach
I wish all implementations provided and maintained good ways to make secure connections on every platform they support.
11:38:41
jcowan
Proper tail recursion does not require constant stack, only asymptotically constant stack.
11:40:37
jcowan
Specifically, the implementation must support an unbounded number of active tail calls. How it does that, as always, can vary.
11:42:57
beach
ggole: Can you elaborate? I mean, if they are not reused, the heap will be exhausted rather than the stack.
12:55:41
jmercouris
let's say I have path like #P"/Users/username/file.txt", how can I get "file.txt"?
12:56:04
jmercouris
I was thinking of uiop:unix-namestring and then doing some string parsing, but I figured there must be a better way
14:39:55
jmercouris
I think an obvious starting point might be "is this function used anywhere else"?
14:41:22
antoszka
I don't think I've ever gave it anymore attention than what you've already said. It's this and *maybe* sometimes I'd split a function out for better readability.
14:44:06
jmercouris
so you can use flet to return a function that has the contxt of a parent function, like some sort of closure factory?
14:45:01
pfdietz
Yes, function values (lambdas, too) can cause the context to be preserved, even after the parent function returns.
15:00:00
jcowan
A simple case. There are many functions in CL that take functional arguments, the most ordinary case being map, which passes the elements of a sequence through a function in order to form a sequence of the results.
15:04:58
jcowan
It's not uncommon for the function you pass to involve some of the local context of the call, as in (map 'list (lambda (x) (eq? x y)) some-list)
15:05:55
jcowan
This will return a list of booleans indicating whether each member of some-list is the same object as whatever y may be.
15:08:53
Shinmera
Is there a standard way of determining whether a float is negative? (keep in mind the case of -0.0)
15:13:07
pfdietz
(let ((x -0.0)) (and (<= x 0.0) (not (eql x 0.0)))) ==> T if -0.0 and 0.0 are "different"
15:15:06
Shinmera
The spec mentions this explicitly even: If an implementation supports positive and negative zeros as distinct values, then (eql 0.0 -0.0) returns false. Otherwise, when the syntax -0.0 is read it is interpreted as the value 0.0, and so (eql 0.0 -0.0) returns true.
15:15:16
jcowan
Another approach is to rely on the fact that (sqrt -1+0i) is i, whereas (sqrt -1-0i is -i)
15:18:44
jcowan
A less heavyweight approach is to take 3/x where x is 0.0 or -0.0, which will produce +inf.0 and -inf.0 respectively
15:21:05
jcowan
The spec allows (/ 3.0 0.0) to return +inf.0 (or however you want to spell it) rather than an exception