Gentoo Archives: gentoo-dev

From: konsolebox <konsolebox@×××××.com>
To: gentoo-dev@l.g.o
Cc: Michael Orlitzky <mjo@g.o>
Subject: Re: [gentoo-dev] RFC: Future EAPI version operator changes
Date: Wed, 09 Nov 2016 07:11:09
Message-Id: CAJnmqwbMP=VBfVhE78HDjzOaLjK_dxYvPUOOh3G2XRr+LreuUg@mail.gmail.com
In Reply to: Re: [gentoo-dev] RFC: Future EAPI version operator changes by "Michał Górny"
1 On Tue, Nov 8, 2016 at 11:47 PM, Michał Górny <mgorny@g.o> wrote:
2 > On Tue, 8 Nov 2016 10:39:09 -0500
3 > Michael Orlitzky <mjo@g.o> wrote:
4 >
5 >> On 11/08/2016 09:49 AM, Ulrich Mueller wrote:
6 >> >
7 >> > This wouldn't completely solve it, because we also have a := slot
8 >> > operator.
9 >>
10 >> Oh, duh...
11 >>
12 >>
13 >> > Brackets would help, or some new separator. Pick your poison:
14 >>
15 >> I would really like to have spaces around the infix operators, but then
16 >> we need to separate the dependencies with a delimiter (like a comma).
17 >
18 > Strictly speaking, we don't have to since the lexing should be
19 > predictable enough. Of course, mistakes like missing version following
20 > the operator would result in curious errors.
21 >
22 > The major problem with spaces I see is that it means we end up having
23 > an additional [use] block floating following them.
24
25 Actually after reading replies from others, I got the idea spaces can
26 just be made optional, if we use () and {} over & and | (and also have
27 && the default function). Any operator can be a delimiter for itself
28 or the previous rule:
29
30 'dev-foo/bar>=1.3<1.5' is just synonymous to 'dev-foo/bar >= 1.3 <
31 1.5' or 'dev-foo/bar(>=1.3 <1.5)'. The beauty there is that it's now
32 starting to synchronize with the grouping syntax of DEPEND and
33 RDEPEND. We would only need to add a space or use grouping if it's
34 necessary like after using the := operator.
35
36 [use] blocks can also be placed anywhere if we only use [] for it, and
37 use () and {} for grouping versions/slot/repo rules. And if it would
38 help, the interpreter can now choose to just interpret/store [use]
39 block as another condition element with a different class (e.g. use
40 class) for the sake of simplicity, and restrict it to be only used
41 once and outside any form of grouping.
42
43 There's simplicity in there because you know [] defines flags, while
44 other operators define version rules.
45
46 Btw, & and | can be misused together: dev-foo/bar(condtion & condtion
47 | condition) and it becomes unclear what comes first before another.
48 The current DEPEND and RDEPEND syntax avoids it by having && and ||
49 placed outside of the block. And if you look at it, () is just
50 synonymous to '&& ( ... )', and {} is just synonymous to '|| ( ... )'.
51
52 --
53 konsolebox