Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 2020 10:09:56 -0700
From:      Ravi Pokala <rpokala@freebsd.org>
To:        Stefan =?UTF-8?B?RcOfZXI=?= <st_esser@t-online.de>, Jessica Clarke <jrtc27@freebsd.org>
Cc:        Baptiste Daroussin <bapt@FreeBSD.org>, Stefan =?UTF-8?B?RcOfZXI=?= <se@FreeBSD.org>, src-committers <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc
Message-ID:  <AA25A053-AD6A-4289-A350-693E05AAB88A@panasas.com>
In-Reply-To: <42f2dcf3-6eda-fb69-cc95-30a18e716407@t-online.de>
References:  <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <DECD68BB-F720-4CA1-A774-31A4307B24B9@freebsd.org> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> <B5CD5239-007A-4113-9C85-A30654562D99@freebsd.org> <D7D50B4C-DECA-46E4-A084-6E9364DB3647@panasas.com> <7257CDA6-0D66-42EB-9920-90DB90B9CA63@freebsd.org> <42f2dcf3-6eda-fb69-cc95-30a18e716407@t-online.de>

next in thread | previous in thread | raw e-mail | index | archive | help
-----Original Message-----
From: <owner-src-committers@freebsd.org> on behalf of Stefan E=C3=9Fer <st_esse=
r@t-online.de>
Date: 2020-07-30, Thursday at 09:55
To: Jessica Clarke <jrtc27@freebsd.org>, Ravi Pokala <rpokala@freebsd.org>
Cc: Baptiste Daroussin <bapt@FreeBSD.org>, Stefan E=C3=9Fer <se@FreeBSD.org>, s=
rc-committers <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-=
src-head@freebsd.org>
Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals sr=
c tests tests/bc

    Am 30.07.20 um 18:45 schrieb Jessica Clarke:
    > On 30 Jul 2020, at 17:40, Ravi Pokala <rpokala@freebsd.org> wrote:
    >>
    >> -----Original Message-----
    >> From: <owner-src-committers@freebsd.org> on behalf of Jessica Clarke=
 <jrtc27@freebsd.org>
    >> Date: 2020-07-30, Thursday at 09:35
    >> To: Baptiste Daroussin <bapt@FreeBSD.org>
    >> Cc: Stefan E=C3=9Fer <se@FreeBSD.org>, src-committers <src-committers@fr=
eebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@freebsd.org>
    >> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include man=
uals src tests tests/bc
    >>
    >>    On 30 Jul 2020, at 17:31, Baptiste Daroussin <bapt@FreeBSD.org> w=
rote:
    >>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote:
    >>>> On 30 Jul 2020, at 17:20, Baptiste Daroussin <bapt@FreeBSD.org> wr=
ote:
    >>>>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=C3=9Fer wrote:
    >>>>>> Author: se
    >>>>>> Date: Sat Jul 11 07:33:18 2020
    >>>>>> New Revision: 363091
    >>>>>> URL: https://svnweb.freebsd.org/changeset/base/363091
    >>>>>>
    >>>>>> Log:
    >>>>>> Update to version 3.1.3
    >>>>>>
    >>>>> Jumping on that commit, since the switch from our previous bc.
    >>>>>
    >>>>> The output of the interactive bc has changed, the previous versio=
n had a clean
    >>>>> UI, the new version "pollutes" the output with plenty of lines ab=
out the
    >>>>> copyright:
    >>>>>
    >>>>> =3D=3D=3D=3D
    >>>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors
    >>>>> Report bugs at: https://git.yzena.com/gavin/bc
    >>>>>
    >>>>> This is free software with ABSOLUTELY NO WARRANTY.
    >>>>> =3D=3D=3D=3D
    >>>>>
    >>>>> Imagine if all programs where doing that, it would be painful, do=
 you think
    >>>>> upstream can be convinced to remove those lines?
    >>>>>
    >>>>> I no the GNU version also has the same polluted output which was =
one of the
    >>>>> reason I was happy with out previous version of bc.
    >>>>
    >>>> By default both will print such a banner if and only if being call=
ed
    >>>> interactively. You can disable the banner explicitly with -q/--qui=
et
    >>>> for both GNU bc and this bc. I agree it's a bit noisy and would be
    >>>> nicer to not have that printed, but it's not without precedent for
    >>>> REPL-like things.
    >>>
    >>> Yes it is not without precedent for REPL-like things, still I disli=
ke this and
    >>> would be happy to get bc interactive be as nice as the previous one=
 we had :)
    >>>
    >>> If not I will deal with it and just yell internally each time I run=
 it :D
    >>
    >>    `alias bc=3D'bc -q'` / `alias bc bc -q` and preserve your inner zen=
? :)
    >>
    >>    Jess
    >>
    >> I was actually about to complain about the new `dc' not exiting afte=
r evaluating a '-e' expression, without an explicit 'q'. But then I noticed =
the "DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me=
 to discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last on=
e would be helpful here.
    >=20
    > That does feel like the wrong default; even GNU dc doesn't do that, a=
nd
    > the principle of least surprise would suggest exiting is the right
    > thing to do. It's also unlikely you want to evaluate something and th=
en
    > use it interactively.

    Interesting observation - I've got to admit that I hardly ever use dc
    (despite being the owner of a collection of HP UPN calculators ;-) ).

Ironically, I couldn't wrap my head around HP RPN calculators in the '90s, =
so I used a TI-85 or TI-89 instead. Now, I do all my non-trivial math using =
RPN in `dc'. :-)

-Ravi

    I'll forward this to the author of this bc/dc and I'm sure he will
    offer a patched version (unless there are strong reasons for the
    current behavior, e.g. compatibility with another dc ...)

    Regards, STefan





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AA25A053-AD6A-4289-A350-693E05AAB88A>