freenode/#lisp - IRC Chatlog
Search
9:11:37
pjb
It's only because there is no actual type object in CL they use the term specifier instead of designator.
9:12:24
pjb
For example, for classes, there's the notion of class designator, since class objects exist.
9:12:40
phoe
So when you say specifier, I assume a type specifier, since that's the closest thing defined by CLHS.
9:13:46
pjb
Note the definitions for type specifier and class designator: both are of the form: "an X that denotes a Y".
9:14:29
pjb
The only difference, is that in one case, the Y is a first class lisp object, and in the other case, the Y is not.
9:30:10
phoe
I want to get a method that would get called if I called the GF with objects of these classes/specializers.
9:30:50
phoe
COMPUTE-APPLICABLE-METHODS won't help me because I have classes, not instances of these classes.
10:27:01
phoe
Is there a standard function that will return a copy of a list except for its Nth element being replaced by FOO?
11:25:56
pjb
phoe: (substitute-if :two (constantly t) '(0 1 2 3 4 5 6) :start 2 :end (1+ 2)) #| --> (0 1 :two 3 4 5 6) |#
11:30:51
phoe
Is (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) a valid FIND-METHOD call?
11:31:15
phoe
I thought that (find-method #'print-object '() (list (find-class t) (find-class t))) was valid, but surprisingly, the former also works on SBCL.
11:32:21
shka_
phoe: no idea if it is valid, but using find-method with find-class t sounds like you wanted to use other method
11:32:50
phoe
My question is if using nested lists in FIND-METHOD's specializer argument is standard.
11:38:55
Bike
sbcl has some kind of internal "parsing" thing going on, so you can pass (eql foo) and stuff too
12:29:31
pfdietz
The standard does not require FIND-METHOD to signal an error if the specializers are malformed. It does if the specializer list isn't of the proper length, and errorp is true.
12:37:20
phoe
Hey. I just found a bug in my tests by finding a bug in my library by finding a bug in my tests.
13:27:07
pjb
phoe: it's probably valid: find-method searches then for an EQL specifier with those cons objects. Not found -> NIL. :errorp t -> error.
13:31:08
pjb
(find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) is a valid call, you're looking for 2 EQL specializers.
13:31:30
pjb
(find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) #| ERROR: Unknown specializer form (#<built-in-class t>) |#
13:34:30
pjb
So yes, (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) is not valid.
13:34:35
pjb
(find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) #| ERROR: Unknown specializer form (#<built-in-class t>) |#
13:38:02
pjb
phoe: congratulation, you found a sbcl bug. Post an ISSUE if there's not already one about it! ;-)
14:18:10
jmercouris
hi everyone, I'm trying to do something like the following: https://pastebin.com/uArY7zFn
14:18:49
jmercouris
however, I can't see how to do it without writing a recursive function to traverse the sexp and evaluate whatever sexp has a car of :raw
14:19:43
jmercouris
I'm trying to generate elisp code, where I can put raw Common Lisp that will evaluate to some value
14:23:21
phoe
(subst "https://foo/bar" '(:RAW URL) '(PROGN (IF T (PRINT (:RAW URL)) (PRINT "false"))) :test #'equal)
14:24:42
jmercouris
I'm used to the term backtick, I'll have to remember its called backquote in those context, thanks
14:28:11
jcowan
pjb: Your argument (like many of your arguments) proves too much. CL programs that use threads or sockets are commonplace. Using a shim library makes them reasonably portable, but you are still "at the mercy of the implementers" in the sense that any or indeed all of them could remove either functionality next week.
14:28:51
jcowan
There is a difference between non-standardized behavior and undocumented behavior. My author is not proposing to rely on the latter in any way.
14:31:04
_death
I suppose some elisp syntax won't fit so well.. so you could use CL syntax and use an elisp pprint dispatch table
14:43:07
_death
if you want to generate and pretty print code, you should get to know the pretty printer a bit better.. I recommend the hyperspec and chapter 27 in CLtL2.. perhaps also Waters's Lisp Pointers articles
15:10:21
jmercouris
what happens now is all functions are prefixed with the packge (NEXT::FUCNTION-NAME ...)
15:10:35
jmercouris
is there a way to avoid that? as obviously I want to be calling some elisp, where the next package doesn't exist
15:11:09
jmercouris
for example `(youtube-dl-url ,url) --> (PROGN ('NEXT::YOUTUBE-DL-URL \"https://next.atlas.engineer/start\"))
15:19:23
jcowan
that's how various format ~ directives actually work: they rebind one of the printer's variables
15:43:17
specbot
Package Prefixes for Symbols: http://www.lispworks.com/reference/HyperSpec/Body/22_acca.htm