Just a few comments from a brief review of pdd19:

> =item 'char constant'
> 
> Are delimited by single-quotes (C<'>). They are taken to be ASCII encoded. No
> escape sequences are processed.

What exactly does "They are taken to be ASCII encoded" mean here?
For example, what happens if I write a statement like...?

    say '«hello»'

> =item .lex <identifier>, <reg>
> 
> Declare a lexical variable that is an alias for a PMC register. The
> PIR compiler calls this method in response to a .lex STRING, PREG
> directive. For example, given this preamble:

The part about "The PIR compiler calls this method ..." is ambiguous 
here -- what method is "this method"?  I think the second sentence can
be eliminated altogether (I suspect it was just copy+pasted from the 
lexicals PDD).

> =item .HLL "<hll_name>", "<hll_lib>"
> [...]
> =item .HLL_map '<CoreType>', '<UserType>'

Are the double-quotes and single-quotes part of the syntax specification --
i.e., are double-quotes required with .HLL while single-quotes
are required with .HLL_map ?

More directly, is a PIR program allowed to use any string
constant specification for these directives, or is it limited
limited to bare double-quote strings for .HLL and single-quoted 
strings for .HLL_map ?

> =head3 Directives for subroutine parameters and return
> =over 4
>
> =item .param <type> <identifier> [:<flag>]*
>   [...]
>
> =item .param <type> "<identifier>" => <identifier> [:<flag>]*
>   [...]
>
> =item .return <var> [:<flag> ...]
> 
> Between C<.begin_return> and C<.end_return>, specify one or
> more of the return value(s) of the current subroutine.  Available
> flags: C<:flat>, C<:named>.

This is probably not the C<.return> the typical PIR programmer
will be looking for.  IMO, the C<.return> directives that are 
documented along with C<.param> are the ones that are normally 
used in PIR -- i.e., the ones that allow for multiple values to 
be returned to the caller or that specify tailcalls.

In general to aid understanding and readability, I think that
all of the PASM-oriented directives (.emit, .eom, .begin_*, .end_*,
and this particular use of .return) ought to go in a section separate 
from and after all the "normal" PIR directives and syntactic sugar have 
been covered.  

> =item <var> = new '<type>'
> ...
> =item <var1> = new '<type>', <var2>
> ...
> =item <var1> = defined <var2>
> ...
> =item <var1> = defined <var2> [ <var3> ]
> ...
> =item <var1> = clone <var2>
> ...
> =item <var> = addr <identifier>
> ...
> =item <var> = null

Are these in fact specially-defined syntactic sugar in PIR,
or are they simply instances of the more generic

    <var> = <opcode> <param>

that is automatically translated into

    <opcode> <var>, <param>

If they're specially-defined syntactic sugar, then why?  If not, 
then why are these particular examples in the PIR documentation 
where others are not mentioned?


Pm

Reply via email to