freenode/#lisp - IRC Chatlog
Search
21:44:22
jmercouris
how to loop through element in like (loop for element in list do ...) and have index of element within do part?
21:44:34
jmercouris
I seem to remember needing to have two clauses, but I can't remember how it should look
21:47:58
anamorphic
jkordani: you can do it this way too: (loop for i from 0 for elem in list do ...)
21:52:34
jmercouris
I wish I just knew it better, but it seems like there is so much to learn about it
22:13:05
PuercoPop
loke`: oi, just found stumpwm-dbus, can you share your setup config? Should I look at anything in particular beyond the formatter?
22:14:37
aeth
I thought it was just loop with s-expressions, but it's not, so it has an unnecessary learning curve and is unnecessarily complicated.
22:15:03
aeth
It also apparently only works with iterate:foo symbols, which doesn't really work well with the new style of not using :use for arbitrary packages. It should work on keywords.
22:16:48
aeth
i.e. (loop :for x :in y :collect (1+ x)) would just become (do-loop (:for x :in y) (:collect (1+ x))) and it would be a strict superset of loop so you could easily port loop clauses by adding parentheses.
22:21:05
aeth
The downside (other than having to, in effect, implement loop or port an implementation of loop) would be that it might not be sufficiently s-expressioned (s-expressed?). e.g. (:for-in x y) is Lispier than (:for x :in y)
22:22:24
aeth
(Of course, if it's a superset of loop, (:for x :in y) could be transformed to the preferred (:for-in x y))
22:24:20
aeth
White_Flame: If implemented with destructuring-bind that permits (:for x :then (* 3 x) := 1 :of-type fixnum)
22:24:29
White_Flame
maybe LOOP requires the ordering, but nothing semantically in that list of options does
22:24:55
aeth
White_Flame: I use keywords to implement a loop-like sum macro (for integer summation).
22:27:48
aeth
White_Flame: I would keep the order for LOOP's sections, and might even make them explicit with ()s like (do-loop ((:for x :in y) (:for a :in b)) ...)
22:28:17
aeth
The advantage is that that makes the sections explicit, the disadvantage is that that makes it harder to port existing LOOPs
22:56:28
jcowan
Today I read a claim that ACL2 is the most successful CL application ever; anybody have comments on that?
22:57:57
aeth
Maxima is used by SageMath, which is very popular. https://en.wikipedia.org/wiki/SageMath
22:58:40
aeth
I think Maxima is the only Common Lisp application in Fedora, and it might be a similar situation with other distros.
23:06:02
luis
How about Crash Bandicoot and its 50 million copies? (Not all versions used Lisp though.)
23:28:14
jiby
I've changed my exports (removed one, added other instead) in a trivial pkg and the removed exported symbol is "missing" all the time
23:28:51
jiby
I get that exported symbols would be very stable over time (who's silly enough to change their interface!? =p)
23:35:00
jiby
I'll be damned, neither worked to clear my exported symbol. Loading it again shows the same thing: caught WARNING: ; CL-YOUR-PKG also exports the following symbols: ; (CL-YOUR-PKG:MAIN)
23:35:03
jasom
jcowan: it's probably the only current day CL application for which it is the "one to beat"
23:37:12
jasom
jiby: (delete-package 'cl-your-pkg) (asdf:load-system :force t "my system that defines cl-your-pkg")
23:37:29
jasom
jiby: (delete-package 'cl-your-pkg) (asdf:load-system "my system that defines cl-your-pkg" :force t)
23:38:56
jiby
wow, hardcore. Seems to have cleared the exported symbol! thanks guys! Am I correct in assuming there is a big assumption of "thou shall not remove a symbol from your export" wrt. compatibility?
23:42:47
PuercoPop
loke`: For some reason overriding the stumpwm-dbus:popup-timeout doesn't appear to affect the durationg the timeout is displayed.
23:43:33
jasom
jiby: I don't think so (there is unexport, for example). However, static analysis tools are confused by exported symbols not in the defpackage, which is probably why SBCL warns.
23:44:30
jiby
fair, the warning is early on, and turns into a big fat compile error down the line. it's starting to make sense
23:44:38
jasom
ah "If the new definition is at variance with the current state of that package, the consequences are undefined"
23:45:32
jasom
so changing exports and imports are find, as long as you don't re-evaluate the defpackage form.
23:46:14
jasom
right, if you delete the package, then there is no existing package, and that line doesn't apply
23:52:16
PuercoPop
I'm guessing they don't due to the behaviour I'm observing in stumpwm-dbus but not sure
23:53:03
jasom
function lookups are non-thread-local, but sbcl makes assumptions about when they will be redefined. The same might be true for methods.
23:55:58
jasom
I don't think that PCL had any thread-specific code, but sbcl has divirged quite a bit from it now.
0:00:12
jasom
a simple test caused the method to propagate, but I wasn't running with optimization levels dialed up
0:01:11
jasom
and with optimizations high on the thread function (but not the defmethod) it also propagated.
0:02:09
jasom
My test used an eql specifier for the method "foo" and looked like this: (sb-thread:make-thread (lambda () (declare (optimize (speed 3))) (loop (foo 'foo) (sleep 1))))
0:04:23
jasom
Of course I didn't try e.g. (defmethod ((foo child-class)) ...) then spawn thread and (defmethod ((foo base-clase)) ...) which might be different
1:37:04
WhoTookMyName
Hello. How can I get a bareword like not to expand to something like (not x)? Can I do a macro for that?
1:40:39
WhoTookMyName
So something that expands (defun my-not (x) not) into (defun my-not (x) (not x)) or the like.
1:41:10
WhoTookMyName
The only way I've been able to think of doing it is maybe modifying the readtable in some way.
1:42:03
no-defun-allowed
(setf (fdefinition 'my-not) (fdefinition 'not)) would be how i'd usually handle it
1:47:10
WhoTookMyName
The basic thing I'm working for is to have a "toggle" variable x that switches back and forth when I write x in a function definition or somewhere. This way (toggle toggle) gets shrunk to just toggle, making it less redundant.
1:57:25
no-defun-allowed
threads work on sbcl on macos, linux (x86, not arm) and windows from testing
1:57:54
z3t0
okay, from the manual I can see that threads need to be explicitly enabled when being built, other than on linux
1:59:29
no-defun-allowed
aeth: another one about gitlab CI: can you somehow get the path of the repository from the environment? i mirrored a repo on c-l.net with a different username and it broke
1:59:46
no-defun-allowed
looks stupid to have a "fixed CI" commit where the CI failed: https://gitlab.common-lisp.net/theemacsshibe/cl-decentralise/issues/1
2:33:40
elderK
:P It's really like 1533 here. But I consider whenever I wake, to be logical morning :P
2:34:56
jcowan
The "IRC time zone" is that in which when you join it's morning and when you leave it's evening.
2:39:32
no-defun-allowed
ok it works aeth, see https://gitlab.common-lisp.net/theemacsshibe/cl-decentralise/blob/master/.gitlab-ci.yml#L8
2:52:40
loke`
PuercoPop: I checked my config, and I'm not actually using that fetaure so it may be that it doesn't actually work.
2:54:00
loke`
PuercoPop: Here is my confiog, if you're intersted: https://gist.github.com/lokedhs/f87f4564b56628566c8d7ada23fd1d9e
2:57:02
z3t0
I have rebuilt from the latest source with --fancy but I still get an error saying make-thread is undefined
3:16:58
elderK
What do you do when you have say, a reasonably complicated form for initializing optionals, etc.
3:17:33
elderK
I've seen their style guide - it didn't contain much in the way of formatting information. Although, I'll look again, just in case I missed something.
3:19:42
elderK
Which is only so useful to me. Surely, somewhere, the formatting rules of SLIME must be codified somewhere?
3:35:19
PuercoPop
Thanks for your config, and stumpwm-dbus seems great, do you want to limit the scope to notification or does stuff like battery reporting still in scope?
3:37:13
loke`
I haven't worked on it for quite some time, because frankly it works pretty well for me. :-)
3:38:04
loke`
I had intended to implement support for interactive notifications, but I was waiting for the Stumpwm-native UI. As you may have noticed, I'm using McCLIM right now.
4:20:58
jcowan
Someone gave me a little script that runs Emacs in batch mode to format Lisp code on stdin and writes it to stdout.
5:07:25
aeth
I wonder if there's a way to handle out-of-Quicklisp dependencies without installing git
5:27:51
gendl
elderK: Um, I'm no expert, but from what I know (which is little), you would need a custom hacked macro for that.
5:38:13
cgay
with-slots is defined in terms of slot-value, which seems pretty clearly about defclass.
5:43:23
aeth
gendl: You should always use with-accessors, even with standard-objects (defined via defclass)
5:44:21
aeth
gendl: What I sometimes do is this idiom in a defclass slot definition: :reader foo :accessor %foo
5:44:41
aeth
Then I can with-accessors on %foo internally (it's weird having a writer that's not a reader with with-accessors) but only export foo
5:46:27
aeth
That solves slot-value for internal writing on something that shouldn't otherwise be written.
6:10:58
no-defun-allowed
i would not suggest buying 27 machines for 27 combos, maybe do one OS per box and run VMs on those
6:10:59
gendl
European commission. We got sucked into a euro research project. ("we" being Genworks BV, a Dutch subsidiary we formed to avoid tax issues with foreign bank account for U.S. citizen).
6:11:50
gendl
but the Dutch partners of this EU research project ("Agile"), decided to switch to our Python-based competitor near the beginning of the project
6:12:33
no-defun-allowed
if macOS is in the testing system, the mac will easily cost more than the other two boxes combined so glhf
6:12:39
gendl
so we ended up (with almost no feedback) doing essentially what we wanted to do, for this project.
6:35:01
gendl
No other major wine region placed their top estates in 5, simple, easy to understand categories with those results being officially certified by the French Government.
7:12:20
elderK
Hey guys, I'm trying some IO Stuff. Parsing something form a string. I was wondering if it's possible to like, include a literal newline in a string, such that read-line (when using with-input-from-string) will consider them individual lines
7:14:45
jackdaniel
this yields only first line: (with-input-from-string (s (format nil "hellow~%daniel")) (read-line s)); "hellow"
8:12:29
no-defun-allowed
idk why you have to buy the end of let over lambda to implement forth in lisp, just use -> and ->> as much as possible
8:24:18
no-defun-allowed
in an attempt to escape the parens they do not know the powers of, lisp newbies -- i mean clojure users -- made arrows a thing to describe steps in a "linear" computation without the parens
8:24:19
no-defun-allowed
only problem is it's postfix notation for the most part, which i don't like
8:25:54
no-defun-allowed
for example, (-> link children (aref 0) text) is how i'm extracting the link text from a plump-dom element. notice it's backwards compared to the rest of lisp?
8:27:15
elderK
Hey guys, any idea on how I could like, do read-universe better? https://bitbucket.org/elderK/epidemic/src/default/universe.lisp
8:27:50
elderK
It's kind of annoying thing to read, because I don't know the dimensions of a "universe" when I start reading. The width is determined by the length of the first line in a "universe." Universe "descriptions" are terminated by a blank line, or EOF.
8:29:17
elderK
beach: Is this formatting of Loop (with the do in particular) more standard? https://bitbucket.org/elderK/epidemic/src/default/splitter.lisp
9:22:28
no-defun-allowed
also FOR WIDTH = LINE-LENGTH THEN WIDTH could be improved on but i'm not sure how to do that. i understand you want to keep the original LINE-LENGTH and WITH may not go after FOR but i'll have to check.
9:23:24
no-defun-allowed
i can't read the loop grammar specification that well but clisp and sbcl are fine with it