use dummy field as part of the goto label
Jay R. Ashworth
jra at baylink.com
Tue May 6 09:42:27 PDT 2008
On Tue, May 06, 2008 at 12:17:47PM -0400, Kenneth Brody wrote:
> > To expand this answer, no, the argument to a GOTO or GOSUB cannot be a
> > variable's contents (that I know of). It must be a literal.
>
> Another way of putting it might be "it must be a compile-time constant". :-)
>
> Basically, it must be resolvable at compile time.
And, since we don't have compile-time macros, that means it has to be a
literal. I'm pretty sure that he couldn't do what he wanted to do even
if both parts of his expression were dummies that were assigned from
literals on the preceding line, no?
> > If the handling of this issue was first-class,
>
> I'm not sure what you mean by "first-class" here.
I mean that, as nearly as I can model it, the parsing of (dummy) is not
being handled by the parser, it's being handled in each individual
lexer routine called by the parser.
Generally, by "first-class", I mean that syntactical constructs -- of
which "put parens around (at least) the name of a variable (and
preferably 'an expression') and I'll let you use it where you would
normally need an unquoted literal, syntactically" should be handled by
the parser itself, and routines it calls, and not by individual lexer
routines (like the routine that handles the LOOKUP command and it's
arguments, for example).
This guarantees that the same facility is available everywhere, and that
it works the same way everywhere -- and that you guys only have to
maintain it once, incidentally. :-)
> Again, the destination for goto and gosub must be resolvable at compile
> time. Could a future version of the filePro virtual machine (let's try
> to stay buzzword-compliant here) be enhanced to allow these destinations
> to be runtime-resolvable? Yes, it would be possible.
Ah. Ok; I can see why you'd do it that way, and that would be a good
reason to override (dummy) dereference for those particular commands.
It seems to me that there are *other* places we might want to do that
that we can't, but I can't remember one at the moment...
Cheers,
-- jra
--
Jay R. Ashworth Baylink jra at baylink.com
Designer The Things I Think RFC 2100
Ashworth & Associates http://baylink.pitas.com '87 e24
St Petersburg FL USA http://photo.imageinc.us +1 727 647 1274
Those who cast the vote decide nothing.
Those who count the vote decide everything.
-- (Joseph Stalin)
More information about the Filepro-list
mailing list