Re: EVAL?

2018-06-14 Thread Norman Gaywood
On Fri, 15 Jun 2018 at 06:13, Trey Harris wrote: Thanks for the nice examples of IntStr and friends. I was intrigued with this statement at the end: > Also note that using s/printf at all is not encouraged Could you expand on that? > ​ > -- Norman Gaywood, Computer Systems Officer School o

Re: RFE: eval documentation

2018-06-14 Thread ToddAndMargo
On 06/14/2018 02:52 PM, JJ Merelo wrote: El jue., 14 jun. 2018 a las 23:34, ToddAndMargo (>) escribió: On 06/14/2018 02:20 PM, JJ Merelo wrote: > Can you please open an issue in perl6/doc? It's the best to track it, > and also to check that it's

Re: RFE: eval documentation

2018-06-14 Thread JJ Merelo
El jue., 14 jun. 2018 a las 23:34, ToddAndMargo () escribió: > On 06/14/2018 02:20 PM, JJ Merelo wrote: > > Can you please open an issue in perl6/doc? It's the best to track it, > > and also to check that it's been solved to everyone's satisfaction. > > > > If you can't for any reason, I can open

Re: RFE: eval documentation

2018-06-14 Thread ToddAndMargo
On 06/14/2018 02:20 PM, JJ Merelo wrote: Can you please open an issue in perl6/doc? It's the best to track it, and also to check that it's been solved to everyone's satisfaction. If you can't for any reason, I can open it for you, but I'll have to keep coming back to see if it's OK when solved

Re: RFE: eval documentation

2018-06-14 Thread JJ Merelo
jue., 14 jun. 2018 a las 20:12, ToddAndMargo () escribió: > On 06/14/2018 10:31 AM, ToddAndMargo wrote: > > Dear Perl6 Developers, > > > > https://docs.perl6.org/language/5to6-perlfunc#eval > > > > Would you please consider adding > > > > ::('&am

Re: EVAL?

2018-06-14 Thread ToddAndMargo
On 06/14/2018 01:13 PM, Trey Harris wrote: Just a small stylistic thing to mention: On Thu, Jun 14, 2018 at 1:59 AM Todd Chester > wrote: p6        if not $dir.IO.d.bool {}        for  slice  "\n", $WebStr   ->  $Line { }   and on and on and so

Re: EVAL?

2018-06-14 Thread ToddAndMargo
On 06/14/2018 11:10 AM, Elizabeth Mattijsen wrote: We are all maintainers of the glossary. Patches / Pull Requests are welcome. Hi Elizabeth, My favorite definition I found was: http://www.yourdictionary.com/pragma (computing, programming) A compiler directive; data embedded in so

Re: EVAL?

2018-06-14 Thread Trey Harris
Just a small stylistic thing to mention: On Thu, Jun 14, 2018 at 1:59 AM Todd Chester wrote: p6 >if not $dir.IO.d.bool {} >for slice "\n", $WebStr -> $Line { } > > and on and on and so forth. I know a lot of them by heart now. > By .bool, I assume you meant .Bool, but in

Re: RFE: eval documentation

2018-06-14 Thread ToddAndMargo
On 06/14/2018 10:31 AM, ToddAndMargo wrote: Dear Perl6 Developers, https://docs.perl6.org/language/5to6-perlfunc#eval Would you please consider adding ::('&' ~ $RunSpecific)() &::($RunSpecific)() to the documentation, as well as an explanation of the error messa

Re: EVAL?

2018-06-14 Thread Elizabeth Mattijsen
We are all maintainers of the glossary. Patches / Pull Requests are welcome. > On 14 Jun 2018, at 20:03, Brandon Allbery wrote: > > I'm trying to not second-guess whoever maintains the glossary. And by that > message also pointing up the omission. > > On Thu, Jun 14, 2018 at 2:01 PM The Sidhe

Re: EVAL?

2018-06-14 Thread Brandon Allbery
I'm trying to not second-guess whoever maintains the glossary. And by that message also pointing up the omission. On Thu, Jun 14, 2018 at 2:01 PM The Sidhekin wrote: > On Thu, Jun 14, 2018 at 7:57 PM, Brandon Allbery > wrote: > >> You can never be certain in *any* case. Check if you're not sure

