freenode/#lisp - IRC Chatlog
Search
4:24:58
aeth
But I'm wondering how deep I can go in making a proxy object, which could have uses where the query macro(s) fail, although the performance would probably not make it anything useful outside of debugging.
4:25:27
Bike
you can obviously define a proxy object and define a print object method on it that prints whatever you want, and the object having data in its slots is immaterial.
4:25:28
aeth
If I could actually have proxy slots instead of proxy accessors, I could use the SLIME inspector itself.
4:26:40
Bike
i think swank has some kind of interface you can customize, but it might not be exported.
4:28:00
aeth
It would be very useful (more useful than just a print, which I can do through a query macro with some small changes) if I could somehow inspect an object and see the slots as if it was an object, even though they're just slots in various arrays.
4:35:10
aeth
Bike: thanks, looks like going beyond that it's defmethod all-slots-for-inspector ((object standard-object))
4:36:06
Bike
shorter version: if you want to inspect weird things, you don't need to parlay that into sweeping ideas about clos
4:38:56
aeth
It looks like swank uses the MOP, so if the MOP is powerful enough to change the concept of what a slot is, I should be able to make it SLIME inspectable without having to modify swank. i.e. if I can make a slot a call to an accessor (well, actually two since I don't actually know what the index is, only what the ID is)
4:40:59
aeth
The inspector is just what I know would be useful now. If I use the MOP, it's possible that there's a future use to the object abstraction.
4:49:22
aeth
One thing I could do that's probably easier and even less efficient is to have a query object, i.e. query into an object or something.
4:49:42
aeth
This is probably the first thing that I would have thought of in a less powerful language without a MOP
4:55:12
aeth
i.e. instead of having the object constructed via the MOP to directly access the slots, I construct an object in a similar way that I would do something like print-entity, except returning an object with populated slots from the accessors instead of writing to a stream.
4:58:36
tko
hmm I just started CL a few minutes about coming from Clojure but I'm curious what this convo is all about
4:59:00
tko
I don't know anything about MOP / CLOS, although CLOS is one of the first things I wanted to look into with common lisp
5:01:24
aeth
tko: I have a very elaborate data structure. Because it's elaborate, it's not easy to inspect the contents in an intuitive way.
5:02:09
aeth
One way to inspect the contents in an intuitive way would be to allocate a temporary standard-object (i.e. an object that's created with a CLOS defclass) that somehow has the same contents because those are trivial to inspect.
5:03:24
aeth
Things are inspected through SLIME, the CL IDE for Emacs. swank is the protocol that SLIME uses to talk to a running CL.
5:04:17
aeth
Technically, other editors and IDEs can write their own SLIME-like thing using swank, but nearly everyone programs CL in Emacs+SLIME.
5:05:35
tko
so the temporary standard object would be like an object that contains all the values of your structure (or less) and that is organized in a way thats easier to read or interpret?
5:06:30
aeth
It would combine all of the pieces of data that represent an entity into one object. Which would be 1/2500 of the data structure, if it's filled to the arbitrary constant cap I set for it.
5:09:26
aeth
I think Bike's alternative approach would be to define methods that swank uses that are ultimately used by the SLIME inspector, i.e. create new things that swank will dispatch on as various relevant defmethods
5:09:40
nyef`
aeth: Or you could "just" declare for SBCL and unportability and implement an INSPECTED-PARTS method.
5:10:54
Bike
i mean, with the whole novel clos thing you're still relying on the inspector working in some particular way with slots
5:11:21
aeth
Would that work, though? I want to inspect one particular ID stored in a large data structure. A simpler example would be e.g. inspecting one node in a tree by providing the tree and what to look up into the tree.
5:13:11
aeth
But since it's only used for debugging it doesn't need to be efficient. I could just allocate an object from a query and then inspect that. Although then if I'm inspecting it live I'd have to do some trick to avoid filling the heap.
5:15:08
aeth
Bike: Hmmm... Or... I could be really lazy and make an object that encapsulates two objects...
5:15:46
Bike
so that you can take advantage of all the standard customization facilities that arne't real, makes sense to me
5:16:24
aeth
Bike: however non-standard things are, my own solution would be even more non-standard and even less supported
5:17:16
Bike
well, my main advice is to try something out rather than write a dissertation over the course of two hours, i'd do well to remember that
5:24:10
dmiles
aeth: well i am glad that I was correct in imagining that you were copying a reference setf-able place
5:29:36
aeth
dmiles: Well, I'm making local bindings to arrays (which does not copy the arrays themselves), and then using symbol-macrolet over accessors that are too complicated for with-accessors (such as aref or my custom array-row accessors)
5:31:40
dmiles
you know for these synthesized objects you are thinking about there is a system for synchronising them.. https://bitbucket.org/tarballs_are_good/cl-locatives
5:32:37
dmiles
you point the object at your proxy and your real thing.. when your proxy changes.. so does the real thing
5:33:03
earl-ducaine
Out of fairness to other CLs and the libraries in the Quicklisp repo, the problem that I described as 'dependancy hell' (for ccl) was only that I was using the wrong CLX library. Once I installed a compatible one using ASDF everything else worked.
5:34:28
aeth
with accessors is the thing that can turn (foo some-object) into foo, so you can (setf foo 42) and it's really (setf (foo some-object) 42)
5:36:10
dmiles
hrrm the package i was thinking of was actually was more in depth.. pjb suggested it to me the other week)
5:36:47
aeth
I took the recommended way of implementing with-accessors and modified it to work on (aref a 42) (aref a 42 0) and my custom array row accessors
6:10:05
aeth
dmiles: proxy with-accessors? as in an object that can call with-accessors (or, actually, with-entity-accessors in this case) on itself every second or something, to keep a somewhat up to date picture of what's going on? Could become a threading mess, though.
14:23:04
ebzzry
I have `sbcl --load quicklisp.lisp --eval '(progn (quicklisp-quickstart:install) (let ((ql-util::*do-not-prompt* t)) (ql:add-to-init-file) (sb-ext:quit))'` but it doesn’t wokr.
14:32:04
scymtym
ebzzry: try sbcl --load quicklisp.lisp --eval '(quicklisp-quickstart:install)' --eval '(let …)' --quit