freenode/#lisp - IRC Chatlog
Search
10:41:55
beach
Wow, that was a scary bug. In SBCL I did (make-instance 'standard-generic-function :lambda-list '(x)) and initialize-instance signaled an error that the value of the :METHOD-COMBINATION initialization argument had to be a method-combination object, but that instead it was... the STANDARD method-combination object. Restarting SBCL made the problem go away.
10:43:42
beach
The combination of bugs like this (SBCL or my code, doesn't matter much) and inadequate tools for finding the problems makes the task of development less pleasant than it could be, and certainly way more time consuming.
10:50:13
ck_
Were these types of one-off mystery bugs always around like that, or do you think these situations have become more frequent?
10:52:28
ck_
Increased project size that comes with more powerful environments and more people with access to them might be a conceivable reason
10:53:23
beach
Sure. I have no hard evidence that it is a problem with SBCL. But I couldn't guess what I could have done myself to make it happen.
10:54:16
beach
My favorite reason is to blame too complex code, due to many decades of modifications.
11:58:13
flip214
Is there a macro like DESTRUCTURING-BIND that takes an alist in instead of a plist?
12:02:51
jackdaniel
otoh alists are easier to access with functions like find (thanks to the key argument)
12:05:53
flip214
jackdaniel: not matching, just (destructuring-alist (foo bar baz) (function-returning-an-alist) ....)
12:06:29
jackdaniel
could you elaborate? (destructuring-alist (foo bar baz) '((foo bar baz)) ...) ;?
12:09:11
phoe
I understand the syntax to be like (d-a (foo bar baz) '((foo . 1) (bar . 2) (quux . 42) (foo . :one) (baz . 3)) ...)
12:17:00
flip214
well, I guess the name syntax could be extended, again in analogy to lambda parameter lists...
12:20:12
phoe
flip214: you can already get what you want with LET over ASSOC-VALUE; I guess you can write a tiny macro to abstract the syntax
12:20:43
phoe
but I don't really see the point because you will still need to provide both the variable and the alist key
12:21:11
phoe
so LET over a list of explicit ASSOC-VALUEs might still be good enough in the general case
12:23:14
flip214
phoe: but at least I don't have to write assoc, the test, etc., N times (for each binding!)
15:16:24
Kabriel
flip214: Touretzky's book gives an example macro destructuring (like I think you are talking about) on page 431.
15:19:24
Kabriel
Sometimes I use destructing in the loop macro as well, with either local variable initialization (loop with (x . y) = (first alst) ...) or stepping (loop for (x . y) in alst ...) etc.
15:54:54
jackdaniel
some people complained that it is very outdated and convinced the author to take the website down afaik
16:02:38
eta
phoe, (also wrt hexstream, he's definitely violating most of https://docs.github.com/en/free-pro-team@latest/github/site-policy/github-acceptable-use-policies if that's useful)
16:38:05
jmercouris
you could reasonably say it is a false friend because the meaning is too distorted
16:38:31
beach
_death: It is just that the meanings of words change over time after they have been imported.
16:38:34
Bike
yeah, it must be confusing with greek, since english uses a lot of words taken from greek
16:39:03
Bike
but that kind of things happen a lot. my favorite is that "marshal", an extremely high military rank, literally means "horse servant" or "horse keeper"
16:39:21
phoe
jmercouris: anaphoric macros are basically macros that define their own inner context for you to use
16:39:49
mfiano
I think in Greek it means to repeat the same thing, being a word of multiple words in succession, rather than using "it" etc
16:39:52
phoe
if we are talking about some sort of programming language, then "it" in such a context will refer to that language
16:43:14
ck_
was it yesterday or the day before that someone said, not verbatim, "[something like arrows] seems like a a source of confusion when reading other people's code" ?
16:44:09
phoe
arrow macros implicitly bind anonymous vars, whereas anaphora implicitly bind named vars
16:44:20
jmercouris
yesterday all my troubles so far away, now it looks as though they are here to stay, oh I believe, in yesterday...
16:45:42
ck_
Anyway on the topic of any sort of 'dsl' like look or arrows, I think it is all right to require consistency of usage inside a codebase, and not to try achieving some general overarching coding standard
16:48:30
ck_
jmercouris: well, you could achieve that by fixing the randomness seed. Or, if a 'true' source of randomness is used, by relaxing the requirements
16:50:26
_death
generally you want different seeds only for particular fields like games or cryptography
16:50:38
jmercouris
and Pierre was saying, they have to be reproducible so that they can be trusted by the end-user
16:51:06
phoe
as long as you can represent the complete state of your algorithm in a reproducible format, you will have reproducible results
16:51:41
jmercouris
how do the users know that we used our algorithm to produce the model we ship with Nyxt?
16:52:09
save-lisp-or-die
jmercouris If you're interested in where the English word 'anaphora' came from (that is, how it came to be an English word), you have to look to the study of Rhetorical Figures in Classical Greek and Latin poetry by classicists and other folks to study rhetoric in (mostly ancient) literary works.
16:52:36
phoe
if you control the seeds of your randomness, or if you can collect all random input passed to your algorithm, then you can win
16:56:23
easye
"Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin."
16:57:11
save-lisp-or-die
jmercouris: indeed - I think I meant to suggest that it is a piece of technical jargon in a small constellation of abstruse academic fields, and hence, is perhaps a little perverted from any "original" meaning it ought to have had. I agree that it is literally a little confused. Anyway, sorry to be OT.
16:59:20
easye
Knuth's chapter on random algorithms in _The Art of..._ really helped me understand the subject.
17:00:12
ck_
easye: ah right, especially his tale about the "super randomness" algorithm of his college days :)
17:02:26
easye
Yep. It was great to read Knuth talk about his own mistake. Made him even more approachable for the "tall Yoda" that he is.
17:35:20
skidd0
the lets encrypt docs mention using chgrp and chmod 0640 "to allow the server to read /etc/lectsencrpy/live/$domain/privkey.pem"
17:37:10
phoe
if it includes any kinds of environment variables then they must be first resolved and spliced in
17:38:41
phoe
is the user SBCL is running under allowed to read from that file? try with standard unix utils like cat
17:39:03
phoe
at which point I cannot help you because the last time I used selinux I ended up uninstalling it out of frustration
17:41:32
skidd0
ls -la shows the owner and group of that line (live/$domain/privkey.pem -> archive/$domain/privkey1.pem)
17:42:57
phoe
skidd0: you can have nginx as the proxy that communicates with external world via HTTPS
17:43:25
phoe
I've done that setup a few times except, but with haproxy instead of nginx; it's really nice to use.
17:50:32
_death
skidd0: so likely it's either (i) it's not group readable or (ii) you're on in the group
17:51:03
ck_
skidd0: for example: mkdir -p foo/bar; echo "baz" > foo/bar/baz; chmod 440 foo/bar; # ==> cat: foo/bar/baz: Permission denied
17:54:17
ck_
skidd0: failed to put the cat command before the output, but you can hopefully see what I meant
18:29:16
pve
Hello! If I have a function, say "parse-token", that contains a bunch of local functions defined with "labels", can I assume that no memory is allocated at runtime for the labels (i.e. "defining" them) when parse-token is called?
18:37:26
pve
_death: Hmm actually some of them are predicates that get passed to some of the labels in the function, but none of them ever leave the scope of parse-token. Does that change the situation?
18:39:20
Jonatha54
Pico lisp does look look but I guess it's for Linux. am not using linux although I would love to try
18:45:08
wayneeseguin
Also due to history I definitely second the motion that native Emacs modes should do well.
19:02:13
Jonatha54
why do people write irc clients in one language and it's scripting language in other?
19:03:34
aeth
Jonatha54: This false dichotomy was pretty common in the past, especially on Unix-like OSes. CL has always violated this false dichotomy, of course. https://en.wikipedia.org/wiki/Ousterhout's_dichotomy
19:03:37
White_Flame
the question is really "Why do C/C++/Java/etc programmers choose a different language for scripting?"
19:04:02
White_Flame
and the answer is that those languages don't deal with source code at runtime very well
19:04:36
aeth
White_Flame: Right, people see "this compilation takes forever" and then they think "I should embed an interpreter"
19:04:47
White_Flame
phoe: technically it can be done, and has been done. it just sucks and usually is not portable
19:05:40
Jonatha54
that's why I am attracted to erc / rcirc after using all clients. it's source and scripting language are same
19:05:50
White_Flame
eg, generate a C file, call the c compiler to make a dll/so, and link that at runtime, etc
19:07:12
White_Flame
java is slightly more complete in those features, but it's still a huge ball of wax that's not done that often either
19:07:45
White_Flame
and this is why people are so unfamiliar with metaprogramming, or consider it to be unworkable, while Lisp makes it nearly transparent and common
19:10:07
phoe
and I wonder if you can instrument a C compiler to choose one implementation of a function over the other at compilation time... #if and #ifdef come to mind
19:11:21
lotuseater
hm it would be possible to choose special functions like in erlang with foo/1, foo/2, ...
19:12:30
lotuseater
nono, I mean the special functions have the symbols with slash and number of args
19:12:43
iarebatman
Casey (hand made hero) does an interesting thing in his game engine near the very start of his efforts. He goes through the effort to isolate his game engine code from his actual game logic code. He declares all of his game logic code as function pointers that his game engine uses - then he is able to on-the-fly swap out his game logic DLL with a new version..
19:12:53
lotuseater
and then there is macro FOO which looks how many args and chooses right function
19:15:45
decent-username
Hi, I'm having trouble loading SDL2 via quicklisp on OpenBSD. Here's the error: https://paste.gnome.org/pv8qypcev/csrxin/raw . I've already installed c2ffi, but that's apparently not enough. Can anyone maybe help?
19:16:08
decent-username
A lot of fun libraries depend on SDL2. lispbuilder-sdl works fine though. :^D
19:16:39
phoe
like, ASDF's "COMPILE-FILE-ERROR while compiling ..." is not the real error we are looking for
19:18:55
decent-username
phoe: Here's the actual error output: https://paste.gnome.org/ppjaasexj/lrstnr/raw
19:19:51
phoe
can you open /home/user/quicklisp/dists/quicklisp/software/cl-sdl2-20201016-git/src/autowrap.lisp in emacs and try to C-c C-k this file?
19:22:30
phoe
it should signal a more meaningful macroexpansion error rather than just going NIL on you
19:27:31
decent-username
I guess I could create a github account over Tor. Connecting to the web with javascript enabled and over the clearnet is spooky.
19:27:56
wayneeseguin
lotuseater: ZOMG <3 thank you so much for this, I've been reading ancient posts and code to learn, these videos appear to be exactly what I have been looking for <3
20:05:45
pve
lotuseater: it's a bit of a joke, but I made this a long time ago: https://github.com/pve1/incongruent-methods
20:12:12
daphnis
i have a function that takes symbols as arguments that i want to export; but when i call it from another package, the symbols passed to it are from that other package .. what's the normal way to solve this?
20:15:08
Bike
it depends on the nature of the function. sometimes it's nice to allow multiple namespaces
20:17:55
phoe
this changes the interface of that package, and I have no idea why you would like to modify it as a part of standard program operation
20:22:51
daphnis
phoe: say i have a function #'foo in package A that returns a list of entities to which the symbol names given as arguments pertain. f.ex., (foo 'berries) returns a list of berries and (foo 'fruits 'berries) returns a list of fruits and berries. this function can't be exported, it seems
20:32:27
Kabriel
Is there an easy way to replace a symbol in the restvar (e.g. &body) in a macro definition so that you can provide that symbol to the user?
20:33:07
Kabriel
Not provide, but allow them to use it in the body, like loop allows you to use "it".
20:46:41
Kabriel
I would like to use it in a function in a second package, where I can actually use the symbol "line" defined in the macro.
20:47:03
Kabriel
because the packages are different, I have some-package-1::line vs some-package-2::line.
20:48:00
Kabriel
Is there an easy way to replace the symbol in the &body, so that the user of the macro does not have to specifiy the symbol.
20:48:50
iarebatman
Any ECL people on that can help me out? Whenever I try to load cffi on ECL (on windows..sorry....) - I get an error because cffi/toolchain/c-toolchain.lisp is trying to access C:*CC* - which doesn't appear to be set to anything by default in my ECL session
20:51:45
daphnis
pve: yeah, sorry, i meant: it can be exported, but it won't function the same way in B as in A.
20:51:55
iarebatman
I just managed to compile ecl 20.4.24 x64 via msvc compiler as specified in the docs finally. I tried switching to :C and (setf *CC* "gcc") for example, but that doesn't seem to matter.
20:52:00
Kabriel
There must be some way to do it, because loop can figure out what some-package-1:for is.
20:53:17
daphnis
since i only use the symbols as names, i don't want to have to specify their package. maybe keywords are the answer to this, as Bike suggested
21:01:09
Bike
it's just that when the loop macro does its parsing, it looks for loop syntax based on symbol names rather than comparison with a symbol.
21:26:54
Kabriel
Bike: so I guess the way to do that is to parse the body forms; i.e. there isn't some facility in language to do this easily.