Juergen Boemmels wrote:
> 
> Benjamin Goldberg <[EMAIL PROTECTED]> writes:
> 
> > > Normal processors also don't have setline and setfile operations. They
> > > use an extra segment in the *.o file, which is only used by the
> > > debugger. This could also be done in parrot.
> >
> > In other words, setline and setfile ops in source don't translate to
> > actual ops in the bytecode, but instead translate to additions/changes
> > to the debugging segment?
> 
> In principle yes. But as they are no opcodes any more they should not
> look like ones. They should be written .setline or #setline

Ok.

> >>>    #line 17 "sourcefile.p6"
> 
> > I don't like this syntax -- it sounds too easy for someone to write a
> > comment like:
> >
> > #When this was in the original foobar language, it was on
> > #line 17
> >
> > And have it interpreted as a directive, when the author meant for it
> > to be just a comment.
> 
> from the point of the bytecode this is just a comment. No different
> bytecode is generated with or without this line. Only for the
> debugsegment gets other information.

I wasn't suggesting that it might produce different bytecode, but it
could concievable produce incorrect debugging info.

> > There's no reason not to have the directives look like ops (setline,
> > setfile).
> 
> No they should not look like ops. They are no ops.
> 
> They might look like macros .setfile, macros can evaluate to nothing.

Ok.

> > Oh, and you could have get{line,file} directives, which end up
> > translated as being simple "set" ops, using the info generated by the
> > set{line,file} directives.
> 
> Same here. Use .getline macros which are expanded to a set
> operation. Or better use a .currentline macro which expands to the
> current line. Much like the __LINE__ macro in C.

Hmm.  Definitely better.  Then it can be used as an argument to any op,
not just to set.

So, what values does .currentline have inside of another macro?

Do macros have their own line number context, or do they get the context
from the code they're being called from?

Is this a whole bucket of worms, or just a small can of worms?

-- 
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED]
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

Reply via email to