freenode/#lisp - IRC Chatlog
Search
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
0:19:35
torbo
Is the runtime of the length function when called on a string in Common Lisp/SBCL (O 1) or (O n), where n is the number of characters in the string?
0:21:53
Bike
there's no formal guarantee or anything, but every lisp implementation i know of implements strings (and arrays generally) as contiguous memory blocks like you'd expect
0:23:23
torbo
Right, I'm wondering whether the size of the contiguous memory block is something that's tracked, or does SBCL have to iterate through it until it gets to the end to find out how big it is.
0:51:02
Bike
technically an implementation could not do this, and instead use null termination or something, but that's pretty unlikely