freenode/#lisp - IRC Chatlog
Search
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
17:58:22
fraktor
I'm pretty new to lisp, and I've been trying to learn using SBCL. Is there a (relatively easy) way to make a mostly-portable executable out of lisp code?
18:00:13
aeth
fraktor: Usually you keep one session running, often in an IDE like in SLIME on top of Emacs. Then you launch everything from that session.
18:00:46
aeth
Obviously if you're going to e.g. distribute a desktop application then you'd need to build a standalone executable, though.
18:01:26
HighMemoryDaemon
fraktor: There's also Chicken. It's a Scheme, produces C code, and creates an executable from that. https://call-cc.org/
18:02:18
aeth
Even if you're running a server in production, though, I'd personally assume you'd be running it from the REPL. Standalone executables (afaik) ship the entire implementation so that's for if you don't assume one is already installed.
18:03:59
Bike
pfdietz: guessing at likelihood of delivering something to someone else basedon "I'm pretty new"
18:07:08
fraktor
I would like to be able to distribute programs to other users without making them install sbcl.
18:07:55
Bike
sometimes we get people in here who expect a compile-run cycle like with gcc, and that doesn't work, is all
18:09:45
fraktor
Bike: That's certainly what I'm used to. I've used REPLs for other languages, but not usually with a running program.
18:10:09
pfdietz
If you want to deliver a command line program, you will have some lisp function that gets called on program invocation. You can call this function (or one that it calls after argv parsing) when running your program from the REPL, as you would likely be doing during development.
18:11:27
pjb
Popularisation of Lisp will have to pass thru linux distribution of widely _USED_ lisp software, compiled with a toolset simiar to that of gcc.
18:11:38
aeth
it would look something like this in SBCL: sbcl --noinform --non-interactive --load foo.lisp --eval "(foo:main)"
18:12:09
aeth
foo is the package name and must be included, and main is just a convention so people know where to look for a function like this
18:12:17
pjb
Only once people will notice that several of their unavoidable tools are written in CL, will they start to be interested by and use Common Lisp.
18:12:25
aeth
I probably should have said foobar.lisp to emphasize that the filename and the package name can be different
18:21:51
aeth
pjb: Does your program allow certain implementation-specific flags to be set? e.g. sb-ext:*derive-function-types*
18:38:40
pjb
aeth: I try to avoid writing implementation dependent programs. This driver uses clisp. It would have to be rewritten using portability libraries…
18:54:33
jcowan
FWIW, ten Schemes deliver standalone executables, 8 by compiling to C and 2 by clever packaging of their regular runtimes.
18:58:26
gendl
LispWorks can deliver a "console image" at least as a single file (and probably a full-blown application although I don't have enough experience with LW).