freenode/lisp - IRC Chatlog
Search
8:31:17
lukego
dammit looks like I'll just disable -Werror in asdf because I don't really understand how to apply a patch to Screamer in my current setup
8:31:55
fiddlerwoaroof
lukego: you can always add a file to your project that does IN-PACKAGE and then redefines
8:32:27
fiddlerwoaroof
Here's the backtrace I'm seeing: https://fwoar.co/pastebin/8da8b90c5df10c1116aefccfe888fa7548ef79ce.nil.html
8:33:42
lukego
maybe the lowest hanging fruit here would be to somehow get quicklisp to apply patches during installation
8:35:00
fiddlerwoaroof
lukego: it's sort of a hack, but you could add a component that's like (:file "patches")
8:35:09
Shinmera
you can build your own quicklisp dist that has different versions of the libraries you want to patch.
8:35:27
lukego
fiddlerwoaroof: but I don't have a private copy of the source tree where the asd file is defined
8:36:01
lukego
I have a few local git checkouts too but I don't like that because it undermines my pinning and upgrading discpline. but okay that would be an acceptable workaround especially for screamer that's not updating rapidly
8:36:24
lukego
fiddlerwoaroof: my project's asd doesn't get loaded because its dependencies have failed to compile
8:37:19
lukego
I think that patches make sense to me. I'll be meaning to make a series of small temporary changes sparsely spread across various dependencies
8:38:09
fiddlerwoaroof
lukego: https://fwoar.co/pastebin/21e29c594ecc6cb4b7bd2cd57d6b31677c72c511.asd.html
8:38:43
lukego
fiddlerwoaroof: that looks neat but you still needed to patch the .asd file defining example
8:39:40
fiddlerwoaroof
Because it's a defsystem-depends-on, it'll be loaded before processing your project's dependencies
8:49:28
phoe
maybe it would be worth to fork screamers to sharplispers and apply the fix there, since it's trivial
8:54:29
scymtym
phoe: sounds good to me. for other projects he created or was involved in (esrap, alexandria), ownership has already been transferred. for esrap, he explicitly blessed the transfer
9:31:11
lukego
Maybe should also hack ASDF to print a user-facing message about upgrading errors to warnings, I found that very confusing
9:46:05
lukego
I know you all think I'm a bad person for using Serapeum's -> macro to declare function types in design-by-contract style, but I'm finding it really useful in practice, I do a bunch more type checking than I usually would and it catches sloppiness like carelessly returning multiple values
9:53:12
flip214
sbcl can infer return types by itself (at least sometimes), so declaring argument types already helps quite a lot
10:01:55
lukego
I'm declaring return types now and appreciating the compiler often telling me that I'm carelessly returning multiple values when I only mean to return one
10:04:31
White_Flame
(the fixnum (case foo (:a 1) (:b 2) (otherwise (call-error ...)))) will cause SBCL to scream, even though (otherwise (error ...)) is fine
10:07:24
Nilby
You never know when error could return: "the kinds of sweeping effects hinted at by this example"
10:09:10
phoe
(declaim (ftype (function () nil) foo)) (defun foo () (error "foo")) (defun bar (x) (the fixnum (case x (:a 1) (:b 2) (otherwise (foo)))))
10:11:59
phoe
(defun bar (x) (labels ((foo () (error "foo"))) (declare (ftype (function () nil) foo)) (the fixnum (case x (:a 1) (:b 2) (otherwise (foo))))))
10:14:07
White_Flame
it tells me that my (syntax-error (&rest rest) ..build error string... (error ...)) function has some wrong derived type, not my declared type
10:16:39
White_Flame
"Result is a (VALUES (OR NUMBER (MEMBER :TRUE :NULL :FALSE NIL)) &OPTIONAL), not a CHARACTER."
10:22:43
White_Flame
and of course a simple extraction of just syntax-error and a single use doesn't trip the error
10:24:13
flip214
If I move the (ERROR ...) out into another function (not even a LABELS) and use it in OTHERWISE, the result is the same
10:27:56
White_Flame
so the :true return value is leaking into the syntax-error derivation for some reason
10:30:04
flip214
White_Flame: the :TRUE is for (eq key :foo) - the error path doesn't return any value
10:30:49
White_Flame
the complaint is for get-num's usage, when read-something's definition is present
10:32:20
phoe
yes, that's invalid, SYNTAX-ERROR neither returns (member :true) nor is supposed to return a fixnum
10:54:00
edgar-rft
where (the fixnum ... (error ...)) IMO is a buggy type declaration, because (error ...) is defined to return *no* values and therefore cannot be a fixnum
10:55:38
flip214
edgar-rft: if it can't ever return, there cannot be a type conflict with the return value (because there is none)
10:58:19
ebrasca
What are Deprecated Functions? ( http://www.lispworks.com/documentation/HyperSpec/Body/01_ha.htm )
11:01:18
edgar-rft
ebrasca: functions that were marked as deprecated in 1994 but still exist in 2021
11:03:20
phoe
these two are highly distinct because a return type of (values) implies that the function is allowed to return at all in the general case
11:03:55
phoe
and you don't ever want #'ERROR (or #'INVOKE-DEBUGGER for the matter) to return at all
11:05:37
edgar-rft
ebrasca: don't worry too much, in a hypothetical CL 2.0 standard (that is unlikely to happen) there might be a dicussion about that :-)
11:23:18
no-defun-allowed
Lisp was so good they never made Lisp 2: <https://en.wikipedia.org/wiki/LISP_2>
11:31:47
no-defun-allowed
"Lisp 2" there refers to a hypothetical successor to the original Lisp (which never happened). Usually Lisp-n refers to the number of namespaces of things that the language manipulates.
11:32:22
no-defun-allowed
edgar-rft probably lost count of how many of such namespaces there are in Common Lisp, so wrote Lisp-n with a free variable.
11:32:47
phoe
there's also the fact that namespaces are user-definable, so n must be a free variable
11:35:52
no-defun-allowed
A crucial part of design-by-contract, where they are legally bound to certain terms and conditions of course.
11:41:41
phoe
but this works, (let ((x '())) (asdf:map-systems (lambda (y) (push (asdf:component-name y) x))) x)
11:48:21
phoe
Lycurgus: I am absolutely unaware of them and I cannot provide any reasoning beacuse of that
11:49:10
phoe
from what I last checked, used likely cost more because they are sold by shops that are not in Amazon's direct shipping reach
11:49:36
phoe
which is weird because apress ships worldwide, but on the other hand resellers still exist and make money
11:49:40
minion
ebrasca: tclcs: The Common Lisp Condition System, https://www.apress.com/us/book/9781484261330
11:52:46
Lycurgus
generally the kindle version is substantially less often less than half the hardcopy
12:19:49
nij
Good morning! I have a lisp file to be run automatically. However, on some machine I don't have certain package, so the symbol PACKAGE:FUN1 may cause an error even at READ time. A workaround is to use (funcall (find-symbol "fun1" "PACKAGE")) instead.. but that means I have to change all of PACKAGE:FUN1 to that long stuff.. is there any better workaround?
12:20:57
phoe
wait a second, if you don't have package named PACKAGE then FIND-SYMBOL will signal an error anyway
12:23:34
phoe
quick and dirty workaround: at the top of your file, (eval-always (ql:quickload :package))
12:26:15
nij
I have lots of package:fun1 in that file.. and changing them all to (find-symbol "fun1" "PACKAGE") seems a little bit dirty and ugly.
12:26:38
phoe
can you extract that into another file and only load it when the system in question is found?
12:28:12
nij
or should i write a macro that replaces any (package:fun1 body..) into (funcall (package:fun1 body..))?
12:29:10
daphnis
what is a way to avoid repetition in cond, when all tests are, say, whether the same value is a member of various lists?
12:34:15
phoe
try to replace the lambda with (alexandria:rcurry #'member :test #'equal) and watch the world burn.
12:39:39
phoe
https://gitlab.common-lisp.net/alexandria/alexandria/-/blob/master/alexandria-1/control-flow.lisp#L3-9
12:40:08
phoe
why would it do that instead of doing an explicit ONCE-ONLY on the test and then FUNCALLing it though?
12:42:05
phoe
in this case, alexandria:switch could be smart and only resolve to FUNCALL if the test is a list whose CAR is neither QUOTE nor FUNCTION
12:42:06
jackdaniel
that said this probably should be smarter, like: atom - return spec, cons and (quite function) - extract, just cons - evaluate
13:09:37
nij
Normally we have to go to emacs and `M-x sly-connect`.. but sometimes I want to hop into a server in a living repl.
13:13:28
Bike
i mean, it woudl be weird conceptually, right? it's not like an sbcl repl is a text editor
13:14:33
Alfr
nij, as a work around, you could securely forward the port swank/slynk listens on to a machine where you have emacs.
13:16:35
_death
in fact looks like someone already did some work https://github.com/lem-project/lem/blob/master/modes/lisp-mode/swank-protocol.lisp
13:16:36
Bike
you could set up your own socket code to do so, though i'm not immediately sure of the point
13:17:56
Bike
but the slime/swank protocol is set up for editors so a lot of it won't make sense where you have a repl instead of an editor
13:25:08
Bike
using an editor protocol for rpc seems like overkill to me. i guess it's easier than developing a smaller protocol and convincing people to implement it
13:26:03
phoe
it avoids the NIH syndrome - there is already a battle-tested protocol and a battle-tested server, so why not
13:27:14
jackdaniel
there was a clim implementation of this protocol (for climacs) - afair its name was "SWINE" ^_^
13:29:24
no-defun-allowed
Does it run in Wine? Then can I debug that combination from a lispm on EINE?
13:32:16
phoe
https://github.com/joaotavora/sly/blob/master/CONTRIBUTING.md#swank-is-now-called-slynk
14:26:47
attila_lendvai
any ASDF experts? i'd like to avoid perform'ing an operation if the output file exists (i.e. regardless of the modification time). any hints? overriding operation-done-p seems to be not enough.
14:33:04
flip214
sorry, I can only offer an opposite hint - if you want to rebuild always, (on linux) you can use a dependency like /proc/stat which is always "current"
14:34:25
attila_lendvai
flip214, my issue is that i don't know what part of ASDF i should hook into. op-done-p is not even called if the input file's mod time is earlier
15:22:31
phoe
Xach: nikodemus replied! I'll make a private fork first, submit some PRs, and then request him to transfer the repository over to sharplispers
15:23:49
phoe
I assume that LOOP APPEND is smart enough to do :from-end t automatically for optimization
15:24:35
phoe
_death: I see you have some screamer changes that have not been mainstreamed, should I take a look at them?
15:31:47
phoe
note that if your lists are fresh and mutable rather than literal/quoted/immutable, you can NCONC them instead of APPENDing, and you'll cons nothing
15:32:27
beach
phoe: yes, but without :from-end t, you still have to traverse a quadratic number of times.
15:33:05
phoe
or rather, the latter will be reclaimable by the GC because the intermediate conses will be collectable
15:34:58
beach
So APPEND without :FROM-END T is quadratic in consing and traversal. NCONC without :FROM-END T is quadratic in traversal only.
15:48:33
phoe
I see that nikodemus just reverted the SBCL change because it broke on clisp for whatever reason
15:49:01
phoe
wouldn't it make more sense to prevent duplicate definitions from being generated in the first place?
15:54:06
phoe
we depend on implementation-defined behavior if we actually do generate multiple definitions
15:56:16
_death
screamer has a good reason for redefining them (when it realizes they are nondeterministic as they call nondeterministic functions that are defined later)
15:58:45
phoe
and that implementations are permitted to specify the consequences, and that portable code must not depend on the results or effects of that situation
15:59:00
phoe
"The consequences are unspecified if functions are redefined individually at run time or multiply defined in the same file."
16:00:45
phoe
since they are also "unpredictable", so in theory two DEFUN FOO in one file can cause... yes, what exactly is permitted?
16:02:25
phoe
sure it is, because when we have two DEFUN FOOs in a row then what exactly does it mean that it's "unpredictable" to have stuff like that
16:03:00
phoe
because unpredictability itself in such a case is anything but harmless if e.g. we completely skip the second DEFUN FOO
16:05:22
MetaYan_
jackdaniel: I just noticed that you were asking for my opinion about something earlier today, but even after reading the backlog, I still can't figure out what about...
16:16:33
_death
not sure the tests cover that code.. I have some screamer code, but may or may not load on clisp without effort
16:18:23
_death
eh, clisp backtraces look crappy with slime.. and no frame-source-location implementation
16:31:22
_death
ok, some of my aoc2020 code that uses screamer fails on clisp, because screamer's walker does not support MACROLET
16:34:34
_death
and clisp's LOOP expands to that.. so I'm not sure screamer is very useful on clisp :)
16:39:06
phoe
a little bit; I plan on giving it some maintenance in order to get the official blessing to move the repo to sharplispers
16:39:24
phoe
and I've been curious about it for a long time, so that's also a chance to get to know it in depth
16:40:29
Shinmera
There's also https://shinmera.github.io/classowary for a linear constraint solver alternative. :)
16:42:13
Shinmera
At least I can guarantee Classowary works well, since I use it quite a bit in my Alloy layouts.
16:58:30
_death
phoe: another thing about screamer, I remember they warn about using stuff like DOLIST/DOTIMES in nondeterministic functions, because it may not establish a new binding on each iteration (it's implementation-defined).. but since they shadow CL symbols like DEFUN, why not also shadow DOLIST and friends to provide just that?.. I've not tried it
16:59:57
_death
phoe: I don't like posting issues :).. to me an issue is a call for action on the maintainer, and I prefer my calls for action to be in the form of pull requests
17:01:05
phoe
(and you can explicitly mention that in the issue text if that makes you feel a little bit better)
17:02:49
phoe
http://nikodemus.github.io/screamer/ does not mention dolist or dotimes or the term "binding"
17:03:20
_death
phoe: that's just what nikodemus wrote.. the original docs are in the papers directory
17:07:01
phoe
and transforming DO macros is going to be simple but I don't think I'll want to make a LOOP wrapper
17:56:14
mfiano
Wasn't there a screamer extensions repository with a questionable license, perhaps not by the same author?
17:58:28
_death
yeah, it has a "You may not distribute the code without prior consent from me.".. I'm guessing 20 years later, someone could ask the author to relicense
18:35:31
phoe
fe[nl]ix: I got a mail from Nikodemus - he'll gladly move it himself once some fixes with PRs are submitted to the original repo
19:03:32
attila_lendvai
luis, ping. would you mind if we made cffi get captured by quicklisp by a moving tag instead of the tarball from cl.net? i.e. tagged-git https://github.com/cffi/cffi.git stable
19:04:11
attila_lendvai
luis, that would make it more flexible for us to designate which state ql should capture... just move a tag, instead of releasing...
19:26:08
attila_lendvai
fe[nl]ix, anyone who has the git commit bit can designate what should go into ql. moving a tag is much less work than releasing, and maybe you don't want to release, yet you want ql to get some patches.
19:27:09
attila_lendvai
another benefit is that ql can capture the sources even if cl.net is down (assuming that github.com will better survive any upcoming internet split)
19:28:18
Odin-
attila_lendvai: I'd guess that depends on whether you end up on the Apple or Facebook side.
19:30:13
attila_lendvai
Odin-, i'm more worried about politicians screwing us up with their geopolitical nonsense...
19:31:10
attila_lendvai
bonus reason: git is a much better versioning tool than named tarballs on random servers...
19:32:10
Odin-
attila_lendvai: Those are all 'soft' splits, and most of the ones that are likely to happen based on the geopolitics are already in place.
20:13:39
copec
Is there a standard name for an initialization function that people like to group everything under for some package?
20:26:58
copec
I read in S-exp from a config file into clos objects, and have a function that does it
20:28:26
copec
I could just (function-name) under a commented init section, but I was wondering if there was a defacto standard, like to make an (init) function or something