Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PCT patch
I was annoyed that

parrot perl6.pbc --target=PAST -e 'say "Hello"'

didn't seem to work, so I modified PCT/HLLCompiler so that it does.

I'm not sure it's entirely correct though as I only tested it for the
limited functionality I was after.

I've attached the patch though.

-Scott
--
Jonathan Scott Duff
perlpilot@gmail.com


Report this thread to moderator Post Follow-up to this message
Old Post
Jonathan Scott Duff
04-18-08 10:25 AM


Re: PCT patch
On Thu, Apr 17, 2008 at 10:10:29PM -0500, Jonathan Scott Duff wrote:
> I was annoyed that
>    parrot perl6.pbc --target=PAST -e 'say "Hello"'
> didn't seem to work, so I modified PCT/HLLCompiler so that it does.
>
> I'm not sure it's entirely correct though as I only tested it for the
> limited functionality I was after.
>
> I've attached the patch though.

I'm rejecting the patch for now.  The patch refactors all of the output
functionality for --target into HLLCompilers 'eval' method, and somehow
I think that 'eval' should only be responsible for performing evaluation
and not for dumping output.

There also seems to be a bug in the patch, at least for some combinations
of arguments.  After the patch is applied, the 'eval' method reads:

$P0 = self.'compile'(code, adverbs :flat :named)
$I0 = ISA $P0, 'String'
if $I0 goto end
.local string target
target = adverbs['target']
if target != '' goto end
..
end:
if null $P0 goto real_end
unless target goto real_end
if target == 'pir' goto target_pir
'_dumper'($P0,target)
goto real_end
target_pir:
say $P0
real_end:

We can never get to the 'say $P0' line following target_pir.  If the
command line specified --target=pir, then self.'compile'(...) will
return a String object, and we end up bypassing the
target = adverbs['target'] line altogether.

Simply moving the target = adverbs['target'] line above the test
for a String will introduce other problems, as then the PIR from
--target=PIR will be displayed regardless of any setting of the
--output= option.

Overall I think we may need a larger refactor of
interactive/evalfiles/eval_line to be able to handle this
more cleanly.  But keep in mind the processing for each case isn't
exactly identical -- handling of exceptions and results can differ
among the three.  For example, interactive mode traps exceptions,
while the others don't.

We should also keep in mind that we will likely want a --target=pbc
option at some point in the not-too-distant future.

Thanks!

Pm


Report this thread to moderator Post Follow-up to this message
Old Post
Patrick R. Michaud
04-22-08 01:50 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Perl 6 Compiler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:15 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.