freenode/#lisp - IRC Chatlog
Search
6:22:02
jcowan
How bad would it be if a program ran on SBCL, CMUCL, and CCL, but not ECL. (No, it can't be made portable easily.)
6:30:45
verisimilitude
As a good baseline, you want to make a list of implementations and try to get something working on at least four or five before you release it.
6:32:13
jcowan
I definitely do not care about CLISP or ABCL (which won't work) and not much about the commercial CLs (which will)
6:33:41
verisimilitude
Well, I don't much care about the proprietary Common Lisps either, but I support them if it's feasible and I can learn how from the documentation.
6:34:13
verisimilitude
From my understanding, it's still true, but I don't necessarily have an up-to-date understanding.
6:35:16
jcowan
I prefer not to say at the moment as it is not mine, I am merely doing a bit of research.'
6:36:15
verisimilitude
Well, I'm of the opinion that anything that can be written in standard Common Lisp should be written that way is my point.
6:36:35
verisimilitude
Anything that can't that's still wanted should really try to support every known implementation, if it can.
6:37:32
verisimilitude
This isn't just something that's linking to some C library or something or another, is it?
6:37:36
jcowan
Okay, I was basically looking only for facts, and it seems to me that ECL is an important implementation.
6:59:24
jackdaniel
ECL works fine as a standalone implementation and as a shared object library. Regarding prevailing use, I'd suspect it is used as an implementation. That said ECL is a CL implementation available as a library (shared or static, depends on needs).
7:00:59
jackdaniel
(one perk of having it that way is a fact, that there are working application using Common Lisp on Android (where libecl is accessed via jni)
7:07:04
jackdaniel
there are more applications. I recommend taking a look at eql5-android project for examples if you are interested in something less than mere computations (i.e swank access, REPL and other things)
7:21:18
fouric
would someone quickly remind me how to check to see if an object is an instance of the class named by a given symbol
7:22:04
fouric
i already found that, tried both (typep 'class obj) and (typep (find-class 'class) obj)
7:23:55
fouric
so i read the class-name part and thought that i had the args in the correct positions but was passing in the wrong thing
7:29:33
jcowan
it breaks the idea that a type specifier is the name of a type, as a class is not its own name
7:43:00
phoe
And it's the only possible way when you have classes that don't have globally bound names. TYPE-OF instances of such classes have no name to return - so they have to return the class objects.
7:43:43
phoe
(defclass foo () ()) (defvar *foo* (make-instance 'foo)) (setf (find-class 'foo) nil) (type-of *foo*) ;=> #<class-object>
8:49:34
pjb
jcowan: If you have a CL program that doesn't work on a CL implementation, then it is VERY BAD. Because it means that you are at the mercy of the implementers of the implementations where it works. You are using implementation dependent behavior, and eg. the sbcl implementation changes every month! You are basically playing russian roulette every month with your program!
8:50:42
pjb
jcowan: now, you can mitigate the problem, by structuring your code into two parts, one module that is 100% conforming, and one module that is implementation dependent. This way, at least the 100% conforming module can run everywhere. Put the core functionality in there.
8:55:55
pjb
jcowan: notice that there is no type object in CL. Types are not first class objects in CL since they don't exist. Only type specifiers. Notice also that there are multiple type specifiers for a single type. For example: (member 42) and (integer 42 42) specify the same type. Now, clase objects ARE type objects! They're the only ones in CL. class names are type specifiers, but they have a real type object, the class object.
8:57:02
pjb
For example a string designer such as NIL designates the string "NIL". The string "NIL" designates the string "NIL itself too!
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