Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transliteration replacement not terminated message obscure #7337

Closed
p5pRT opened this issue Jun 5, 2004 · 10 comments
Closed

Transliteration replacement not terminated message obscure #7337

p5pRT opened this issue Jun 5, 2004 · 10 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 5, 2004

Migrated from rt.perl.org#30045 (status was 'resolved')

Searchable as RT30045$

@p5pRT
Copy link
Author

p5pRT commented Jun 5, 2004

From @jidanni

Can you please use more friendly English than
"Transliteration replacement not terminated"
$ make array
perl -wle 'use Math​::Trig; $boost=tan(deg2rad(90-298+220));\
$basic=300/105.7*0.80/2/sin(deg2rad(298-220));\
sub y(){for $i(-10..10){printf "%f\n",$boost*$_+$basic*($i*2+1)}};y(0);y(1)'
Transliteration replacement not terminated at -e line 1.

[Yes, this is all considered line 1 as it is Makefile output.]
Yes, there are some misconceptions in the code, I'm sure.
But mainly nobody here can figure out what part of the code perl is
talking about.

@p5pRT
Copy link
Author

p5pRT commented Jun 5, 2004

From tassilo.parseval@post.rwth-aachen.de

On Sat, Jun 05, 2004 at 05​:28​:53AM +0000 Dan Jacobson wrote​:

# New Ticket Created by Dan Jacobson
# Please include the string​: [perl #30045]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org​:80/rt3/Ticket/Display.html?id=30045 >

Can you please use more friendly English than
"Transliteration replacement not terminated"
$ make array
perl -wle 'use Math​::Trig; $boost=tan(deg2rad(90-298+220));\
$basic=300/105.7*0.80/2/sin(deg2rad(298-220));\
sub y(){for $i(-10..10){printf "%f\n",$boost*$_+$basic*($i*2+1)}};y(0);y(1)'
Transliteration replacement not terminated at -e line 1.

[Yes, this is all considered line 1 as it is Makefile output.]
Yes, there are some misconceptions in the code, I'm sure.
But mainly nobody here can figure out what part of the code perl is
talking about.

It's talking about y(). 'y' is an alias for 'tr' and in the above case
perl doesn't reckognize 'y()' as a function call but rather as a crippled
transliteration which - according to perl - should read as

  y()();

With the current behaviour, it seems impossible to have 'y' as a
function and call it with parens. I doubt that this is easy to fix.

Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@​"tnirp}3..0}_$;//​::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?&lt;=sub).+q#q!'"qq.\t$&amp;."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

@p5pRT
Copy link
Author

p5pRT commented Jun 5, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT p5pRT closed this as completed Jun 5, 2004
@p5pRT
Copy link
Author

p5pRT commented Jun 5, 2004

@iabyn - Status changed from 'open' to 'resolved'

@p5pRT
Copy link
Author

p5pRT commented Jun 6, 2004

From perl5-porters@ton.iguana.be

In article <rt-3.0.9-30045-89723.9.88817654916339@​perl.org>,
  Dan Jacobson (via RT) <perlbug-followup@​perl.org> writes​:

Can you please use more friendly English than
"Transliteration replacement not terminated"
Maybe the errormessage can be changed to give you more of a chance to
see what's going on, but it IS actually quite clear and appropiate once
you see whats going on.

$ make array
perl -wle 'use Math​::Trig; $boost=tan(deg2rad(90-298+220));\
$basic=300/105.7*0.80/2/sin(deg2rad(298-220));\
sub y(){for $i(-10..10){printf "%f\n",$boost*$_+$basic*($i*2+1)}};y(0);y(1)'
Transliteration replacement not terminated at -e line 1.

[Yes, this is all considered line 1 as it is Makefile output.]
Yes, there are some misconceptions in the code, I'm sure.
But mainly nobody here can figure out what part of the code perl is
talking about.

perl -MO=Deparse -we 'sub y {}; y(1234);y(1);'
BEGIN { $^W = 1; }
sub y {
 
}
tr/1-4/y(1)/;

y is an alternative name for the tr (Transliteration) operator. And you
can use that one with alternative delimeters, not just //. so the (0) is
the body part, the ; starts the replacement part, and in my example that
gets finished with the final ;. In your code the final ; is missing so
it complains about that.

