libera/#commonlisp - IRC Chatlog
Search
11:21:10
semz
but for string concatenation, it's mildly annoying that there is no variant that takes a sequence
11:27:34
cuz
This is a pretty common pattern for me, where I have a function and then I want to apply it to multiple inputs. EG lets say I want to send an email to multiple people but can only send it to one at a time, then I would make a list of each persons email and then apply the email function to each email in that list
11:31:40
kennyd
it doesn't buy you much over reduce. but summing a flat list is probably a lot more common than summing a 2d one. and once you have a flat sum, summing a 2d list is short enough that we don't really need a new function, (mapcar #'sum ...), or (sum (mapcar #'sum ...)), depending on the desired result
11:38:32
scymtym_
etimmons: i'm not aware of anyone hooking Eclector into CL:LOAD. what's the use case?
11:38:33
minion
scymtym_, memo from etimmons: Do you know of any success stories using Eclector as the reader for CL:LOAD (without completely replacing the implementation's reader)? I tried using Fare's reader-interception, but it has issues. Trying to decide if I should fix them or hop to something else that already works.
11:44:28
akater[m]
Krystof: Such operations are certainly very useful in multilinear algebra. But they should probably be in a multilinear algebra system. Wolfram named this one ArrayReduce: https://reference.wolfram.com/language/ref/ArrayReduce.html
12:16:48
akater[m]
kennyd: You're right: if you only have #'+ and not #'sum, it's not the same thing. Wolfram's apply takes a similar spec (“levelspec”) and so a hypothetical (wolfram:apply #'+ matrix '(1)) would effectively reduce the rows of matrix with #'+. It's a common enough operation to have infix for it. I used it quite often; Wolfram is very strongly oriented towards operating on “multidimensional” lists. levelspecs and dimension specs
12:16:49
akater[m]
are offered consistently in the language, where Lisp would offer &rest, essentially. &rest approach is ultimately more limited and less useful when dealing with arrays with higher ranks.
12:21:34
akater[m]
&rest is more handy in very simple cases and conses less, unless the multidimensional-oriented approach implements fusion.
12:22:35
hayley
ACTION thinks petalisp:lazy-reduce or petalisp:lazy-reduce* takes a dimension (RIP petalisp:β)
13:47:36
etimmons
scymtym_: More details after I left the memo. But short story is I've got some package hacks I'd like LOAD and COMPILE-FILE to use.
13:53:47
scymtym_
etimmons: i see. i only have worked towards side stepping the implementation completely (for something like static analysis) which is pretty difficult in general since loading or compiling a file is not just a READ loop. instead READ must be interleaved with certain side effects. "just" replacing the implementation's READ could be easier. an implementation specific solution could be advising CL:READ such that it calls Eclector's READ
13:56:55
etimmons
It was working for a while. But then I had the gall to include a comment at the end of the file and it blew up.
15:07:26
Guest74
midnight is too late to do AoC. I kept reading part two wrong and kept reading the figure horizontally instead of vertically.
15:26:54
pve
etimmons: Hi, I don't know if it helps you at all, but here are my eclector experiments: https://github.com/pve1/eclector-access
15:27:46
pve
etimmons: you can check examples/package-nicknames-test.lisp (or some other file) to see how it works.
15:32:34
attila_lendvai
Xach, oh, i didn't know that's also part of ql... :/ not sure how to handle this, but the dialog started with the author (https://github.com/hu-dwim/hu.dwim.defclass-star/issues/12 and https://github.com/hu-dwim/hu.dwim.defclass-star/pull/7)
15:59:48
etimmons
pve: Thanks! Looks like you pull tricks similar to reader-interception. And even avoid the bug reader-interception fell in to!
16:03:40
etimmons
pve: You wight want to also consider a WITH-ECLECTOR macro, so that any LOADs within its body automatically get the Eclector reader. So that a file can use it without needing to call ENABLE
16:14:00
pve
etimmons: I wonder what would break if I enabled a client globally at startup (e.g. in .sbclrc) that translates all occurrences of cl:load to "my-load"..
16:16:32
jcowan
Probably a good thing to do after writing a long and difficult (to write, not to read!) programming book.
16:17:43
etimmons
pve: Hmmm. Only one way to find out! But You might have trouble making it happen. I think SBCL LOADs .sbclrc, so *READTABLE* is bound. You'd probably have to actually mutate the standard read table, which sounds scary
16:19:38
jcowan
Unicode already defines what "alphanumeric" means, though it does not include APL symbols.
16:19:45
jackdaniel
unicode is a terrible mess, second only to previous situation with gazzilions of incompatible encodings
16:21:02
pve
etimmons: oh, I was under the impression that sbcl does read-eval or something on .sbclrc, and not load
16:21:09
jcowan
Some of the complexity is accidental or historical-only, but most of it is essential complexity: writing systems are complex, end of.
17:14:09
jcowan
Back to Unicode for a second: https://docs.google.com/document/d/1d4xnVAGod2NxjGypwyS9bYlx5kE2VBJu5p4xl5zXEy8 is my original proposal for doing Unicode in the R7RS-small variant of Scheme, and I think it would make sense for CL as well if mechanically translated to use CL function names.
18:17:48
phantomics
jcowan: took a look at the document, the criteria there look good in terms of categorization, the alphabetical and numeric Unicode categories are a bit more expansive that what SBCL has
18:24:09
phantomics
Mainly I see that they include the "number letter" categories that SBCL doesn't, APL characters definitely shouldn't be included, there's something weird with Allegro's system
18:37:53
contrapunctus
attila_lendvai: is this your site? http://dwim.hu/ You may want to serve JS over HTTPS, and update that Freenode link to libera.chat...
18:39:20
attila_lendvai
contrapunctus, thanks for the headsup. that site is somewhat... well, abandoned. there's plenty of potentially useful features that should be fixed/finished, but we're not working much in CL anymore.
18:41:49
attila_lendvai
:) heh, right, when Xach notifies me of the breakage, then i fix our libs up to the point where they compile and run the dwim.hu code
18:42:19
Xach
attila_lendvai: i appreciate it - but if it becomes too much of a bother, please let me know.
18:42:56
attila_lendvai
Xach, no, not at all! i always have the option to not react, so please keep me posted! and thanks for all the work on ql!
18:53:17
attila_lendvai
Xach, i'll communicate that, don't worry. it already feels it was a waste what went into writing all the hu.dwim libs. i don't want to let them bitrot, maybe there are some users out there.
19:15:37
pve
attila_lendvai: Any highlights in those libs you feel we should know about? (I'm not familiar with them)
19:17:49
attila_lendvai
pve, hu.dwim.perec is a rather nice ORM. it has a query compiler that compiles queries given in sexp form to SQL, and when it cannot do that, then it transparently runs it in the lisp VM. it can even compile parts of the query to SQL, and run a hybrid lisp+SQL query
19:19:09
attila_lendvai
hu.dwim.stefil is i think by far the best unit test lib (simply wraps defun to ensure a dynamic environment, but tests are otherwise defun's. very nice experience in slime.)
19:19:38
attila_lendvai
there are all kinds of little utils, like hu.dwim.defclass-star to make defclass less verbose
19:20:26
attila_lendvai
hu.dwim.computed-class is a functional reactive programming lib that makes class slots reactive (they get automatically recalculated as needed)
19:21:06
jcowan
attila_lendvai: Do you have a writeup (other than the source) of the sexp-to-SQL mapping? It's a hard problem.
19:21:25
attila_lendvai
hu.dwim.reiterate is an 80% iterate replacement, but it's much better. it uses a proper walker, hu.dwim.walker.
19:22:45
attila_lendvai
rotateq, we used it on postgresql. another groups used it with oracle, but they made quite some changes. the merging is a pending TODO... for the last several years.
19:23:49
rotateq
attila_lendvai: cool also a lib for lazy evaluation :) read yesterday that Simon Peyton-Jones had his last day at the MS research group
19:24:17
attila_lendvai
pve, i suggest getting it from ql because the darcs HEAD contains half baked stuff. or the LIVE darcs repo from dwim.hu... but you're better off with ql.
19:25:44
pve
because as usual, I was contemplating rolling my own, but I'm not sure that's a good idea :)
19:26:35
attila_lendvai
hu.dwim.lazy-eval is closer to a proof of concept. but we used it in live code. authorization in our web ui was done so that a large form was constructed, and then it got lazy-eval'd, and then automagically evaluated at each point where it was needed. we could even generate english doc from who can do what in the system, and the rules were of course editable
19:28:40
attila_lendvai
jcowan, i know... :/ something broke with the entry point a few years ago. navigating from the dwim.hu menu works, but most project has little useful data. (the UI is constructed based on metadata)
19:29:14
attila_lendvai
to be honest, i'm surprised it's still this functional after some 10 years of potential bitrot.
19:34:47
Guest74
anybody know why slime occassionaly starts indenting forms when trying to use autocomplete? It's pushing my stuff to the end of the screen.
19:38:32
lisp123
Guest74: Never saw that before. Try C-h m and see if you have any indent minor modes active
19:39:04
lisp123
I have Electric-Indent, but perhaps you have something else which may be conflicting with slime
19:39:39
lisp123
Also try #Emacs, there used to be a command / way to debug more estoric issues in Emacs, they might be able to help tell you how to
19:40:20
Guest74
random indententations across sessions, stays pretty constant in same session, might increase.
19:40:50
lisp123
I see. Sounds annoying, but unfortunately I haven't faced that yet so dunno what could be the cause
20:47:07
jackdaniel
some progress with the incremental redisplay in mcclim: https://turtleware.eu/static/paste/incrm-table.mp4
21:20:16
hayley
It would be better to maintain the position of the start of the next numeral to match, rather than creating new strings.
22:07:25
pjb
dre: there was no link in a comment to the specifications, so I guessed that the file only contained integers, and that you didn't really want to just take the first integer on each line.
22:07:52
pjb
just using read should be faster than read-line + parse-integer, if the file is well formed.
22:50:27
dre
it should be "count increases" i guess. it's counting the number of increases from the nth value to the nth + 3 value