freenode/#lisp - IRC Chatlog
Search
12:04:41
splittist
lukego: you can have multiple accessors for a slot, so you can have the short AND the long names (:
14:55:54
lukego
I'm veering towards having a separate PACKAGE for each kind of IC now and maybe that is accelerating the descent into madness? but I'd quite like to represent each type of pin as its own class, and ICs tend to have pins with the same names but different properties
15:00:44
X-Scale
lukego: are you trying to simulate hardware modules and their interconnections in LISP ?
15:02:02
lukego
no, I'm trying to do design rule checks (enforce requirements specified informally in the datasheet) and to automate the busywork (e.g. add external resistors/capacitors that are required but not interesting enough to bother a human about)
15:04:10
lukego
also I'm trying to blur the line between "schematic" and "board design." I'll do both at the same time as a single operation. So my "schematic" will include board-related requirements e.g. that certain traces can't have vias, must be short, must be wide, etc.
15:22:14
X-Scale
beach: I've been in this channel for around 16 years. I just don't talk much. I mostly lurk :)
15:22:22
flip214
lukego: have the _classes_ of pins (vcc, gnd, GPIO) in one package; and an IC has an array of pins, which are instances of these classes.
15:23:12
flip214
you can also model the pins via multiple inheritance - a specific pin could be an anonymous class with parents (GPIO MISO ANALOG-IN PWM), for example.
15:23:43
lukego
flip214: That's what I'm thinking. But then each IC is different, and a "GPIO" pin for IC FOO is not the same as for IC BAR, so I'm thinking I'll have separate foo:GPIO and bar:GPIO classes (and factor as much as make sense into common superclasses and mixins)
15:25:00
lukego
This might be a bit extreme but it would seem to give maximum flexibility for adding weird and wonderful design rules based on quirks described informally in data sheets
15:26:37
lukego
(Of course I can redo all this later, at the moment I'm just thinking aloud as I make a first pass through a set of datasheets, trying to find some notation for writing down details that I want to capture but aren't really sure about how yet)
15:31:37
flip214
lukego: perhaps it would be more sane to fix quirks by having some additional superclass IC-FOO-QUIRKS-2021/3.2? that would also help to reference the special quirk...
15:32:03
lukego
yeah could be so. I guess that this also fits with having a separate class per pin per IC
15:32:28
lukego
I am maybe a bit drunk on the apparent cheapness of defining classes, we'll see how the hangover is tomorrow...
15:34:20
flip214
lukego: in case of such special quirks, you could simple have a _named_ class for this pin - and override methods on it. for "normal" pins without quirks (are there any?? ;) an anonymous class with inherited behaviour is used.
15:37:25
flip214
but (at least from a debugging POV) it might be much easier to just name them after the IC and pin.
15:37:45
flip214
do you also plan to have multiple revisions of ICs, with slightly different behaviour?
15:46:24
flip214
so you might need a way to clone an IC revision but with a few pins being a different class...
15:48:37
lukego
Just now I have a (pins IC) method that returns the pins i.e. does a make-instance on the appropriate pin classes and assigns them IDs (numbers) to match the datasheet. So I guess for revisions and errata I could make subclasses of the IC and override the PINS method to apply the tweaks
16:27:48
jmercouris
I can "who-calls" and see if there are any entries, of course this is not bulletproof
16:28:09
jmercouris
I'm not looking for a perfect suggestion, just a way to find candidate orphaned defuns
16:37:17
Bike
it's hard to gauge what's actually unused, and what is just used in code you haven't loaded yet, or is intended for repl use
16:37:49
Bike
i suppose if you wanted to mechanize it you could make a list of non exported symbols from your package, see what's fbound, and grep for those
16:40:30
Nilby
Yes, it's probably better to say CCL warns about unused functions in some limited circumstances.
17:27:08
_death
stumbled on https://groups.google.com/forum/message/raw?msg=comp.lang.lisp/O2rT-3JY/5oEQdSWXNy8J
17:43:02
jackdaniel
swank::function-name would be an answer, but as you have pointed out, it is just a conveniance hack (i.e returns a name with which the function was defined)
17:44:00
jmercouris
this list of actions can be a function, a lambda, a symbol (which should point to a function)
17:45:22
heisig
jmercouris: Sounds like a case for funcallable standard objects with additional metadata.
17:48:18
heisig
Of course this means you'll have to wrap closures somehow. But this wrapping is kind of the point, because you want to add additional information for your users.
17:50:58
heisig
You could also have a custom DEFUN-like macro that does the wrapping for top-level definition. Bonus points if that macro supports (interactive ...) clauses :)
17:52:53
Nilby
I do something like that where a user action can just be a form, which can be internally cached as function.
17:53:52
jmercouris
(list "description" 'function1 "description2" #'function3 "description3" (lambda (i) "tomato"))
17:58:01
jackdaniel
you should focus on the actual problem. over and over again you ask, how you can get a salmon - you should either make a contract with a local store or invest in a rod ,)
18:50:46
Josh_2
Is there a library that utilizes metaclasses to save to and load from a file? the format should be a human readable format so that someone could edit it
18:52:34
Josh_2
I'm not fussed about the format, but currently I just save my object as a list, but I assume someone will have written a library that does this for me
19:01:39
Josh_2
does that let me just serialize my class object and save it to a file? I don't need transaction records etc
19:15:26
jasom
I don't know of anything that checks all the boxes, but I think cl-store lets you customize the format, so you might be able to make it human-readable
19:18:40
Josh_2
it just has to be human readable so that users can edit it, plus I need to be able to stop the serialization of some slots
19:22:42
markasoftware
this may or may not be sufficient for you, i wrote it a while back https://paste2.org/6peXV2De
19:23:02
markasoftware
it converts an object and slots into a cons-only structure, which you can then just (print)
19:24:42
jasom
https://github.com/wlbr/cl-marshal never used it, but it hits all of the points including letting you specify which slots of an object should be serialized
19:55:03
jasom
though a few tests I just ran on cl-marshal show some weaknesses; it only marshals to a list, so it is up to you to turn thie list into a string (presumably with *print-readably*. It also does not generate references for non-aggregate types, so you would need *print-circle* to correctly handle gensyms (though that still would only guarantee equality within the serialization, which is the best you
19:57:45
Josh_2
I think I will just utilize some of what markasoftware provided to make it easier to extend my own
20:09:28
cage_
i have not touched the library in years, if you can show some code to reproduce the issue i can try to see what is wrong
20:10:13
cage_
i am quite busy but i will try to address the problem when (and, sadly if) possible :)
20:11:43
Josh_2
https://github.com/K1D77A/Moonbot/blob/master/src/classes.lisp here It's the first class 'moonbot'
20:30:41
cage_
Josh_2, sorry to bother but may i ask to provide the code to initialize the class, sorry for the lazyness
20:36:47
markasoftware
for what it's worth i just discovered that my (consify) will not work on improper lists, i will need to think about this
20:39:37
Josh_2
Thats probably because I specialized my class and put '(communities ..) as one of the slots, while not telling cl-marshal how to marshal a community
20:56:59
cage_
jasom, sorry but my knowlege of the library is a bit rusty, i think the library can already serialze/deserialze symbols so thre is some problem that your code adrress that i can not see at this moment
20:57:27
jasom
cage_: right now it serializes symbols as symbols and does not generate e.g. references for gensyms
20:58:56
jasom
so two problems: 1) the SEXP->(string|bytes) must be package aware 2) the SEXP->(string|bytes) must be *print-circle* aware.
21:01:43
jasom
(let ((*package* <any package>) (*print-circle* t) (*print-readably* t)) (print)) (and similar dynamic bindings for (read)) will work; just about any other way of stringifying the sexp is likely to have subtle bugs
21:03:23
cage_
your code to serialize symbols seems reasonably to me (but take into account i am a bit tired :-)) would you file an pull request?
21:05:28
cage_
honestly my knowelege of CL never would allow me the problem you brougth to my attention here
23:05:11
White_Flame
hmm, cl+ssl doesn't quickload because of a non-exported symbol from usocket. This can't just be me, right?
23:05:25
White_Flame
broke in my old code when I cleared cache, as well as after the latest update-all-dists
23:15:52
White_Flame
yep, I just found an old usocket nested deep in some old libs directory of one of my local-projects symlinks. whee