Basically, don't give your functions names of perl operators to avoid
confusion (don't name them "y", "s", "q" or "m" for the single letters))

@p5pRT
Copy link
Author

p5pRT commented Jun 6, 2004

From @jidanni

"Transliteration replacement not terminated"

(Ton> Basically, don't give your functions names of perl operators to avoid
(Ton> confusion (don't name them "y", "s", "q" or "m" for the single letters))

OK, the error messages should perhaps mention what letter was
bothering them, instead of hoping we on the spot will remember that y
is an alias for tr which stands for Transliteration.

The user was thinking "I'll plot y as a function of x", and could not
tell from the message what went wrong, especially as it is all on one
line being from a makefile.

Indeed, I bet if line numbers were removed, perl error messages would
lose to gawk in terms of clarity.

Gawk often points out just where things went wrong, with a ^.

@p5pRT
Copy link
Author

p5pRT commented Jun 7, 2004

From @ysth

On Mon, Jun 07, 2004 at 03​:10​:24AM +0800, Dan Jacobson <jidanni@​jidanni.org> wrote​:

"Transliteration replacement not terminated"

(Ton> Basically, don't give your functions names of perl operators to avoid
(Ton> confusion (don't name them "y", "s", "q" or "m" for the single letters))

OK, the error messages should perhaps mention what letter was
bothering them, instead of hoping we on the spot will remember that y
is an alias for tr which stands for Transliteration.

The user was thinking "I'll plot y as a function of x", and could not
tell from the message what went wrong, especially as it is all on one
line being from a makefile.

Indeed, I bet if line numbers were removed, perl error messages would
lose to gawk in terms of clarity.

Gawk often points out just where things went wrong, with a ^.

Running with with "use diagnostics;" (or feeding the warning/error message to
the splain utility) produces a more verbose description. Unfortunately,
the one for an unclosed tr/... mentions y/// but the an unclosed tr//....
doesn't.

Inline Patch
--- perl/pod/perldiag.pod.orig	2004-05-13 05:36:23.000000000 -0700
+++ perl/pod/perldiag.pod	2004-06-07 00:25:10.655542400 -0700
@@ -3835,7 +3835,7 @@
 =item Transliteration replacement not terminated
 
 (F) The lexer couldn't find the final delimiter of a tr/// or tr[][]
-construct.
+or y/// or y[][] construct.
 
 =item '%s' trapped by operation mask
 

@p5pRT
Copy link
Author

p5pRT commented Jun 7, 2004

From nick@ing-simmons.net

Tassilo Parseval <tassilo.parseval@​post.rwth-aachen.de> writes​:

It's talking about y(). 'y' is an alias for 'tr' and in the above case
perl doesn't reckognize 'y()' as a function call but rather as a crippled
transliteration which - according to perl - should read as

y()();

In his code I think it is expecting
  y(){}

I think the fix is add a space​:
  y() { ...

With the current behaviour, it seems impossible to have 'y' as a
function and call it with parens. I doubt that this is easy to fix.

Tassilo

@p5pRT
Copy link
Author

p5pRT commented Jun 7, 2004

From nick@ing-simmons.net

Nick Ing-Simmons <nick@​ing-simmons.net> writes​:

Tassilo Parseval <tassilo.parseval@​post.rwth-aachen.de> writes​:

It's talking about y(). 'y' is an alias for 'tr' and in the above case
perl doesn't reckognize 'y()' as a function call but rather as a crippled
transliteration which - according to perl - should read as

y()();

In his code I think it is expecting
y(){}

I think the fix is add a space​:
y() { ...

Which is fine for the declare but then you need to add an & on the call.

#!perl
sub y() { print "Hello\n" }
&y();
__END__

Does work but is messy.
I knew it could be made to work as Tk often has x and y (both of which
are operators) and has come up before.

With the current behaviour, it seems impossible to have 'y' as a
function and call it with parens. I doubt that this is easy to fix.

Tassilo

@p5pRT
Copy link
Author

p5pRT commented Jun 9, 2004

From @rgs

Yitzchak Scott-Thoennes wrote​:

Running with with "use diagnostics;" (or feeding the warning/error message to
the splain utility) produces a more verbose description. Unfortunately,
the one for an unclosed tr/... mentions y/// but the an unclosed tr//....
doesn't.

--- perl/pod/perldiag.pod.orig 2004-05-13 05​:36​:23.000000000 -0700
+++ perl/pod/perldiag.pod 2004-06-07 00​:25​:10.655542400 -0700

Thanks, applied as #22923.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant