freenode/#lisp - IRC Chatlog
Search
20:10:35
phoe
I have a class object. I want to remove it from the Lisp system altogether. No live instances of that class remain. Is it enough to call REMOVE-DIRECT-SUBCLASS on all of the direct superclasses of that class and remove all methods that specialize on that class?
20:14:16
LdBeth
phoe: for you question, I think the class is kept somewhere that FIND-CLASS can get it by it's name
20:14:58
phoe
I want to ensure that the class object itself is inaccessible. This means removing everything that links to it from CLOS.
20:40:04
LdBeth
interesting, so seems (setf find-class) to nil is sufficient, all the other things are mop specific, https://groups.google.com/forum/#!topic/comp.lang.lisp/hzQ7RRTK4Lg
20:46:38
flip214
phoe: alternatively just replace your class with one that has no slots - then all the accessors should become invalid at once
20:50:11
phoe
I don't think so. X is then a direct subclass of EMPTY, so there still is a strong reference.
20:51:14
flip214
why should it become a subclass? the (CHANGE-CLASS (FIND-CLASS 'X) 'empty) replaces the _class_ object with (an incompatible) object
20:55:02
phoe
(c2mop:class-direct-subclasses (find-class 'standard-object)) still has a reference to it.
20:55:57
phoe
try it out yourself: (defclass empty () ()) (defclass foo () ()) (change-class (find-class 'foo) 'empty) (c2mop:class-direct-subclasses (find-class 'standard-object))
21:02:53
flip214
my guess is the best we can do is some hack with CHANGE-CLASS - replace the class object with an empty one
21:05:05
phoe
Removing STANDARD-OBJECT as its direct superclass and SETF FIND-CLASS NIL are not enough.
21:08:28
flip214
well, with that SETF you should make it inaccessible. and if there are no more references, it should (might?) be gone at some later time
23:57:43
vms14
I saw a lot of posts of lisp fans saying with no problem that lisp is the best language
23:59:23
phoe
Lisp is just yet another programming language equivalent to almost all others by means of Turing completeness.
23:59:45
phoe
But it's nonetheless a pretty fun and useful one, at least for me, due to its nature of being very bendy and malleable.
0:01:00
phoe
vms14: good. 50% of all Lisp goodness comes from a proper interactive environment such as slime.
0:02:27
vms14
I really liked the first time I've tried emacs with elisp, how you have a file and you can directly execute parts of the file
0:03:52
vms14
I've tried quicklisp to install clx, It's failing when it tries to open connection to the display
0:04:43
phoe
vms14: Lisp and Unix are conflicting concepts. They don't exactly map to each other and the Lisp philosophy is richer than the Unix one.
0:05:15
phoe
In Unix, everything is a file and therefore a stream of bytes. That's a very primitive concept compared to Lisp's object-oriented and typed system.
0:11:41
vms14
this happens when I try to open the display, Xorg works with sockets in a server-client model
0:19:20
phoe
Could you try the example at https://rosettacode.org/wiki/Window_creation/X11#Common_Lisp ?
0:20:06
vms14
I had a lot of problems with libraries and stuff in some programming languages in netbsd
0:22:15
vms14
I know nothing and I guess it's a thing I'll appreciate when I'll understand the language
0:24:08
phoe
Lisp applications are made by bundling the Lisp runtime with each application, so a hello-world app may take multiple megabytes of size (which isn't an issue nowadays)
0:24:39
phoe
Even more if you decide to hand-write the hottest parts of code in assembly (which SBCL allows)
0:26:33
phoe
https://nl.movim.eu/?blog/phoe%40movim.eu/response2-to-5-reasons-why-why-lisp-games-suffer-cdt2CD
0:28:22
phoe
Myself I was stuck in the mindset that languages are immutable and you always need to adapt problems to languages, well, perhaps switch a language for a different one
0:28:40
phoe
And Lisp taught me that it's possible to bend languages to problems in addition to the other way around.
0:32:05
minion
vms14: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
0:32:14
minion
vms14: please see gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
0:36:48
pjb
It uses scheme (it was titled "The Little Lisper" before scheme, but since it uses a lisp-1, it was renamed).
0:37:50
pjb
Actually, the videos were shot at HP, at a private course. But indeed, the teachers were from MIT.
0:37:56
phoe
As for recursion, the most basic example I can think of is https://plaster.tymoon.eu/view/1035#1035
0:39:38
equwal
The call stack carries the value around, but since you don't explicitly use it (like you would in FORTH) it confuses people.
0:39:49
pjb
(defun %len (lst res) (if (null lst) res (%len (cdr lst) (1+ res)))) (defun len (lst) (%len lst 0)) (len '(1 2 3 4)) #| --> 4 |#
0:43:55
equwal
Read the section in SICP where they go though how the tracing works and the way that the shape of it gives away the tail recursion or lack of it. Eventually you will be able to predict what the traces will look like and you'll be ready to go.
5:00:33
no-defun-allowed
i set up xmodmap to switch in and out of greek using alt-space and i realised i have little use for it ):
5:39:31
emaczen
Do we call #'cffi:foreign-funcall-pointer just like cffi:foreign-funcall but with a function pointer as the first argument instead of the string name?
6:02:33
jcowan
There are about 7000 languages, so nobody speaks more than a vanishingly small fraction of them
6:11:24
verisimilitude
The important thing about programming languages is most of them aren't worth learning, also.
6:17:03
jcowan
about one every two weeks, and the half-life at present is about 80 years (one maximum human lifetime)
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