Here's how it went: https://i.imgur.com/PS6oPsq.png
A pretty incredible developer experience, if you ask me!
Here's how it went: https://i.imgur.com/PS6oPsq.png
A pretty incredible developer experience, if you ask me!
It's lying though when it claims its regexes match the empty parameter cases, right? (The regexes do what's asked, just explanation seems buggy.)
Despite this, for a regex amateur like me I was very impressed. It saved me all the time I’d normally spend head-scratching in Regex101, trying to remember how it works. Instead I could just jump there at the end, validate the matching, and make any small tweaks far easier.
The macro just colour-codes its first parameter presentationally, whilst the rest of the LaTeX needs to be passed to a compute engine for solving. The compute engine doesn't know how to "solve" a colour, hence why I'm trying to strip them out beforehand.
And journals are going to have a real hard time dealing with "paper spam".
Just ask the student in person to explain the paper to you.
Right now it is like when the camera had been around for a few years: People knew it was revolutionary, they went to the cinema to watch a train arrive and got terrified [1]. But compare that to the billions of camera phones, Marvel movies, Hubble, etc.
[1] https://en.wikipedia.org/wiki/L%27Arriv%C3%A9e_d%27un_train_...
;)
"Thou shalt not Code!"* [the secret 4th law of robotics on planet Actually Smart Geeks Here]
* graven image business all over again -- it's a sin ;)
It just meant I could load up Regex101 having already gotten 90% of the way to the end result.
http://tug.ctan.org/info/tex-nutshell/tex-nutshell.pdf
How is ChatGPT's answer wrong? The regex is matching square brackets instead of the correct OPTIONAL curly braces. Unseparated arguments aren't handled. The regex for the id is also wrong. The leading slash is correct, but other than that, the whole fucking thing is wrong!
And of course it can't handle macro calls within the macro arguments (nesting).
It's just an absolute clusterfuck, from top to bottom. The chatbot gave its user a useless piece of garbage, and Hacker News doesn't know enough to throw it away. Instead, we parade it around like some great success!
Fooled by a language model.
The comment you replied to was a one line joke about being bad at regex. I didn't directly or implicitly make any claim about the quality of the output of the chatbot. It's unclear to me how my comment could be reasonably interpreted as "parading it around".
On a tangent:
> Fooled by a language model
I suspect a reasonable person would understand this to be insulting on some level, so I assume you must have seen some other meaning/value in including it such that the "insultingness" is outweighed by the point you're making. I'm not seeing that point though, could you clarify?
Part of elegant development is abstracting at the right places to make your code communicate what it's doing to the next person working on it (which could include future you).
If you ask me, the real boogeyman is lack of programmers' comments that explain what the regex is doing. In other words, the fault lies not with the tools, but PEBKAC.
Regardless, even if my prompt didn’t meet the LaTeX spec exactly, the regex I got back (after just 2 natural-language revisions) saved me a lot of time and hassle, and helped me get the job done in the way I needed it to.
There’s little point judging it to be a “total clusterfuck” without knowing what I’m even trying to achieve in the first place :)
- which may contain 0 or more \parameter macros
- of which each will either have one (\parameter{123}) or two (\parameter{123}{blue}) arguments
... besides regex, how else would you suggest replacing the entire macro with simply the value of its first argument (i.e. 123)?
I can do it in one line with regex, but if there's an easier way, I'm all ears :)