libera/commonlisp - IRC Chatlog
Search
18:20:06
lisp123
Is there a way to get the compiler notes from SLIME (that pop up when one C-c C-k's a file) during the ASDF load-file process?
18:32:56
scymtym
the *slime-compilation* buffer generally contains printed representations of these conditions (and can visit the corresponding source locations)
19:48:44
varjag
let's say i have a list of pairs in some container P, and these individual pairs can also be referenced elsewhere
19:49:33
varjag
i then have some 'child' container C, that can shadow some of these pairs (because its car or cdr are changed)
19:51:11
varjag
and i want the code referencing pairs in P use the values that are shadowed by C if C is supplied
19:52:50
varjag
rn am thinking to do shadowing in C via alist (keyed by original pairs of P) but it's not very pretty
19:58:06
Alfr
varjag, if P doesn't change while C is relevant, you could equip C with the same interface as P but with modifications only stored in C and reads backed by P if there's nothing appropriate in C.
20:06:04
Alfr
varjag, you might want to look up persistent data structures; maybe there's something suitable out there already?
20:07:22
varjag
well i can surely graft something but would really love some memory efficient solution
20:52:48
nature
Is there a way to change the permission bits of a UNIX file other than with (uiop:run-program "chmod something something") ?
21:48:25
MichaelRaskin
Also note, that when you do use command line tools, (uiop:run-program (list "chmod" "u+r" "filename.ext")) is better because no catches with spaces in filenames
21:53:45
fitzsim
UIOP is supposed to be for this type of thing, but symlinks seem to be so difficult to deal with in CL
22:26:18
Xach
fitzsim: iolib and osicat make some tricky assumptions about the availability of either specific foreign libraries or the ability to run a C compiler
22:37:47
fe[nl]ix
you can't really have it any other way without being willing to hand-maintain struct and constant definitions
22:49:41
defaultxr
hi, is anyone aware of anything like py4cl or burgled-batteries but for interfacing with lua code instead of python? i'm considering attempting something along those lines but want to make sure there isn't prior art i'd be uselessly duplicating. neither cliki nor google seem to turn up any project that sounds relevant; the closest result is
22:49:43
defaultxr
https://stackoverflow.com/questions/48353172/calling-lua-from-common-lisp which basically just suggests C FFI as an option.
22:51:34
MetaYan
Xach: Had a look at the quicklisp Failure report and noticed that SBCL 2.1.7.62 is used. For example adw-charting compiles cleanly with SBCL 2.1.9.
22:53:39
defaultxr
^in addition to my question, does anyone have any suggestions for libraries that might be of use in implementing such a thing?
23:04:05
hayley
mfiano: As far as I can tell, the bug in decentralise2 is due to a bad hash function, and the hash table trying to resize indefinitely. Not a fun combination.
23:05:06
hayley
With the feature :LOG-COPYING I get hundreds of messages all reading "Creating a 1048576 element storage vector Finished copying 29783 entries after 1.667e-2 seconds"
23:10:35
hayley
Though...the decentralise2 benchmark is pretty damn fast even with the segmented lock table. Guess I did something right.
23:12:45
hayley
One trick I could use would be to randomize the initial state of the hash function on each resize, to get a different key distribution, but I'd have to write all the hash functions myself, as no one does that.
23:30:02
MetaYan
Xach: Alright, I understand now. ql:quickload passes, but asdf:load-system fails. Thanks.
0:53:03
jcowan
Symbols aren't traditionately GCed, though there is no reason why they should not be if they don't have a value, a function, or a non-nil plist.
3:24:03
semz
Readability, mostly. It's (integer 0 foo), where foo is some (manually) computed constant I'd like to be able to change quickly.
3:26:18
semz
Oh no, that's not what I meant. The type itself is used for optimization in various declarations, but I'd like to give it a name so that it can be easily changed, rather than writing (integer 0 18743218) everywhere.
3:31:24
semz
beach: It's number crunching, so there's a pretty big performance difference (~3x) when I can get away with fixnums
3:32:15
aeth
Personally, I like picking the smallest subset of fixnum and making it a type for numerical code.
3:32:41
aeth
The compiler can help check some additional assumptions... and some optimizations would only apply if it can stay a fixnum, which very small integers can more easily do
3:33:38
aeth
s/the smallest subset of fixnum/the smallest subset of fixnum that the code can get away with using, usually rounded up to a power of two,/
3:34:04
beach
semz: You can use a trick we have used many times for other reasons. You duplicate the code (in a macro obviously), so that the expansion is `(if (typep x 'fixnum) (progn ,@body) (progn ,@body))
5:47:56
opcode
what's considered idiomatic for mapcar'ing a function that takes an argument? I.e. if I have a gargantuan list of strings and I want to apply (uiop:split-string) to them, what's the, um, "lispiest way" of doing that? I guess I could just use (loop)?
5:52:01
beach
MAPCAR is fine if you already have the function defined, but becomes less convenient when you have to create an anonymous function.
5:52:01
opcode
i have this friend who thinks people who use LOOP are heathens but I rather like it lol
5:54:07
opcode
yeah, I guess I was just wondering if there was a cleaner approach I hadn't considered. I'm coming from C# and friends so I'm used to writing for/while loops like they're going out of style
5:54:50
White_Flame
opcode: where is your parameter coming from, and does it change per iteration step?
5:56:52
opcode
may I suggest adding it to the lisp cookbook, which for someone like me is a great resource
5:58:49
White_Flame
I also made do-hash, do-alist, do-plist to have inline bodies as well, syntactically avoiding the lambda form, but those don't collect results
6:00:10
White_Flame
my do-mapcar also supports skipping items, as well as creating multiple output list items for a sinlge input item, though without those it'd be tiny
6:01:23
White_Flame
(defmacro do-mapcar ((key-var &rest lists) &body body) `(mapcar (lambda (,key-var) ,@body) ,@lists))
6:05:09
opcode
it sounds pretty awesome, you should definitely submit a PR to the lisp cookbook folks. As for me I just shoved a lambda in there since my use case is fairly trivial, but I'll keep an eye out for do-mapcar
6:06:18
White_Flame
I don't think alexandria is about purely syntactic conveniences? it's a deliberately conservative library
6:07:49
White_Flame
it's just alexandria's stated scope, as to not be an unbounded kitchen sink library
6:09:42
opcode
White_Flame: the cookbook is basically a repository of "good ways to achieve XYZ" for people like me who aren't familiar with the ecosystem. You come from, say, Go where json parsers and http clients are built into the std library, and you want to know what a reasonably-popular library is without just googling around randomly, then you check the cookbook
6:11:30
Nilby
If you find typing lambda's tedious, try my favorite macro: (defmacro _ (&rest exprs) `(lambda (_) (declare (ignorable _)) ,@exprs))
6:15:47
opcode
I try to avoid writing macros if at all possible, purely for my own sanity when it comes to the inevitable debugging phase
6:16:03
White_Flame
I like the dolist syntax, putting all the header stuff including params, then leaving the rest of the form for the body
6:17:46
Nilby
I know I'm foolish, but I like implicit pararms. I sometimes wish the whole program was implicit.