who to get subroutine caller context with pugs

2 views
Skip to first unread message

Gerd Pokorra

unread,
Jun 28, 2005, 5:02:48 AM6/28/05
to perl6-c...@perl.org

Hello,

I am using pugs 6.2.7. Is it already possible to find out if a
subroutine
was called in a void context. Does the want function provide this
feature.

Gerd Pokorra

Autrijus Tang

unread,
Jun 29, 2005, 9:26:19 AM6/29/05
to Gerd Pokorra, perl6-c...@perl.org
On Tue, Jun 28, 2005 at 11:02:48AM +0200, Gerd Pokorra wrote:
> I am using pugs 6.2.7. Is it already possible to find out if a
> subroutine was called in a void context. Does the want function
> provide this feature.

In the interactive shell you can try it out:

pugs> want
'Void'

However I see that the individual statements are still executed
in Slurpy context:

$ pugs -e 'sub foo { say want }; foo; bar;'
List (Any)

That I think is a bug. Can you add some tests to t/builtins/want.t
to exercise that feature? I have sent a commit bit invitation mail
to you preemptively. :-)

Thanks!
/Autrijus/

Reply all
Reply to author
Forward
0 new messages