On Wed, Aug 08, 2007 at 09:20:50PM -0700, Colin Kuskie wrote:
> repeat isn't an operator, it's a function in this context.
> Describe what it does.

Actually, 'repeat' is an opcode here.  The PIR statement

    $S1 = repeat $S0, 3

is just syntactic sugar for the PASM operation

    repeat $S1, $S0, 3

So, it's really an operation, not a function, at least in the way
that I tend to think of "operators" and "functions".  

In PIR, if this were to be a function call -- i.e., a call to
a subroutine -- then it would be written as either

    $S1 = 'repeat'($S0, 3)         # preferred
    $S1 = repeat($S0, 3)           # also works if no 'repeat' symbol defined

In other words, subroutine calls in PIR _always_ contain parens.



Others may correct me on this, but I think that as a general
rule, any PIR statement of the form

    target = opcode [arg1, arg2, ...]

is simply syntactic sugar for the PASM equivalent

    opcode target [, arg1, arg2, ...]

Pm

Reply via email to