1 |
On wto, 2017-06-06 at 19:39 +0200, Michał Górny wrote: |
2 |
> On wto, 2017-06-06 at 14:08 +0200, Alexis Ballier wrote: |
3 |
> > On Mon, 05 Jun 2017 20:10:12 +0200 |
4 |
> > Michał Górny <mgorny@g.o> wrote: |
5 |
> > [...] |
6 |
> > > > > Stand-alone makes little sense (and little trouble) but as you |
7 |
> > > > > could have seen it's used nested in other thingies: |
8 |
> > > > > |
9 |
> > > > > 1. || ( ( a b ) ( c d ) e ) |
10 |
> > > > > |
11 |
> > > > > 2. ?? ( ( a b ) ( c d ) e ) |
12 |
> > > > > |
13 |
> > > > > 3. ^^ ( ( a b ) ( c d ) e ) |
14 |
> > > > |
15 |
> > > > Yeah that's the nesting problem causing a parse error. |
16 |
> > > > Those should be expanded to implications. What I'm relying onto is |
17 |
> > > > all clauses to be of the form '[list of conditions]? [list of |
18 |
> > > > constraints]' |
19 |
> > > |
20 |
> > > I've noticed that you turned the implications into multi-conditions, |
21 |
> > > breaking all my scripts ;-). Is the [list of conditions] conjunctive |
22 |
> > > or disjunctive? |
23 |
> > |
24 |
> > conjunctive as in foo? ( bar? ( baz ) ) -> [foo,bar]?[baz] |
25 |
> |
26 |
> Yeah, I guess that's useful. I didn't do that originally because I |
27 |
> wanted the AST to be fully compatible with REQUIRED_USE in Gentoo. But I |
28 |
> guess it doesn't hurt, and makes a lot of the code simpler. |
29 |
> |
30 |
> I've backported this change and adjusted all the remaining modules to |
31 |
> work with it correctly. |
32 |
> |
33 |
> > |
34 |
> > [...] |
35 |
> > > > > The question is whether we want to: |
36 |
> > > > > |
37 |
> > > > > a. actually try to solve this nesting insanity, |
38 |
> > > > > |
39 |
> > > > > b. declare it unsupported and throw REQUIRED_USE mismatch on user, |
40 |
> > > > > |
41 |
> > > > > c. ban it altogether. |
42 |
> > > > |
43 |
> > > > |
44 |
> > > > I don't think it is *that* insane to support nesting :) |
45 |
> > > > |
46 |
> > > > > ( ^^ ( ?? ( a b ) c ( d e ) ) f ) |
47 |
> > |
48 |
> > If you really need that then you'd need to expand it manually. It seems |
49 |
> > better to have it expanded internally automatically. |
50 |
> > Remember you were the one wanting to keep || & co because they're |
51 |
> > simpler to read and write ;) |
52 |
> > |
53 |
> |
54 |
> Well, I was able to implement the logic for all-of blocks outside |
55 |
> and inside other n-ary constraints, including the necessary logic |
56 |
> transformations. Fun fact is, I was able to do it without implementing |
57 |
> a complete set of logic functions and transformations in AST ;-). |
58 |
> |
59 |
> I've just made it fail (correctly this time) with any other kind of |
60 |
> nesting -- I don't think it's going to have a real use case and even if |
61 |
> it did, there are more readable ways of solving the same problem. |
62 |
> |
63 |
> The question is -- will you rebase now on top of my changes |
64 |
> (and preferably use nice logical changes with good commit messages), |
65 |
> or should I try later to merge the rest of your code in? ;-) |
66 |
> |
67 |
|
68 |
I've rebased your changes and pushed them. However, I didn't alter |
69 |
replace_nary to include '!a...' since it made the results worse for |
70 |
me... it's possible that I did it wrong. |
71 |
|
72 |
There's also some issue with all-of expressions that exhibits itself |
73 |
on ibus. I'll look at that later. |
74 |
|
75 |
-- |
76 |
Best regards, |
77 |
Michał Górny |