From: Wolfgang Denk <wd@denx.de>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
U-Boot Mailing List <u-boot@lists.denx.de>,
Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Joe Hershberger <joe.hershberger@ni.com>
Subject: Re: [PATCH v8 4/8] env: Allow U-Boot scripts to be placed in a .env file
Date: Thu, 21 Oct 2021 11:02:40 +0200 [thread overview]
Message-ID: <3677590.1634806960@gemini.denx.de> (raw)
In-Reply-To: <CAPnjgZ0RiiCuOgxce1mRv=GLzadWfvq6cgn0oHeSfhXrCOZR9Q@mail.gmail.com>
Dear Simon,
In message <CAPnjgZ0RiiCuOgxce1mRv=GLzadWfvq6cgn0oHeSfhXrCOZR9Q@mail.gmail.com> you wrote:
>
> > > var++=fred
> > >
> > > is unambiguous but very confusing. I think it would be better to disallow +
> >
> > It's neither unambiguous nor confusing. It is assigning to "var++".
>
> What? Can you read that again?
Did so, but didn't get what you might mean?
In the "<name><operator><value>" syntax there is no way to define an
operator that starts with a character that is legal at the end o a
name. Especially since usual escape characters like backslash are
also valid characters in a name.
So if you want to maintain the status quo for variable names, you
must use an operator that has no such needs.
> > It is much easier to change what is new and can be defined at will.
i. e. define an operator that is stil trivial to parse (as in an awk
script) and does not clash with name rules.
> > If we define for example that "<name>=+<value>" appends, then we can
> > also define our own escape rules, for example:
> >
> > var=fred assigns
> > var=+fred appends "fred"
> > var=\+fred assignes the value "+fred"
> > var=++fred appends "+fred"
>
> I don't like that at all.
Why not?
Yes, "=+" may be less intuitive than "+=", but then, it's a new
feature, it is esy to use, and it does not clash with any
potentially existing environments.
> It requires an escape for a common case and
Well, I think if appending a value that starts with a '+' charecter
is a "common case", then variable names ending ith a '+' are common
case, too.
And at least my proposal can handle all situations I can think of in
a somewhat reasonable way, and it does not need to place new
restrictions on variable names.
> is very confusing.
Is it?
> Since people will be converting their out-of-tree scripts anyway, they
> can check for this sort of madness at the time. There should be no
> problem.
Agreed. There should be no problem with my proposal - the last 2 of
the 4 example aboves are pathological situations which will not
happen often.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Microsoft Compatibility:
your old Windows 3.11 application crash exactly as the new ones.
next prev parent reply other threads:[~2021-10-21 9:02 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 18:13 [PATCH v8 0/8] env: Allow environment in text files Simon Glass
2021-10-18 18:13 ` [PATCH v8 1/8] binman: Allow timeout to occur in the image or its section Simon Glass
2021-10-19 14:19 ` Marek Behún
2021-10-31 12:57 ` Simon Glass
2021-10-18 18:13 ` [PATCH v8 2/8] sandbox: Drop distro_boot Simon Glass
2021-10-19 14:20 ` Marek Behún
2021-10-18 18:13 ` [PATCH v8 3/8] doc: Move environment documentation to rST Simon Glass
2021-10-19 14:21 ` Marek Behún
2021-10-18 18:13 ` [PATCH v8 4/8] env: Allow U-Boot scripts to be placed in a .env file Simon Glass
2021-10-19 10:57 ` Wolfgang Denk
2021-10-19 14:07 ` Tom Rini
2021-10-19 14:11 ` Simon Glass
2021-10-19 14:25 ` Tom Rini
2021-10-19 15:31 ` Simon Glass
2021-10-19 16:20 ` Wolfgang Denk
2021-10-19 16:24 ` Simon Glass
2021-10-19 16:30 ` Tom Rini
2021-10-19 16:39 ` Simon Glass
2021-10-19 16:44 ` Tom Rini
2021-10-19 18:21 ` Simon Glass
2021-10-21 9:10 ` Wolfgang Denk
2021-10-21 9:05 ` Wolfgang Denk
2021-10-21 9:02 ` Wolfgang Denk [this message]
2021-10-19 16:05 ` Wolfgang Denk
2021-10-19 16:14 ` Simon Glass
2021-10-19 15:57 ` Wolfgang Denk
2021-10-19 15:11 ` Marek Behún
2021-10-18 18:13 ` [PATCH v8 5/8] sandbox: Use a text-based environment Simon Glass
2021-10-19 14:32 ` Marek Behún
2021-10-19 15:52 ` Simon Glass
2021-10-19 16:07 ` Marek Behún
2021-10-18 18:13 ` [PATCH v8 6/8] doc: Mention CONFIG_DEFAULT_ENV_FILE Simon Glass
2021-10-19 14:34 ` Marek Behún
2021-10-19 15:52 ` Simon Glass
2021-10-19 16:07 ` Marek Behún
2021-10-19 18:20 ` Simon Glass
2021-10-18 18:13 ` [PATCH v8 7/8] doc: Improve environment documentation Simon Glass
2021-10-19 14:36 ` Marek Behún
2021-10-18 18:13 ` [PATCH v8 8/8] bootm: Tidy up use of autostart env var Simon Glass
2021-10-19 14:38 ` Marek Behún
2021-10-19 10:48 ` [PATCH v8 0/8] env: Allow environment in text files Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3677590.1634806960@gemini.denx.de \
--to=wd@denx.de \
--cc=joe.hershberger@ni.com \
--cc=rasmus.villemoes@prevas.dk \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox