libera/#commonlisp - IRC Chatlog
Search
0:19:29
Guest17
found https://common-lisp.net/project/asdf/asdf.html#Controlling-where-ASDF-searches-for-systems this. looks like I can just define an environment variable for it at build time
0:46:53
phantomics
Hey everyone, is there a preferred library/macro to write paths for getting contents of nested plists? Like (get-lpath list :a :b :c) instead of (getf (getf (getf list :a) :b) :c)?
0:53:27
mfiano
Can someone remind me of the extended keyword parameter syntax or point me to the relevant section?
0:53:54
mfiano
I would like to write a method for #'shared-initialize that accepts non-keyword-interned &key arguments
0:54:13
phantomics
But they mention that performance isn't their priority, in my case I know I'll always be using a plist so I could just write a macro for that case myself
0:57:05
mfiano
So reading this, am I correct in that in order to supply a non-keyword keyword-name, I must explicitly specify the initial value form?
1:00:50
lotuseater
but (&key (a '())) would be helpful, so one knows from reading that there should go a list
1:02:40
lotuseater
mfiano: and maybe you remember also that you can give a specific keyword predicate too as a third component
1:02:42
mfiano
In this case I have several methods defined on #'shared-initialize specializing on classes that are intended to be abstract mixin classes.
1:03:40
mfiano
To define these classes, a defclass-writing macro is used (instead of defclass), which canonicalizes some things. For example, specifying keyword-interned initargs has a high liklihood of clobbering sibling mixins
1:04:16
mfiano
So I must also be sure to do so in shared-initialize/reinitialize-instance/initialize-instance/etc
1:07:28
mfiano
This is a complicated project I've been writing the design down for like 2 months now. Maybe one of these days said design will be solid enough to implement :)
1:13:12
lotuseater
_death: hm just a minor, wouldn't it be: (defun foo (&key (a b)) (list b)) (foo :a 42) => (42) ?
1:14:08
mfiano
I read AMOP recently, and the authors made a seemingly bold claim that the MOP solves the problem in that no longer do you have to choose flexibility over performance. Anyone that knows the MOP knows that is not _all_ that bold :)
1:14:45
_death
lotuseater: your form has a different meaning.. it defines a FOO function with a keyword parameter named :A, a corresponding variable named A, and a default value form B
1:18:19
mfiano
&key ((a b)) means that the argument will be 'A and the parameter will be B, and bound to NIL if the argument is not supplied.
1:18:30
_death
lotuseater: in the sub-section for keyword parameters, an example is given that shows the corresponding long syntax for the short syntax you used
1:19:11
lotuseater
ACTION is very happy to be allowed being around so many very capable people, honestly
1:26:08
lotuseater
hah from our discussion i tried a simple class slot with ":initarg name" so an instance value for this is given by "'name \"foo\""
1:30:40
mfiano
More like trying to piece pages of my thoughts together on paper before I write the next module
1:33:46
lotuseater
mfiano: your "[ab]using to the limit" gets me to the song "Push it to the limit" ^^
1:35:49
mfiano
Naming things is hard, especially when the minimum description that conveys meaning is overly verbose.
1:36:48
mfiano
overly verbose wouldn't be a problem if it weren't for a high-frequency client interface
1:42:47
mfiano
Designing and coding is usually easy in comparison with nomenclature. I would probably be a good mathematician if I gave it as much attention.
1:45:49
lotuseater
so before (define-symbol-macro thing (gensym "THING")). this would be a line in the book "How to screw things up with elegance"
5:05:34
lotuseater
beach: If you don't mind, I wanted to ask you about the status and your plans with Gsharp. I recommended OpusModus (maybe you heard of it) to a very music-affine friend of mine who also works in that topic and he's already on Mac. I remembered your Gsharp project when he mentioned he used MuseScore.
5:06:34
lotuseater
I wonder how much effort would be needed to port OpusModus for other implementations and Linux.
5:08:15
lotuseater
When someone hears `gsharp` it could be thought of a maybe new programming language by Microsoft accidently.
5:09:40
lotuseater
I saw when skimming through your repo files that you also implement things from Metafont. :) very interesting
5:10:22
beach
When I started Gsharp, there was no good Music font. Now there is a free font and a good standard.
5:10:47
beach
Or, rather, there were music fonts, but they looked like crap on low-resolution displays.
5:11:59
beach
So the idea for Clovetree is to use McCLIM, the new open font standard, and the new open font. I forget the names of the standard and the font.
5:12:48
beach
Otherwise, I will simplify the concepts of Gsharp. It was a mistake to introduce the concept of a "segment" to the user. I did it because I thought I needed it for performance.
5:14:34
lotuseater
Is music one of your other special interests? Writing such applications requires also much domain specific knowledge.
5:15:57
beach
And I took an interest in music engraving. First I read the book by Ted Ross, and that was interesting but very brief.
5:16:02
lotuseater
I remember reading about Knuth, when visiting him at home you have to make a organ pipe session playing with him. :)
5:20:02
beach
A composer is someone who knows about things like harmony and counterpoint. I have studied those a little bit, but not enough to be a composer.
5:20:35
beach
Music engraving, however, is something you can read up on and then implement the rules in software.
5:27:01
beach
To someone who is unfamiliar with music engraving as a domain (like for those composers who think they know everything) it is a very surprising read.
5:28:18
beach
So the main features of a program like this is to implement all these rules, with all the possible variations, while still allowing the user to tweak the result (because it is impossible to totally automate).
5:29:22
beach
I can't imagine what prompted the MuseScore developers to use C++. It seems like a masochistic choice.
5:30:41
beach
So what information are you looking for, and what are your plans? Maybe I already answered all your questions?
5:33:25
beach
I mean, why were you interested in the status of Gsharp in the first place? Do you plan to re-implement OpusModus?
5:34:09
lotuseater
And maybe if you know the geometry "GeoGebra" I would like to have this in McCLIM too, so featuring 100% less Java.
5:35:44
beach
Maybe so. Clovetree is stalled at the moment because I am too busy with Gsharp, but maybe later.
5:40:32
beach
Once I finish bootstrapping, there will be tons of smaller, independent projects like a type of compiler optimization, or some other modules.
5:47:15
beach
Bah, Mandarin has only 4 tones as I recall. Vietnamese has 6 or 8 depending on how you see it.
5:48:14
lotuseater
oh sounds interesting, but maybe if I would learn an Asian human language it would be Japanese I think
5:52:37
beach
I lived in Aotearoa for a year, and tried to organize a Kiwi Common Lisp meetup, but there are only around 5 Lispers within a 3 hour flight radius from Auckland. Very different from Europe.
5:54:06
lotuseater
I never lived in another country yet, but I would want to, if some interesting opportunity opens up and someone would need me.
5:57:42
lotuseater
gilberth said jokingly to me organizing some CL meetup somewhere here central and invite some people, now that the situation gets hopefully better with time. but I would also travel for that to France if other costs are not out of my current financial range
6:50:33
pjb
lotuseater: I also worked a little with gsharp, if you have questions. I have some patches here: https://gitlab.com/abnotation/gsharp I have apending pull request on gsharp to prepare for more PR with my patches… https://github.com/robert-strandh/Gsharp/pulls
6:55:35
pjb
beach: that's nice, all PR merged. I will make new PR with my patches soon (I hope over the week-end). Thanks.
6:55:59
lotuseater
I forked the repo this night and skimmed trough, for example changed some (when foo ...) to (unless (null foo) ...) and such
8:36:02
Duuqnd[m]1
If I have two threads both writing to the same network socket using WRITE-SEQUENCE followed by FORCE-OUTPUT, is there any chance that will cause problems? (I'm using SBCL)
8:43:36
hayley
When in doubt with concurrent programs: Don't Count On It. How sockets interact with threads is somewhat undefined to my knowledge, so you best use a lock if you care.
8:48:02
Duuqnd[m]1
I would do that, but the part that writes to the socket is in a library that I don't really want to modify
8:48:28
Duuqnd[m]1
This program only has to run on SBCL (because I'm the only user) so I can live with some uncertainty
8:49:20
Duuqnd[m]1
There's lots of functions that call the socket writing function and putting a lock around each one would be very inconvenient.
8:51:22
hayley
Well, my apologies then. But having your program break because someone decided to change undocumented behaviour, or worse, having it break completely randomly (cause that's threading for ya), is also very inconvenient.
8:52:54
Duuqnd[m]1
It is indeed. I have to choose between blindly trusting SBCL or making the program much worse to use and I don't like either option. Maybe I'll just add locks in the library after all.
8:54:36
Duuqnd[m]1
All this is because if the socket connection dies while it's listening I have to try to send something down the socket for it to notice that it's dead.
8:55:16
Duuqnd[m]1
A separate thread that pings the server every 10 seconds was the first solution I came up with (admittedly not a great one but the whole program is a soup of bad decisions)
8:56:05
Duuqnd[m]1
I can hardly believe it held out long enough to bridge IRC and Twitch for the two days that ELS needed it
9:01:44
Duuqnd[m]1
I guess I'll be using the worst possible solution: Assume it works until it breaks.
9:02:41
Duuqnd[m]1
I'll probably end up replacing the library with my own thing anyway since CL-IRC doesn't seem to support SASL which Libera usually wants.
9:11:31
pjb
Duuqnd[m]1: you can count on it, on the contrary: count that concurent write-sequence WILL send their data randomly mixed on the socket.
9:12:39
pjb
Duuqnd[m]1: basically, as soon as you have a loop, it's not atomic. Obviously, write-sequence contains loops.