end never actually gets called. It can do whatever it wants. When the
interpreter sees an opcode with a value of 0 (which end is currently the
only one with that opcode), it will immediately stop execution (without
executing the end function).
-----Original Message-----
From: Dave Storrs
To: Gibbs Tanton - tgibbs
Cc: 'The Perl 6 Internals list '
Sent: 9/20/2001 12:32 AM
Subject: RE: question about branching/returning
Ok, that was pretty much what I thought. But then what is the 'end'
opcode for? It does a 'RETURN 0', which would increment the PC by 0
opcodes...which either counts as an infinite loop or a no-op, and we've
already got a no-op op.
Dave
On Thu, 20 Sep 2001, Gibbs Tanton - tgibbs wrote:
> RETURN causes the program counter to be incremented by that many
opcodes.
> So RETURN 4 would move forward 4 opcodes and RETURN -2 would move
backward 2
> opcodes. Basically, it returns a relative offset from the current
position.