zsh-workers
 help / color / mirror / code / Atom feed
* Re: zsh-4.2.1: LINENO lost in evals
@ 2004-09-02 13:57 Dieter Lambrecht
  2004-09-02 15:53 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Dieter Lambrecht @ 2004-09-02 13:57 UTC (permalink / raw)
  To: zsh-workers


Hi,

the behaviour of LINENO-behavior may be similiar to perl in some curcumstances. Script

#! /bin/ksh

print $LINENO
eval 'print $LINENO'

used with a real ksh on AIX or Solaris always prints the correct LINENO. The behaviour of zsh is incompatible to ksh, even though in "emulate ksh"-mode.

Kind Regards,

Dieter Lambrecht




                                                                                                                                                                
                      Bart Schaefer                                                                                                                             
                      <schaefer@brassla        To:       zsh-workers@sunsite.dk                                                                                 
                      ntern.com>               cc:       Dieter Lambrecht/DMG/Zentrale/DeuBa@Zentrale                                                           
                                               Subject:  Re: zsh-4.2.1: LINENO lost in evals                                                                    
                      09/01/2004 05:10                                                                                                                          
                      PM                                                                                                                                        
                      Please respond to                                                                                                                         
                      zsh-workers                                                                                                                               
                                                                                                                                                                
                                                                                                                                                                




On Wed, 1 Sep 2004, Peter Stephenson wrote:

> "Dieter Lambrecht" wrote:
> >#! /bin/zsh -x
>
> (There must be a set -x or setopt xtrace lurking somewhere.)

Welcome back, Peter. :-)

> It's not actually lost, it's showing you the line in the eval.  That's
> a feature (compare error messages from Perl evals, which is where we
> pinched the output format from).

The thing is, Perl has two kinds of "eval":

schaefer[676] perl <<\EOF
print __LINE__."\n";
eval 'print __LINE__."\n"';
eval { print __LINE__."\n"; };
EOF
1
1
3

The kind in braces, which gets precompiled, behaves differently than the
 kind in quotes.  Zsh only has the kind in quotes.




--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



^ permalink raw reply	[flat|nested] 5+ messages in thread
* zsh-4.2.1: LINENO lost in evals
@ 2004-08-17  8:27 Dieter Lambrecht
  2004-09-01 12:02 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Dieter Lambrecht @ 2004-08-17  8:27 UTC (permalink / raw)
  To: zsh-workers

Hi,

script

#! /bin/zsh -x
emulate -L zsh

print $LINENO
eval 'print $LINENO'

return


produces the following output:

./t4.sh
+./t4.sh:2> emulate -L zsh
+./t4.sh:4> print 4
4
+./t4.sh:5> eval 'print $LINENO'
+(eval):1> print 1
1
.

It seems that LINENO is lost in the eval-statement. Is there any possibility to retrieve the original value inside evals ?


Kind Regards,

Dieter Lambrecht



--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-02 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-02 13:57 zsh-4.2.1: LINENO lost in evals Dieter Lambrecht
2004-09-02 15:53 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2004-08-17  8:27 Dieter Lambrecht
2004-09-01 12:02 ` Peter Stephenson
2004-09-01 15:10   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).