freenode/#sicl - IRC Chatlog
Search
7:20:24
beach
scymtym: I am a bit stalled. In order to continue with my boot configuration stuff, I think I need help to figure out the right arguments to the Clouseau functions. Now, at some point, I would like to work with you on improving the documentation for extensions, but now is probably not a good time for either of us.
7:21:48
beach
scymtym: Also, am I write in that you could have used FORMAT-PLACE-ROW in your code for `instance'? It looks to me like you must have written FORMAT-PLACE-ROW later, and that you didn't go back and use it for `instance'.
7:22:39
beach
scymtym: Anyway, I have this header object that contains a reference to a class object and a rack. The rack is a vector.
7:23:49
beach
I need to present this header object by taking the slots of the class object, and I need to iterate over the vector elements and the slot objects in parallel, and present each row with the name of the slot and the value it has in the vector.
7:24:21
beach
So is there a combination of arguments to FORMAT-PLACE-ROW that will work for that situation?
7:44:53
scymtym
beach: i'm busy right now but i think we can work this out today. just briefly, FORMAT-PLACE-ROW is only a convenience function. the key is probably a custom place class
8:15:02
beach
I don't know. If you could help me out with the way to present one of my ersatz classes, that would be great.
8:16:52
scymtym
then you need a new place class, analogous to SLOT-PLACE at the top of objects/instance.lisp
8:18:18
scymtym
ok, so i would start with (defclass sicl-slot-place (key-value-place read-only-place) ())
8:19:25
scymtym
you have to supply two operations for such a slot class VALUEP (i.e. is the slot bound?) and VALUE (i.e. value of the slot, if bound)
8:19:59
scymtym
you usually store two pieces of information in a place instance: the "container" and the "cell"
8:20:41
beach
OK. So in my case, the container would be the ersatz object, and the cell would be an index into the rack.
8:20:58
scymtym
the VALUE and VALUEP use this information. for example, standard instances use something like (slot-value (container place) (cell place))
8:24:03
scymtym
yeah, once you have that class, look at INSPECT-SLOTS in the middle of objects/instance.lisp
8:25:08
beach
I am still fairly distracted with taking care of my (admittedly small) family, so I'll work on this stuff off and on today.
8:25:24
scymtym
the basic structure is (formatting-table () (loop for slot in slots do (formatting-place (instance 'sicl-place-class cell present-place present-object) (present-place) (present-object))))
8:26:56
scymtym
i didn't cover the kind-of advanced extension possibilities. but i hope the architecture covers everything we need
8:31:48
beach
Yes, I know. Documenting that kind of stuff might also be considered part of some kind of design documentation for Clouseau itself.
8:32:38
scymtym
there is the DESIGN.org document in the Clouseau directory, but tutorial-style documentation is probably more accessible
8:52:55
shka__
i'm looking for a way to get a decent understanding of state of art in SQL query optimization, as performed by the database engines
8:53:51
beach
I am not the right person for that. Sorry. I learned SQL 30 years ago, but never used it.
10:08:39
beach
scymtym: Using that basic structure, I don't see how the slot name is extracted from the CONS in the CELL.
10:15:41
scymtym
beach: i have mislead you. i now think having the slot name available in CELL is not necessary. the slot itself is presented as a "→" character. you simply print/present the slot name in a column to the left of the one containing the "→"
10:16:31
scymtym
if you want to get fancy, you can make the slot name expand to the slot definition object
10:20:03
beach
I am about to serve lunch to my (admittedly small) family. I'll try this new idea later in the afternoon.
12:50:05
beach
So, when I try to present an ersatz instance, when I call (PRESENT-OBJECT STREAM) on a slot I get an error-printing object and a message from SBCL saying NIL is not a number, presumably from some kind of arithmetic. Whereas if I replace that call with a simple call to FORMAT with the value of the slot, it prints fine. Some slots have NIL as values, some have lists, some have numbers.
12:51:50
beach
But, when I get that error-printing object, there is no backtrace, presumably because Clouseau captures all errors.
12:52:54
scymtym
yes, elaboration is needed in that regard. you can tweak the HANDLE-CASE forms in protocol.lisp and formatting.lisp to get a debugger/backtrace
12:53:44
beach
I might try that. Right now, I am too tired to do any reasonable work, so I'll take a break.