ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-internals
perl6-internals
Past-pm basic string types
by Allison Randal other posts by this author
Dec 12 2006 9:43AM messages near this date
Re: Past-pm printing the return value of the main routine | Re: Past-pm basic string types
Patrick, what's the best way to pass-through string types from a 
compiler to Parrot without doing full string processing? To pass the 
current tests, Punie only needs Parrot's single- and double-quoted 
strings, but Past-pm is escaping them. So:

   print "\n";

reaches the PIR translation as:

   print "\\n"

(I will add full string processing to Punie later, but since other 
compilers will also need basic Parrot string types, it makes sense to 
figure it out now.)

Allison


From: Allison Randal <allison@[...].org> 
X-Virus-Check-By: mailtest2.pair.com
X-Spam-Check-By: mailtest2.pair.com
X-Spam-Status: No, hits=-2.6 required=4.3 tests=BAYES_00 autolearn=ham version=3.001007
X-Spam-Flag: NO
X-Spam-Level: 
X-Spam-Filtered: 052f96e22adcb440ba93d277d4a1272f
Mailing-List: contact perl6-all-help@perl.org; run by ezmlm
Precedence: bulk
List-Post: <mailto:perl6-all@[...].org> 
List-Help: <mailto:perl6-all-help@[...].org> 
List-Unsubscribe: <mailto:perl6-all-unsubscribe@[...].org> 
List-Subscribe: <mailto:perl6-all-subscribe@[...].org> 
List-Id: <perl6-all.perl.org> 
Delivered-To: mailing list perl6-all@[...].org
Delivered-To: perl6-all-poster@[...].org
Received-SPF: pass (x1.develooper.com: local policy)
X-Mailing-List: contact perl6-internals-help@perl.org; run by ezmlm
X-Mailing-List-Name: perl6-internals
List-Id: <perl6-internals.perl.org> 
Delivered-To: mailing list perl6-internals@[...].org
Delivered-To: perl6-internals@[...].org
Received-SPF: neutral (x1.develooper.com: local policy)
Message-ID: <457EEB24.8040009@[...].org> 
Date: Tue, 12 Dec 2006 09:47:16 -0800
User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025)
MIME-Version: 1.0
To: Perl 6 Internals <perl6-internals@[...].org> 
Subject: Past-pm printing the return value of the main routine
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Old-Spam-Check-By: la.mx.develooper.com
X-Old-Spam-Status: No, hits=-2.5 required=8.0
	tests=BAYES_00,FORGED_RCVD_HELO

In Punie or Perl 6, when I execute a simple statement:

   print "2";

It prints "21". This is because a) the return value of a successful 
print is "1", b) the main routine is returning the value of the last 
statement (note this is correct for Perl, but isn't correct for all 
languages), and c) HLLCompiler is printing out the return value of the 
eval'd code here:

     376   save_output_1:
     377     print ofh, result
     378     close ofh

Commenting out line 377 gives the correct behavior of just printing "2". 
My question is, why is HLL compiler printing out the return value of the 
main routine?

Allison
Thread:
Allison Randal
Patrick R. Michaud
Allison Randal
Patrick R. Michaud

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved