freenode/#lisp - IRC Chatlog
Search
4:37:57
iissaacc
whats the go-to library for drawing trees/graphs? looked at a bunch i wondered if anyone had any recommendations for something easy to get going with
4:38:53
iissaacc
doesnt need to be pretty, just so i can easily see the output of my classification experiments
4:45:33
no-defun-allowed
To see a "tree" the way you would expect to see one, you need to tilt your head 45 degrees anti-clockwise (or your monitor 45 degrees clockwise) though.
5:31:37
contrapunctus
So IIUC I can use CommonDoc's document node constructors ( https://commondoc.github.io/docs/nodes.html ) in my parser to emit a tree CommonDoc can read...but I don't understand why Scriba doesn't do that, or what the purpose of the plists it returns is, or where they are documented - https://github.com/CommonDoc/scriba/blob/master/src/parser.lisp
7:36:42
aeth
markasoftware: The most concise way to get a modifiable string out of a literal string is probably to use COPY-SEQ first.
8:02:51
contrapunctus
So if I understand correctly, I can use CommonDoc's document node constructors ( https://commondoc.github.io/docs/nodes.html ) in my parser to emit a tree CommonDoc can use...but why doesn't Scriba do that? What is the purpose of the plists it returns? And where they are documented, if at all? 🤔 https://github.com/CommonDoc/scriba/blob/master/src/parser.lisp
9:40:43
no-defun-allowed
If I provide custom initargs in a slot definition, eg (defclass foo () ((bar :on-fire t)) (:metaclass ...)), should I expect effective-slot-definition-class to get that initarg?
9:43:07
phoe
"The initargs argument is the set of initialization arguments and values that will be passed to make-instance when the effective slot definition metaobject is created."
9:51:42
phoe
on SBCL, make-instance signals an error because :ON-FIRE is not a known keyword argument
9:53:35
no-defun-allowed
I'm going to back out of trying to interpret the MOP, and I'll just restructure this to not use initargs like that.
9:58:28
no-defun-allowed
But, I would say that if it did pass all the initargs, what would it pass for something like (defclass foo () ((a :on-fire t)) ...) (defclass bar (foo) ((a :on-fire nil)) ...)? Merging values like that makes sense for :initargs, :allocation, and so on, but not arbitrary initargs.
10:01:14
beach
Each DIRECT-SLOT-DEFINITION would have that initarg, and COMPUTE-SLOTS must decide how to take all the DIRECT-SLOT-DEFINITIONs for the same slot and compute an EFFECTIVE-SLOT-DEFINITION.
10:08:44
no-defun-allowed
Yeah, I have modified my code to not use different effective slot definition classes, as it would just be a weird way of representing a predicate here.
11:56:07
scymtym
contrapunctus: when tying a parser to a particular result representation, there is often tension between the requirements of further processing steps (often benefit from proper syntax tree with classes and all) on the one hand and simplicity of development, debugging and testing which list-based results provide on the other hand. after a few years, i came up with https://github.com/scymtym/architecture.builder-protocol/ (a variation of