Path: csiph.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.awk Subject: Re: GNU Awk's types of regular expressions Date: Sat, 30 Nov 2024 12:41:52 +0100 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: <20241128200247.439@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Sat, 30 Nov 2024 12:41:54 +0100 (CET) Injection-Info: dont-email.me; posting-host="a93ceebd70ea799c6b3b04b31dfda7e6"; logging-data="1800950"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/V1Y6jCvUj8m1emUvNCfA8" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:wJg5nFwW85I2fZy0o1Lje3gbSV4= In-Reply-To: <20241128200247.439@kylheku.com> X-Enigmail-Draft-Status: N1110 Xref: csiph.com comp.lang.awk:9869 Coming back to this... On 29.11.2024 05:13, Kaz Kylheku wrote: > [...] > > It could also (in combination with this) be lazy. [...] Yes. There's already something like "on-demand logic" there, where in print > "a_file" the file won't be created or overwritten if the statement doesn't get triggered, and subsequent calls won't overwrite it. So it would indeed be not surprising if such a mechanism is implemented. (But I haven't examined the awk code.) > > Someone will undoubtedly chime in confirming or refuting these > hypotheses. > > It would be pretty silly if these regex objects didn't cache a compiled > regex across multiple uses. True. But, OTOH, in GNU Awk there's a couple functions that are just passed through to other (external) library functions. If these functions happen to support only an interface like match(re,str) where match() supports no [thread-safe] static memory for "re" the caller might have no choice. (Don't know how it's actually implemented.) Janis > [...]