Re: EVAL?

2018-06-14 Thread The Sidhekin
On Thu, Jun 14, 2018 at 7:57 PM, Brandon Allbery wrote: > You can never be certain in *any* case. Check if you're not sure what it > means. Because sometimes languages use some term in a way you don't expect, > whether because they drew it from some specific discipline (Haskell uses a > lot of te

Re: EVAL?

2018-06-14 Thread Brandon Allbery
Not to mention "language designer isn't from your culture, and the word has different connotations in theirs". The eastern (or for that matter western) US does not define the world. On Thu, Jun 14, 2018 at 1:57 PM Brandon Allbery wrote: > You can never be certain in *any* case. Check if you're n

Re: EVAL?

2018-06-14 Thread The Sidhekin
On Thu, Jun 14, 2018 at 7:46 PM, ToddAndMargo wrote: > On 06/14/2018 10:43 AM, The Sidhekin wrote: > >> >>More relevant, Perl 6 documentation: https://docs.perl6.org/languag >> e/pragmas >> > > You are presuming I knew the word was a Perl word. > I though it was English, as in pragmatic >

Re: EVAL?

2018-06-14 Thread Brandon Allbery
You can never be certain in *any* case. Check if you're not sure what it means. Because sometimes languages use some term in a way you don't expect, whether because they drew it from some specific discipline (Haskell uses a lot of terminilogy from abstract mathematics, for example) or for some reas

Re: EVAL?

2018-06-14 Thread ToddAndMargo
On 06/14/2018 10:49 AM, Brandon Allbery wrote: That's actually the origin of it: pragmatic / real-world behavior, as opposed to idealized situations. I can't always tell when things are English and when things are Perl.

Re: EVAL?

2018-06-14 Thread Brandon Allbery
That's actually the origin of it: pragmatic / real-world behavior, as opposed to idealized situations. On Thu, Jun 14, 2018 at 1:47 PM ToddAndMargo wrote: > On 06/14/2018 10:43 AM, The Sidhekin wrote: > > > >More relevant, Perl 6 documentation: > > https://docs.perl6.org/language/pragmas > >

Re: RFE: eval documentation

2018-06-14 Thread ToddAndMargo
On 06/14/2018 10:45 AM, Brandon Allbery wrote: I think the message is obscure for a reason: the last thing you want is for someone to make an insecure module look "safe" by just dropping that pragma into it. You want to make them think about what they are doing. I hate always having to ask abo

Re: EVAL?

2018-06-14 Thread ToddAndMargo
On 06/14/2018 10:43 AM, The Sidhekin wrote:   More relevant, Perl 6 documentation: https://docs.perl6.org/language/pragmas You are presuming I knew the word was a Perl word. I though it was English, as in pragmatic

Re: RFE: eval documentation

2018-06-14 Thread Brandon Allbery
l6 Developers, > > https://docs.perl6.org/language/5to6-perlfunc#eval > > Would you please consider adding > > ::('&' ~ $RunSpecific)() > &::($RunSpecific)() > > to the documentation, as well as an explanation of > the error message when usin

Re: EVAL?

2018-06-14 Thread Brandon Allbery
ontrol various kinds of unsafe or > > dangerous behavior, including direct access to the mechanisms underneath > > / "supporting" Rakudo and things like EVAL. Other all-uppercase names > > also generally represent "dangerous" actions or options. > > > >

Re: EVAL?

2018-06-14 Thread The Sidhekin
d: This hint ("use the MONKEY-SEE-NO-EVAL pragma to override this error, but only if you're VERY sure your data contains no injection attacks") is rather terse for those who need it ... might it be better if the error message instead referenced documentation? Eirik

Re: EVAL?

2018-06-14 Thread ToddAndMargo
ess to the mechanisms underneath / "supporting" Rakudo and things like EVAL. Other all-uppercase names also generally represent "dangerous" actions or options. There are a few pragmas that are all lowercase instead of all uppercase; they also change the compiler's behavior, bu

Re: EVAL?

2018-06-14 Thread Brandon Allbery
kudo and things like EVAL. Other all-uppercase names also generally represent "dangerous" actions or options. There are a few pragmas that are all lowercase instead of all uppercase; they also change the compiler's behavior, but are safer than the all-uppercase ones. "use lib&q

RFE: eval documentation

2018-06-14 Thread ToddAndMargo
Dear Perl6 Developers, https://docs.perl6.org/language/5to6-perlfunc#eval Would you please consider adding ::('&' ~ $RunSpecific)() &::($RunSpecific)() to the documentation, as well as an explanation of the error message when using EVAL ===SORRY!=== Error whi

Re: EVAL?

2018-06-14 Thread ToddAndMargo
On 06/13/2018 12:27 PM, Brandon Allbery wrote: Exactly what it says: eval is a code injection attack waiting to happen. If you actually need it, you get to do your own data sanitization, and you tell Perl 6 you did so with "use MONKEY-SEE-NO-EVAL;". Hi Brandon, Thank you for clari

Re: EVAL?

2018-06-14 Thread ToddAndMargo
On 06/14/2018 09:11 AM, Timo Paulssen wrote: If it's literally just the name of a sub that you'll immediately invoke, you can side-step EVAL completely     ::('&' ~ $RunSpecific)() should do the trick. ::("&foo") will give you the sub object, and puttin

Re: EVAL?

2018-06-14 Thread Elizabeth Mattijsen
> On 14 Jun 2018, at 18:19, The Sidhekin wrote: > > On Thu, Jun 14, 2018 at 6:11 PM, Timo Paulssen wrote: > If it's literally just the name of a sub that you'll immediately invoke, > you can side-step EVAL completely > > ::('&' ~ $RunS

Re: EVAL?

2018-06-14 Thread The Sidhekin
On Thu, Jun 14, 2018 at 6:11 PM, Timo Paulssen wrote: > If it's literally just the name of a sub that you'll immediately invoke, > you can side-step EVAL completely > > ::('&' ~ $RunSpecific)() > > should do the trick. > I haven't been muc

Re: EVAL?

2018-06-14 Thread Timo Paulssen
If it's literally just the name of a sub that you'll immediately invoke, you can side-step EVAL completely     ::('&' ~ $RunSpecific)() should do the trick. ::("&foo") will give you the sub object, and putting () after it will immediately call it. It wi

Re: EVAL?

2018-06-14 Thread ToddAndMargo
<mailto:toddandma...@zoho.com>> wrote: On 06/13/2018 12:27 PM, Brandon Allbery wrote: use MONKEY-SEE-NO-EVAL; Thank you. Someone had fun with that name! Do I presume there is not other way around the issue? On 06/14/2018 05:21 AM, The Sidhekin wrote: On Th

Re: EVAL?

2018-06-14 Thread The Sidhekin
On Thu, Jun 14, 2018 at 8:01 AM, Todd Chester wrote: > > > On 06/13/2018 12:27 PM, Brandon Allbery wrote: > >> use MONKEY-SEE-NO-EVAL; >> > > Thank you. Someone had fun with that name! > > Do I presume there is not other way around the issue? > That

Re: EVAL?

2018-06-13 Thread Todd Chester
On 06/13/2018 12:27 PM, Brandon Allbery wrote: use MONKEY-SEE-NO-EVAL; Thank you. Someone had fun with that name! Do I presume there is not other way around the issue?

Re: EVAL?

2018-06-13 Thread Todd Chester
On Wed, 13 Jun 2018 15:23:56 -0700 yary wrote > Pet peeve, "$RunSpecific" with the quotes on either side is exactly the same as $RunSpecific without the quotes. Perl isn't shell. > > -y Hi Yary, Chuckle. Missed one. What?? Or two or three ... This program that I have been co

Re: EVAL?

2018-06-13 Thread Elizabeth Mattijsen
quotes on either side is exactly the same > as $RunSpecific without the quotes. Perl isn't shell. > > -y > > On Wed, Jun 13, 2018 at 12:27 PM, Brandon Allbery wrote: > Exactly what it says: eval is a code injection attack waiting to happen. If > you actually need it, you

Re: EVAL?

2018-06-13 Thread yary
Pet peeve, "$RunSpecific" with the quotes on either side is exactly the same as $RunSpecific without the quotes. Perl isn't shell. -y On Wed, Jun 13, 2018 at 12:27 PM, Brandon Allbery wrote: > Exactly what it says: eval is a code injection attack waiting to happen. > If

Re: EVAL?

2018-06-13 Thread Brandon Allbery
Exactly what it says: eval is a code injection attack waiting to happen. If you actually need it, you get to do your own data sanitization, and you tell Perl 6 you did so with "use MONKEY-SEE-NO-EVAL;". On Wed, Jun 13, 2018 at 3:22 PM ToddAndMargo wrote: > Hi All, > > I am c

EVAL?

2018-06-13 Thread ToddAndMargo
Hi All, I am converting a program from Perl5 to Perl 6. This line else { eval "$RunSpecific"; } became this line else { EVAL "$RunSpecific"; } And threw this error $ perl6 -c GetUpdates.pl6 ===SORRY!=== Error while compiling /home/linuxutil/GetUpdates.pl6 EVAL

Should the use of eval recommend EVAL?

2015-09-25 Thread Gabor Szabo
Hi, I just tried to use eval "say 19+23"; but I got: ===SORRY!=== Error while compiling a.pl Undeclared routine: eval used at line 3. Did you mean 'val'? Would it be possible to recommend 'EVAL' as well ? Gabor

Re: variables inside an eval

2006-11-01 Thread Audrey Tang
在 Oct 29, 2006 4:34 PM 時,Richard Hainsworth 寫到: If I have the following my $self = "some text"; my $nself = ~eval(q/"self is $self"/,:lang); then surely $nself should be "self is some text". But it is not. $self is not set inside the eval in pugs. But say ~ev

Re: variables inside an eval

2006-10-30 Thread Audrey Tang
在 Oct 29, 2006 4:34 PM 時,Richard Hainsworth 寫到: If I have the following my $self = "some text"; my $nself = ~eval(q/"self is $self"/,:lang); then surely $nself should be "self is some text". But it is not. $self is not set inside the eval in pugs. The lexi

variables inside an eval

2006-10-30 Thread Richard Hainsworth
If I have the following my $self = "some text"; my $nself = ~eval(q/"self is $self"/,:lang); then surely $nself should be "self is some text". But it is not. $self is not set inside the eval in pugs. But say ~eval(q/"self is $self"/); yields "self

Re: eval

2006-05-25 Thread David Romano
Hi Michael, On 5/24/06, Michael Mathews <[EMAIL PROTECTED]> wrote: Oh "try"! I like that! But is CATCH implemented in pugs? Anyone care to give a working example of try/CATCH? I don't think CATCH is implemented in pugs yet: #!/usr/local/bin/pugs catcher; sub catcher { say "here"; try {

Fwd: eval

2006-05-24 Thread Michael Mathews
Oh "try"! I like that! But is CATCH implemented in pugs? Anyone care to give a working example of try/CATCH? --michael On 25/05/06, Yuval Kogman <[EMAIL PROTECTED]> wrote: To complement string eval with eval { } (now called try): try { die "f

Re: eval

2006-05-24 Thread Larry Wall
On Wed, May 24, 2006 at 06:54:53PM +0300, Gabor Szabo wrote: : if eval "command" fails, where can I get the error message ? : : aka $@ in P5 ? All error variables have been unified into $!, so it should show up there. Larry

Re: eval

2006-05-24 Thread Yuval Kogman
On Wed, May 24, 2006 at 19:54:53 +0300, Gabor Szabo wrote: > if eval "command" fails, where can I get the error message ? > > aka $@ in P5 ? $! http://dev.perl.org/perl6/doc/design/syn/S04.html#Exception_handlers -- Yuval Kogman <[EMAIL PROTECTED]> http:/

eval

2006-05-24 Thread Gabor Szabo
if eval "command" fails, where can I get the error message ? aka $@ in P5 ? Gabor