Amir Karger wrote:
If I say perl Zcode/t/harness I want it to run parrot Zcode/z3.imc
testfile.z3. My current problem is that z3.imc includes a file
z3main.imc. So the above command breaks because z3.imc can't find the
include file. If this were Perl, I would just say Perl-IZcode
Zcode/z3.imc
If I say perl Zcode/t/harness I want it to run parrot Zcode/z3.imc
testfile.z3. My current problem is that z3.imc includes a file
z3main.imc. So the above command breaks because z3.imc can't find the
include file. If this were Perl, I would just say Perl-IZcode
Zcode/z3.imc testfile.z3. But I
.sub _main
fdopen $P1, 0, r # STDIN
BTW
fdopen $P1, 0, # read STDIN
3. its currently only defined for PIO_OS_UNIX
Okaaay, so the plan is for this to work and I should probably code this way anyway,
right?
You could just delete the #ifdef
Clinton Pierce wrote:
set P1[0], P0
getstdout P0# -- bug is here? Overwrote my P0.
set P1[1], P0
Yep a bug is here. But this bug is a BASIC compiler bug. Things that go
into aggregates (or are stored in lex pads/global tables) are stored by
reference. You
Clinton Pierce wrote:
new $P4, PerlArray
A current workaround for the missing clone in ParrotIO:
getstdin P0
getstdout P1
getstderr P2
$P4[0], P0
$P4[1], P1
$P4[2], P2
leo
Clinton Pierce [EMAIL PROTECTED] writes:
Given that, there's a possible bug in Jürgen's patch (or IMCC?). Given:
.sub _main
call _INIT
.arg 0
call _READLINE
.result $S0
print $S0
end
.end
.sub _INIT
$P0=new PerlArray # Array of BASIC
I'm not sure whether getstd\w+ is supposed to give me a new reference or not. From
now on I'll code that portion defensively.
What I do know is that imcc -t under Win32 is crash-happy and I can't trace beyond the
first getstdin. Greatly simplified example:
.sub _main
$P0=new PerlArray
Typo!
getstderr P3 # STDOUT
Should have been getstdout
Although... if left at getstderr the error also goes away. (Add that to my bullet
list.) My haven't-grokked-the-code psychic abilities tell me that getstdout does
something Real Bad to the stdout filehandle and
Clinton Pierce wrote:
What I do know is that imcc -t under Win32 is crash-happy
Snippet runs fine on Linux (with typo adjusted or not) as well as your
previous one, -t or not.
But, as IO is under *construction* some issues might remain. They'll get
resolved.
leo
Clinton A. Pierce (via RT) wrote:
Suggestions welcome!
First, always check the result of IO operations. If something fails,
these return a PerlUndef, so:
.sub _main
fdopen $P1, 0, r # STDIN
defined $I0, $P1
unless $I0, err
read $S0, $P1, 255
print $S0
First, always check the result of IO operations. If something fails,
these return a PerlUndef, so:
.sub _main
fdopen $P1, 0, r # STDIN
defined $I0, $P1
*Doh* Stupid Newbie Error.
unless $I0, err
read $S0, $P1, 255
Clinton Pierce [EMAIL PROTECTED] wrote:
.sub _main
fdopen $P1, 0, r # STDIN
BTW
fdopen $P1, 0, # read STDIN
3. its currently only defined for PIO_OS_UNIX
Okaaay, so the plan is for this to work and I should probably code this way anyway,
right?
# New Ticket Created by Clinton A. Pierce
# Please include the string: [perl #22854]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22854
This is either an oversight in the current implementation *or* its a bug. Or
13 matches
Mail list logo