From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24810 invoked from network); 9 Jul 2021 21:15:57 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 9 Jul 2021 21:15:57 -0000 Received: from 5ess.inri.net ([107.191.111.177]) by 1ess; Fri Jul 9 17:10:01 -0400 2021 Received: from [127.0.0.1] ([107.207.65.229]) by 5ess; Fri Jul 9 16:50:13 -0400 2021 Date: Fri, 09 Jul 2021 16:50:11 -0400 From: Stanley Lieber To: 9front@9front.org In-Reply-To: References: <270BEC567655102DE0C764820FA16F74@eigenstate.org> <4754C6E8-2D26-46FC-B1EB-44AECD8DC0B5@stanleylieber.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: asynchronous ACPI cache content-driven framework Subject: Re: [9front] Re: commit 2f8a59f4b5bfe028c022855acc19666d69eed909 Reply-To: 9front@9front.org Precedence: bulk On July 9, 2021 4:44:19 PM EDT, hiro <23hiro@gmail=2Ecom> wrote: >i finally found a workable example, but i had to troll the irc logs to fi= nd it > >23:36:05 ori =E2=86=92 ok, rc updated - now if you need early exits in >functions, 'fn foo @{=2E=2E=2E; exit; =2E=2E=2E} > > >On 7/9/21, hiro <23hiro@gmail=2Ecom> wrote: >> the examples are all weird=2E i still do not understand what this allow= s >> you to do=2E >> >> On 7/9/21, Stanley Lieber wrote: >>> On July 9, 2021 11:01:19 AM EDT, ori@eigenstate=2Eorg wrote: >>>>Quoth Stanley Lieber : >>>>> On July 9, 2021 3:48:39 AM EDT, Anthony Martin >>>>> wrote: >>>>> >> rc: add subshell-function syntax >>>>> >> >>>>> >> fn foo @{bar} is now equivalent to >>>>> >> fn foo {@{bar}}=2E As a side effect, >>>>> >> this disallows creating functions >>>>> >> named after keywords without first >>>>> >> quoting them=2E >>>>> > >>>>> >Respectfully, this is just wrong=2E @ is a >>>>> >unary operator=2E Repurposing it to define >>>>> >a new special kind of function is a bit >>>>> >much=2E >>>>> > >>>>> >What does this buy you over being explicit >>>>> >at the call site? >>>>> > >>>>> > fn foo { bar } >>>>> > >>>>> > @foo >>>>> > >>>>> >One color of function is enough=2E What's >>>>> >next? >>>>> > >>>>> > fn foo !{ bar } >>>>> > >>>>> >to mean that foo always negates the exit >>>>> >status of its body? >>>>> > >>>>> >The new quoting requirement for functions >>>>> >named after keywords seems fine, on the >>>>> >other hand=2E But is it worth the backwards >>>>> >incompatibility? >>>>> > >>>>> >Thanks, >>>>> > Anthony >>>>> > >>>>> >>>>> if we're introducing breaking changes to important programs like the >>>>> shell, can we please at least post a warning on the mailing list? >>>> >>>>(caveat -- it's compatible unless you >>>>happen to be using functions named '@', >>>>'`', etc -- which, again, you >>>>can't use without quoting=2E) >>>> >>>>I don't think most people even realize >>>>that it's possible to name an rc function: >>>> >>>> '@{this is a valid} function name!' >>>> >>>>Either way, noted -- I'll post next time=2E >>>> >>>> >>> >>> thanks=2E changes to rc are tricky since of all things we expect it to >>> behave >>> consistently from day to day=2E I do think I misunderstood the change >>> itself=2E >>> I've been running sysupdate from cron and piping the output to an e-ma= il >>> to >>> myself -- the commit messages as printed by sysupdate are truncated=2E >>> >>> sl >>> >> > wait, this will exit only the subshell and not the parent? that's useful f= or sure=2E sl