freenode/lisp - IRC Chatlog
Search
19:22:07
asarch
And when I try to dispatch a line like: "agda-stdlib-doc - biblioteca estándar para Agda — documentación"
19:28:29
asarch
Reading its documentation, it seems that there is trick for that: (with-http-response (req ent) (with-http-body (req ent :external-format (crlf-base-ef :iso8859-2)) ... generate and write page here..)
22:55:13
remexre
so I've got a tree of objects, where the leaves can either be of class optimized-leaf or unoptimized-leaf (for example's sake, let's say optimized-leaf is a bit-vector and unoptimized-leaf is a (vector t))
22:55:42
remexre
I want to be able to write values that are trits, where (deftype trit () '(or bit (eql :mu)))
22:55:57
remexre
would the implementation of (write-trit LEAF TRIT) be a reasonable use of change-class?
23:20:08
stylewarning
remexre: if it’s truly bit vectors, why not split the difference and use a specialized array of (UNSIGNED-BYTE 2) or so?
23:20:59
remexre
it's not actually bitvectors :P they're just an example of a representation that can densely store data, but aren't compatible with all the values I wanna store
23:21:21
stylewarning
remexre: Would everything start optimized, then possibly be unoptimized? If the tree is the “owner” of the leaves, I think it’s preferable to mutate the tree instead of changing the class. If the objects are strewn around everywhere, then maybe it’s easier to use change class
23:22:08
remexre
pretty much, yeah; the tree does own the leaves, i.e. the existence of the leaves is an implementation detail
23:24:25
stylewarning
I probably wouldn’t have a WRITE-TRIT function, I’d have functions to operate on the tree instead, and down deep I’d have %WRITE-BIT and %WRITE-TRIT which work on the storages directly
23:25:47
stylewarning
that is, id want to dispatch on the value as soon as possible, not at the last moment when all I’ve got is a lead
23:26:10
remexre
so would WRITE-TRIT-TO-TREE test the leaf types, and do some sorta (setf (left tree) (promote (left tree)))-looking thing?
3:45:22
beach
I find the example/question of remexre impossible to follow because of all the oversimplifications. You can't change the class of a vector, nor of a bit or :mu.
3:59:33
loke
McCLIM from the 19'th of this month is fine, but the latest version throws an SBCL AVER when loading Clouseau
4:12:42
beach
remexre: If I understand what you are doing, it looks similar to what I do in Cluffer. Cluffer is a tree (representing a sequence) of editor lines stored in the leaves of the tree.
4:12:49
beach
At any point in time, one line is "open", so it is represented as a gap buffer for fast updates. Other lines are "closed", so they are represented as something more compact.
4:13:06
beach
When a closed line is about to be modified, the currently open line is first closed. Then I inspect the contents.
4:13:17
beach
If there are objects in it other than characters, I create a simple vector and move the contents of the gap buffer to it.
4:13:28
beach
If it contains only characters, but not only base characters, I create a simple string.
4:13:31
beach
And if it contains only base characters, I create a simple base string. Maybe I haven't implemented all these optimization yet, but that's the idea at least.
4:14:09
beach
remexre: But, since all these objects are instance of built-in classes, I can't reliably use change-class.
4:16:48
beach
I suppose you mean "standard classes". You can use change-class on one of those instances, but that won't change the representation of the wrapped object.
4:19:29
beach
Oh, since I mentioned Cluffer, the entire thing is defined as a bunch of CLOS protocols, allowing client code to customize how lines are represented, how they are opened, and how they are closed.
4:37:31
loke
beach: I don't know about his case specifically, but I think of “primitives” as being objects that fit in a single register. Such as fixnums, characters, etc.
4:46:24
loke
remexre: That would be any class which has STANDARD-CLASS (or a subclass of which) as its metaclass.
4:47:39
beach
loke: Both "classes" (meaning "standard classes") and "primitive classes" (probably meaning "built-in classes") were mentioned.