I have 2 questions wrt PIR parameter notation and usage.
I'm not quite sure how I should specifiy the flags when using
get_params, instead of the .param notation.
according to PDD03, flag "3" is for specifiying slurpy parameters.
Should I type:
get_params "(3)", $P0
to say $P0 is a slurpy array?
(this doesn't work).
Also, according to the syntax docs of PIR, it should be possible to write:
(taken from: http://www.parrotcode.org/docs/imcc/syntax.html)
.param $P0 <flags>
so, using registers, not names. This does not work currently, but it's
in the docs. Should it be working?
regards,
klaas-jan
hi,
I have 2 questions wrt PIR parameter notation and usage.
I'm not quite sure how I should specifiy the flags when using
get_params, instead of the .param notation.
according to PDD03, flag "3" is for specifiying slurpy parameters.
Should I type:
get_params "(3)", $P0
to say $P0 is a slurpy array?
(this doesn't work).
PDD03 says "bit 3", so you need
get_params "(8)", $P0
for example.
Also, according to the syntax docs of PIR, it should be possible to write:
(taken from: http://www.parrotcode.org/docs/imcc/syntax.html)
.param $P0 <flags>
so, using registers, not names. This does not work currently, but it's
in the docs. Should it be working?
regards,
klaas-jan
Hadn't noticed this was in the docs. I would also like this to work
. . .
-- Bob Rogers
http://rgrjr.dyndns.org/
> get_params "(3)", $P0
That's already answered, it's bit 3, 1 << 3, or 0b1000, or 0x8.
> .param $P0 <flags>
E.g.:
.param pmc p0 :optional
.param int has_p0 :opt_flag
or
.param pmc args :slurpy
or even:
(result :slurpy) = foo(bar, baz :flat)
All the flags have some syntactic sugar in PIR.
> regards,
> klaas-jan
leo