[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] eval in gawk as a regular command
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] eval in gawk as a regular command |
Date: |
Fri, 01 Jan 2016 12:06:23 +0200 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
> > Peng Yu <address@hidden <javascript:;>> wrote:
> >
> > > https://www.gnu.org/software/gawk/manual/html_node/Index.html
> > >
> > > I only find eval as a debugger command. Is it available as a regular
> > command?
> >
> > No, it's not. I do not expect to move it into the language.
>
> Why not, considering that many other languages have eval? This can
> dramatically increase the expression power of a language.
I knew you would ask that question. :-(
There are several reasons.
1. It opens up all kinds of language design issues, such as what do you do
if eval fails? It also likely opens up security problems, where arbitrary
input might get executed as code. These are headaches I'd prefer to
do without.
2. Eval would take gawk very far away from other awks, introducing too
big a portability break.
3. Gawk already has too many features.
As with all Free Software, the code is there. You're welcome to
try and add eval and see what comes out. :-)
Thanks,
Arnold
- Re: [bug-gawk] eval in gawk as a regular command,
Aharon Robbins <=