Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Qs WRT params: flags using get_params and .param notation

1 view
Skip to first unread message

Klaas-Jan Stol

unread,
Jan 15, 2006, 12:16:00 PM1/15/06
to perl6-i...@perl.org
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).

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


Bob Rogers

unread,
Jan 15, 2006, 12:30:08 PM1/15/06
to Klaas-Jan Stol, perl6-i...@perl.org
From: Klaas-Jan Stol <parro...@gmail.com>
Date: Sun, 15 Jan 2006 18:16:00 +0100

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/

Leopold Toetsch

unread,
Jan 15, 2006, 2:20:26 PM1/15/06
to Klaas-Jan Stol, perl6-i...@perl.org

On Jan 15, 2006, at 18:16, Klaas-Jan Stol wrote:

> 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

0 new messages