freenode/#lisp - IRC Chatlog
Search
1:26:15
nij
Reading let over lambda, which refers to assembly code every now and then. Any suggestion on getting started with the minimal amount of assembly, so i can enjoy LOL more? :-) thanks!
1:27:20
pfdietz
Xach: yes, a standalone library for LZW. The use case is compressive similarity of strings.
1:28:23
pfdietz
That is, you can estimate how similar two strings are by knowing how much compressing one helps you compress the other.
3:02:15
Nilby
Is calling your unpublished package something like com.flipper-zapper.floop really the only way avoid future clashes? Or is there a better way?
3:14:12
Nilby
I like package-local-nicknames, but it seems I still have rename every existing package to have those long names.
3:40:31
ldb
Nilby: I think it is supposed that while the package author gives a long name, a nickname should also be given
3:44:32
azrazalea
I know i've done this before but i'm blanking on how. I want to create a macro that defines a new class then stores some extra metadata on the class definition symbol (not on the instance). Essentially extra named documentation. Then later retrieve that metadata elsewhere in my program. It's been too long, can someone point me to the docs I need to review for this? I'm struggling to find it.
3:46:53
Nilby
ldb: Hmmm. I guess one can suggest a package-local-nickname in documentation. But a regular nickname can't clash either.
3:48:17
azrazalea
ldb: Once I have the symbol yes, but classes are in a different symbol namespace right? Sorry if terms are wrong, it has been a couple years
3:49:46
Nilby
azrazalea: You could always look up the extra doc in a hash table of the class name symbols. Otherwise you might have to do something more complicated like subclassing standard-object.
3:58:22
Nilby
I always forget about symbol-plists. It's even easier than the hash table way: (setf (get 'boo :extra-doc) "This is cool.") (get 'boo :extra-doc)
3:58:55
azrazalea
Yeah, that's what I'm aiming for but I'm missing something to get the symbol for the class definition and it's probably something obvious lol
6:22:14
asarch
(setf value (or (foo) "Not defined")) <- How can I test (foo) in order that, if "" then the value would be "Not defined"?
6:31:51
Nilby
How about (let ((foo (foo))) (if (or (null foo) (zerop (length foo))) "Not defined" foo))
6:40:50
Nilby
If you don't mind calling (foo) twice, you can just say: (if (zerop (length (foo))) "Not defined" (foo))
7:05:23
azrazalea
I feel like such a beginner again after so long. So I got my whole metadata thing working and everything but now I'm getting an error on my generic function call where it says that there isn't a method specializing with the arguments given but as far as I can tell there is! See sly debug screenshots here: https://imgur.com/a/WZ3PAyA. I am confused. My guess is I'm doing something wrong with how I have my packages setup.
7:06:44
azrazalea
https://gitlab.com/azrazalea/lair-bot/-/tree/commands-refactor is the code, specifically https://gitlab.com/azrazalea/lair-bot/-/blob/commands-refactor/src/main.lisp#L118 for the function call, and https://gitlab.com/azrazalea/lair-bot/-/blob/commands-refactor/src/commands/ping.lisp#L12 for the implementation
7:09:38
azrazalea
Unless I'm reading the output wrong, in the sly debug screenshots the 4th arg is "ping" but it has it on the same line as the 3rd arg
7:10:57
azrazalea
The second half of the second screenshot is the specialization list for the method I am trying to call
7:11:57
azrazalea
My best guess is I somehow have my packages messed up to where my function call isn't "seeing" the defined methods properly
7:19:02
Nilby
It seems correct, so maybe the types got out of sync due to dependencies? Does a re-load of the whole thing help?
7:22:58
Nilby
I'm not really familiar with defmethod*, but could it be somehow specializing on the :void return value?
7:23:31
azrazalea
Yeah, I should probably remove defstar as a potential issue let me try that (and I did reload everything a couple times)
7:27:09
azrazalea
I'm passing the class definition object of my command, not an instance of my command. Duh. Sleepy me
7:32:20
Nilby
Sometimes I wish every project would list the flattened indirect dependencies. It's good to know before you quickload.
7:34:39
Nilby
Nice. It took me writing a dependency viewer before I could figure that out for myself.
7:35:02
azrazalea
I used (remove-duplicates (mapcar #'ql-dist:short-description (flatten (append (ql-dist:dependency-tree :lispcord) (ql-dist:dependency-tree :str) (ql-dist:dependency-tree :local-time) (ql-dist:dependency-tree :defstar) (ql-dist:dependency-tree :iterate)))))
7:37:26
azrazalea
It is one of those things that I technically did for myself but then put in the readme because it is also useful for users.
7:39:18
azrazalea
Sadly it works through quicklisp not asdf so unless your project is on quicklisp you have to do it like I did above
7:52:49
fiddlerwoaroof_
What's the "right way" to set the FDEFINITION of a symbol to a funcallable-standard-object?
7:55:14
fiddlerwoaroof_
I guess I don't understand how a macro like DEFGENERIC should be implemented, though: when does the equivalent of that SETF happen?
7:56:33
beach
ENSURE-GENERIC-FUNCTION checks whether the name is already defined as a generic function.
7:59:33
fiddlerwoaroof_
Well, I have code that works, but I'm not sure if I'm thinking through all the consequences correctly: e.g. making the function available at the time you expect function names to be in scope.
8:01:15
beach
There is an issue between the compilation environment and the run-time environment, though, if that is what you are referring to.
8:03:32
fiddlerwoaroof_
Well, the problem I actually have is that I've been experimenting with defining my own subclass of FUNCALLABLE-STANDARD-OBJECT, and I'm trying to figure out what I need to think about
8:04:01
Nilby
It can sure be an issue if, like me, you tried to use a generic function in a macro in the file it's defined in. But ensure-generic-function can come to the rescue.
8:05:07
beach
fiddlerwoaroof_: At any point in time, you can call (SETF FDEFINITION) to have the name associated with your object.
8:06:47
kpoeck
ansi test question: After I import an uninterned symbol x into a package y, is then the home-package of that symbol x package y? Is this specified somewhere in the clhs? Example in https://gist.github.com/kpoeck/430733f4774cde892166e45855e68dc4
8:07:12
beach
fiddlerwoaroof_: But SET-FUNCALLABLE-INSTANCE-FUNCTION does not alter the binding of the name to your object in any way.
8:36:43
Alfr
beach, IMPORT is specified to set the home package of the symbol, if it doesn't have one.