[Libre-soc-bugs] [Bug 1094] insndb instruction database visitor-walker is needed
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Wed Jun 21 19:21:50 BST 2023
https://bugs.libre-soc.org/show_bug.cgi?id=1094
--- Comment #223 from Dmitry Selyutin <ghostmansd at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #222)
> (In reply to Dmitry Selyutin from comment #219)
>
> yeahno then it is a bad idea. us "dictating" the format is a nonstarter.
No, I mean not dicating the formatter, but other functionality. Anyway that
turned out to be simpler (cf. my previous message).
> > perhaps enum values should be replaced with
> > separate classes.
Already done.
>
> as markos said this is taking too long.
>
> path is not a necessary argument to pass given that the walker itself
> is supposed to perform the tracking.
>
> can we please move off of "hypothetical" development and move on
> to "practical use" and see how it works out, then revisit if it
> turns out to be necessary based on actual real-world usage?
Well, handling paths is a real-world usage. We have `pysvp64db tree` command,
which needs exactly that. Yes this _is_ taking so long, because I want to cover
cases I have in mind, and also because [recall the communication we had so
far]. Don't think I don't want to finish this task, the sooner it's finished
the sooner I can start with binutils.
>
> (In reply to Dmitry Selyutin from comment #217)
> > The code which yields only last path component looks much better.
>
> yes. we went over that last week. it should be instanceid.
You're mixing two different unrelated things. The object itself and the way we
reached it. Anyway, as for naming, I think "node" is a perfect name. Are you
fine with it?
> > Considering this statement, can we ensure that the users are capable of
> > reconstructing the whole path if needed?
> >
> > for (node, parent, path, kind) in walker(root):
> > magic(...)
> >
> > How can the magic call construct the whole tree as it was done when we kept
> > the whole paths?
>
> not the API's problem, that is the walker's problem.
This is not about who yields the path. This is about what's yielded. You're
probably speaking of something else. My question is whether the path needs to
be full (to root, upon which we started walking) or to relative (parent).
Anyway, I'm mostly fine with how it looks. I'll return to paths issue when I
handle `pysvp64db tree` command.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list