Nathan Torkington <[EMAIL PROTECTED]> writes:

> Edward Peschko writes:
> > Ok, question here. Are these exegesises 'blessed'? What is open to
> > debate on this?
> 
> As Simon says, ask whatever questions you want.
> 
> >   print "Post order: "; show($root,$post); print "\n";
> > would be better off written as:
> >   print "Post order: &show($root, $post)\n";
> > wouldn't it?
> 
> Yes, except that you're relying on show() not returning a value there.
> If show() was written so that it happened to have a print statement as
> the last thing in the sub, then you'd get random 1s in your output.

Am I the only one here who's confused?

How does the printing happen in the correct order?  I mean, if I said

    my $x = "Post order: &show($root, $post)\n";
    print $x;

then (I hope) we're agreed printing would happen in the *wrong* order
(first the output of show($root, $post), then the value of $x (and $x
eq "Post order: \n").

So how come `print' gets to mung about with evaluation order?

[...]

Hoping for illumination,

-- 
Ariel Scolnicov        |"GCAAGAATTGAACTGTAG"            | [EMAIL PROTECTED]
Compugen Ltd.          |Tel: +972-2-5713025 (Jerusalem) \ We recycle all our Hz
72 Pinhas Rosen St.    |Tel: +972-3-7658117 (Main office)`---------------------
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555    http://3w.compugen.co.il/~ariels

Reply via email to